1. okfn
  2. ordf

Commits

w...@eris.okfn.org  committed 901cf0a

fix sparql query with rdflib

  • Participants
  • Parent commits a484c9c
  • Branches default

Comments (0)

Files changed (2)

File ordf/handler/__init__.py

View file
         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")
 

File ordf/handler/rdf.py

View file
         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):
     """