I have set up Virtuoso DB on my machine and I can successfully query it using ODBC&#39;s ISQL and Virtuoso&#39;s ISQL environments. However, I have no luck trying to do the same thing using librdf&#39;s Python bindings:<br>
<br>Let&#39;s add a triple:<br>$ rdfproc -r xml -s virtuoso -t &quot;user=&#39;usr&#39;,password=&#39;psw&#39;,dsn=&#39;VOS&#39;&quot; 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(&#39;SELECT * FROM NAMED &lt;somecontext&gt; {GRAPH &lt;somecontext&gt; {?s ?p ?o}}&#39;, NULL, 0)<br>...<br>1 row fetched<br><br>Try doing the same using librdf in Python:<br>&gt;&gt;&gt; store = RDF.Storage(storage_name=&quot;virtuoso&quot;, name=&quot;somecontext&quot;, options_string=&quot;dsn=&#39;VOS&#39;,user=&#39;usr&#39;,password=&#39;psw&#39;&quot;)<br>
&gt;&gt;&gt; model = RDF.Model(store)<br>&gt;&gt;&gt; query = RDF.SPARQLQuery(&#39;SELECT * WHERE {?s ?p ?o}&#39;)<br>&gt;&gt;&gt; results = query.execute(model)<br>&gt;&gt;&gt; results.next()<br>Traceback (most recent call last):<br>
  File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;<br>  File &quot;/usr/lib/python2.6/site-packages/RDF.py&quot;, 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&#39;s something with context or the way I use model?<br>
<br>Any hint what could be wrong?<br><br>-- <br>Rimvydas<br>