Description
[Issue first reported in #8]
RDFLib default 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 Oxigraph (and RDFlib SPARQLStore
see RDFLib/rdflib#1772) 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 RDFLib like
SELECT ?s WHERE { VALUES ?s { <http://example.com/foo> } FILTER(BOUND(?s)) }
and by the Oxigraph like:
SELECT ?s WHERE { FILTER(BOUND(?s)) } VALUES ?s { <http://example.com/foo> }
This leads RDFLib store to return one solution with the assignation ?s -> <http://example.com/foo>
and Oxigraph to return no solution.
It would be great to harmonize the behavior. However, doing it it cleanly inside of oxrdflib would require to partially parse the query and add a significant overhead in both code and speed. An other option would be to add a similar parameter inside of pyoxigraph but it would allow other pyoxigraph users to use it and I am not a huge fan of helping people using this kind of hacky injection. So, keeping the current behivor that is the same as the SPARQLStore
seems to me a sensible way to go.