Commits

Anonymous committed 901cf0a

fix sparql query with rdflib

Comments (0)

Files changed (2)

ordf/handler/__init__.py

         elif hasattr(self, "rdflib"):
             prefixes = ["PREFIX %s: <%s>" % (k, namespaces[k]) for k in namespaces]
             q = "\n".join(prefixes) + "\n" + q
-            return rdflib.query(q)
+            return self.rdflib.query(q)
         else:
             raise AttributeError("No SPARQL Implementations")
 

ordf/handler/rdf.py

         del self[g]
 
     def query(self, *av, **kw):
-        g = ConjunctiveGraph(self.store)
-        return g.query(*av, **kw)
+        if hasattr(self.store, "sparql_query"):
+            return self.store.sparql_query(*av, **kw)
+        else:
+            g = ConjunctiveGraph(self.store)
+            return g.query(*av, **kw)
 
 class FourStore(RDFLib):
     """