{"issue":{"created_at":"2011-11-25T10:21:38Z","state":"closed","updated_at":"2011-12-05T16:28:26Z","comments":2,"user":{"gravatar_id":"438f224f8c153154963795b2414062c0","id":1212331,"url":"https://api.github.com/users/JanDe","login":"JanDe","avatar_url":"https://secure.gravatar.com/avatar/438f224f8c153154963795b2414062c0?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"Hi All,\r\n\r\nI tried to modify the getAvailableModels() method in the ModelList extension. (in Erfurt/Store/Adapter/Virtuoso.php)\r\n\r\nI changed the SQL query to a SPARQL query. But it doesn't work.\r\n\r\nmy code:\r\n    public function getAvailableModels()\r\n    {\r\n        if (null === $this->_graphs) {\r\n            $this->_graphs = array();\r\n\t    $rid = $this->_execSparql('SELECT DISTINCT ?resourceUri FROM <http://mde.wolterskluwer.de/wkdDocument/wkd.nt> WHERE{ ?resourceUri rdf:type  <http://mde.wolterskluwer.de/wkdDocument> }');\r\n            if ($rid) {\r\n\t\t$graphs = $this->_odbcResultToArray($rid);      \t\t\r\n\t\t$this->_graphs = array();\r\n                foreach ($graphs as $graph) {\r\n                    $this->_graphs[$graph] = array('modelIri' => $graph);           \t\t\r\n\t\t}\r\n            }          \r\n        }\r\n\r\nAt 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.\r\n\r\n\r\n(When i do the SPARQL query in Virtuoso i get back: \r\n\r\nresourceUri\r\nhttp://schema.wolterskluwer.de/resource/abn.rdf\r\n\r\nSo my SPARQL query is correct.)","assignee":null,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"id":2348097,"number":17,"labels":[],"title":"Receive Knowledge bases with SPARQL Query","html_url":"https://github.com/AKSW/OntoWiki/issues/17","closed_at":"2011-12-05T16:28:26Z","url":"https://api.github.com/repos/AKSW/OntoWiki/issues/17","milestone":null},"action":"created","comment":{"created_at":"2011-12-05T16:28:26Z","updated_at":"2011-12-05T16:28:26Z","user":{"gravatar_id":"75f3befdea0cf2be035a9558da08cd57","id":797614,"url":"https://api.github.com/users/jbrekle","login":"jbrekle","avatar_url":"https://secure.gravatar.com/avatar/75f3befdea0cf2be035a9558da08cd57?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"I am not sure if this is a valid issue. \r\nwhen you say\r\n> getAvailableModels() method in the ModelList extension. (in Erfurt/Store/Adapter/Virtuoso.php)\r\ndo you mean you want to change the behaviour of the modellist extension by changing the getAvailableModels() method in Erfurt/Store/Adapter/Virtuoso.php?\r\n> my program crashes when I run this\r\nwhat is the error message?\r\n\r\nGenerally there are two problems about this issue: First (and most important) - the getAvailableModels method is not meant to be customized for use cases. It has a fixed semantic and that is to list the models that are managed by erfurt. If you alter it like that, you might get unexpected behaviour at many other points. If you want all wkdDocuments as a model, maybe you rather write a script that imports them (if there are not so many) or some other trick _reusing_ our framework - but I dont know exactly what you plan to do. Also this is more an Erfurt issue. And second: this is neither a enhancement request nor bug report. Helping you programming with our framework is beyond our capabilities, but if you can transform it into a precise ER or BR, we might can help you.\r\n\r\nplease reopen if I misunderstood you.","id":3019170,"url":"https://api.github.com/repos/AKSW/OntoWiki/issues/comments/3019170"}}