Commits

Marc-Antoine Parent committed 05fc8d9

inference option; repair horrid eager iterator

  • Participants
  • Parent commits 60a90f7

Comments (0)

Files changed (2)

File virtuoso/tests/test_rdflib3.py

     @classmethod
     def setUp(cls):
         cls.store = Virtuoso("DSN=VOS;UID=dba;PWD=dba;WideAsUTF16=Y")
-        cls.identifier = URIRef("http://example.org/")
+        cls.identifier = URIRef("http://example2.org/")
         cls.graph = Graph(cls.store, identifier=cls.identifier)
         cls.graph.remove((None, None, None))
 

File virtuoso/vstore.py

         self.g = g
         self.done = False
         try:
-            self.next = g.next()
+            self.next_val = g.next()
         except StopIteration:
             self.done = True
     def __iter__(self):
     def next(self):
         if self.done:
             raise StopIteration()
-        a = self.next
+        a = self.next_val
         try:
-            next = self.g.next()
+            self.next_val = self.g.next()
         except StopIteration:
             self.done = True
         finally:
 
     def __init__(self, *av, **kw):
         self.long_iri = kw.pop('long_iri', False)
+        self.inference = kw.pop('inference', None)
         super(Virtuoso, self).__init__(*av, **kw)
         self._transaction = None
 
                     DEBUG=False, cursor=None, commit=False):
         if self.long_iri:
             q = u'DEFINE output:valmode "LONG" ' + q
+        if self.inference:
+            q = u'DEFINE input:inference <%s> %s' % (self.inference, q)
         q = u'SPARQL ' + q
         if cursor is None:
             if self._transaction is not None: