Description
RDFLib SPARQL query processor considers the initBindings
parameter of the Store
/Graph
query
method as a set of binds to do at the beginning of the query, inside of the SELECT expression. However SPARQLStore
considers it as a join to be done after the query have been processed using a final VALUES
clause when it generates a SPARQL query to send to the remote store.
For example the call
store.query("SELECT ?s WHERE { FILTER(BOUND(?s)) }", initBindings={Variable("s"): URIRef("http://example.com/foo")})
will be evaluated by the Memory
store like
SELECT ?s WHERE { VALUES ?s { <http://example.com/foo> } FILTER(BOUND(?s)) }
and by the SPARQLStore
like:
SELECT ?s WHERE { FILTER(BOUND(?s)) } VALUES ?s { <http://example.com/foo> }
This leads the Memory
store to return one solution with the assignation ?s -> <http://example.com/foo>
and the SPARQLStore
to return no solution.
It would be great to harmonize the behavior. I encountered this issue while working on oxrdflib
that currently follows the SPARQLStore
behavior, breaking some usages relying on the Memory
store behavior.