-
Notifications
You must be signed in to change notification settings - Fork 579
Description
The query and update methods of the Store abstract class allows to overide rdflib default SPARQL evaluator.
They both provide a queryGraph parameter to provide the default graph identifier.
However this parameter is not helpful enough to allow a proper implementation of SPARQL evaluation if the Store is used inside of a ConjunctiveGraph (for update) or a Dataset (both query and update).
Problems:
-
With
queryandDataset.
Dataset(store="MyCustomStore").update("INSERT DATA {}")will call the underlyingMyCustomStorewith the parameterqueryGraph=BNode("abcde")withBNode("abcde")the datasetidentifierinstead ofqueryGraph=URI("urn:x-rdflib:default")that identifies the default graph and is used by the basic triple insertion and deletion method. With this parameter theStorequery evaluator will query the_:abcdegraph even if the triples are by default added in the default graph identified by<urn:x-rdflib:default>. -
With
updateandConjunctiveGraph.
ConjunctiveGraph(store="MyCustomStore").update("INSERT DATA {}")will call the underlyingMyCustomStorewith the parameterqueryGraph="__UNION__". With only this information the underlying store does not know what is the identifier of theConjunctiveDatasetdefault graph in which the triples should be added if the update contains anINSERTor aLOADaction. -
With
updateandDataset.
Similarly to thequerymethod thequeryGraphparameter is set to the Datasetidentifierand notURI("urn:x-rdflib:default")so the update is evaluated against the_:abcdegraph even if triples are by default added to the default graph (<urn:x-rdflib:default>) by theaddmethod.
A possible solution might be to:
- Set
queryGraphtoURI("urn:x-rdflib:default")forDatasetqueryandupdate. - Add a new parameter
updateGraphto theupdatemethod. It would keep the same value asqueryGraphif the update is called from aGraphor aDatasetand to theConjunctiveGraphidentifierif the update is called from aConjunctiveGraph.