Skip to content

Commit

Permalink
Fixes compatibility with Python 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Tpt committed Mar 31, 2022
1 parent 16b3992 commit b6f34f4
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions oxrdflib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,8 @@ def contexts(self, triple=None):
return (_from_ox(q[3]) for q in self._inner.quads_for_pattern(*_to_ox_quad_pattern(triple)))

def query(self, query, initNs, initBindings, queryGraph, **kwargs):
query = (
"".join(
f"PREFIX {prefix}: <{namespace}>\n"
for prefix, namespace in (self._namespace_for_prefix | initNs).items()
)
+ query
)
initNs = dict(self._namespace_for_prefix, **initNs)
query = "".join(f"PREFIX {prefix}: <{namespace}>\n" for prefix, namespace in initNs.items()) + query
if initBindings:
query += "\nVALUES ( {} ) {{ ({}) }}".format(
" ".join(f"?{k}" for k in initBindings.keys()), " ".join(v.n3() for v in initBindings.values())
Expand Down

0 comments on commit b6f34f4

Please sign in to comment.