I have set up Virtuoso DB on my machine and I can successfully query it using ODBC's ISQL and Virtuoso's ISQL environments. However, I have no luck trying to do the same thing using librdf's Python bindings:<br>
<br>Let's add a triple:<br>$ rdfproc -r xml -s virtuoso -t "user='usr',password='psw',dsn='VOS'" somecontext add aa bb cc<br>rdfproc: added triple to the graph<br><br>Make sure it is actually added:<br>
CALL DB.DBA.SPARQL_EVAL('SELECT * FROM NAMED <somecontext> {GRAPH <somecontext> {?s ?p ?o}}', NULL, 0)<br>...<br>1 row fetched<br><br>Try doing the same using librdf in Python:<br>>>> store = RDF.Storage(storage_name="virtuoso", name="somecontext", options_string="dsn='VOS',user='usr',password='psw'")<br>
>>> model = RDF.Model(store)<br>>>> query = RDF.SPARQLQuery('SELECT * WHERE {?s ?p ?o}')<br>>>> results = query.execute(model)<br>>>> results.next()<br>Traceback (most recent call last):<br>
File "<stdin>", line 1, in <module><br> File "/usr/lib/python2.6/site-packages/RDF.py", line 2022, in next<br> raise StopIteration<br>StopIteration<br><br>Here I get 0 results. Storage seems to be initialized successfully, but maybe there's something with context or the way I use model?<br>
<br>Any hint what could be wrong?<br><br>-- <br>Rimvydas<br>