Store
query
and update
methods queryGraph
parameter does not support ConjunctiveGraph
and Dataset
#1396
Labels
concept: RDF dataset
Relates to the RDF datasets concept.
core
Relates to core functionality of RDFLib, i.e. `rdflib.{graph,store,term}`
id-as-cntxt
tracking related issues
The
query
andupdate
methods of theStore
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
(forupdate
) or aDataset
(bothquery
andupdate
).Problems:
With
query
andDataset
.Dataset(store="MyCustomStore").update("INSERT DATA {}")
will call the underlyingMyCustomStore
with the parameterqueryGraph=BNode("abcde")
withBNode("abcde")
the datasetidentifier
instead 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 theStore
query evaluator will query the_:abcde
graph even if the triples are by default added in the default graph identified by<urn:x-rdflib:default>
.With
update
andConjunctiveGraph
.ConjunctiveGraph(store="MyCustomStore").update("INSERT DATA {}")
will call the underlyingMyCustomStore
with the parameterqueryGraph="__UNION__"
. With only this information the underlying store does not know what is the identifier of theConjunctiveDataset
default graph in which the triples should be added if the update contains anINSERT
or aLOAD
action.With
update
andDataset
.Similarly to the
query
method thequeryGraph
parameter is set to the Datasetidentifier
and notURI("urn:x-rdflib:default")
so the update is evaluated against the_:abcde
graph even if triples are by default added to the default graph (<urn:x-rdflib:default>
) by theadd
method.A possible solution might be to:
queryGraph
toURI("urn:x-rdflib:default")
forDataset
query
andupdate
.updateGraph
to theupdate
method. It would keep the same value asqueryGraph
if the update is called from aGraph
or aDataset
and to theConjunctiveGraph
identifier
if the update is called from aConjunctiveGraph
.The text was updated successfully, but these errors were encountered: