AKSW/OntoWiki — Issue #17: Receive Knowledge bases with SPARQL Query
Author: JanDe
Created: 2011-11-25 10:21:38+00:00
State: open

Hi All,

I tried to modify the getAvailableModels() method in the ModelList extension. (in Erfurt/Store/Adapter/Virtuoso.php)

I changed the SQL query to a SPARQL query. But it doesn't work.

my code:
public function getAvailableModels()
{
if (null === $this->_graphs) {
$this->_graphs = array();
$rid = $this->_execSparql('SELECT DISTINCT ?resourceUri FROM WHERE{ ?resourceUri rdf:type }');
if ($rid) {
$graphs = $this->_odbcResultToArray($rid);
$this->_graphs = array();
foreach ($graphs as $graph) {
$this->_graphs[$graph] = array('modelIri' => $graph);
}
}
}

At the moment my program crashes when I run this. But when I comment the line '$this->_graphs[$graph] = array('modelIri' => $graph);' the program doesn't crash anymore.

(When i do the SPARQL query in Virtuoso i get back:

resourceUri
http://schema.wolterskluwer.de/resource/abn.rdf

So my SPARQL query is correct.)