rdflib
rdflib copied to clipboard
SPARQLStore won't work with preparedQuery
When using a graph with SPARQLStore, Graph.query
will call Store.query
:
https://github.com/RDFLib/rdflib/blob/0856ac8842697fb00199d2beb9ae1ee5b9152c68/rdflib/graph.py#L1381-L1391
And this will then proceed to assert that the query is a str
:
https://github.com/RDFLib/rdflib/blob/0856ac8842697fb00199d2beb9ae1ee5b9152c68/rdflib/plugins/stores/sparqlstore.py#L183-L192
And even without this assert, things won't work unless it is a str
.
This is not an ideal situation, a better situation would be one of:
- Either don't support query objects, and only strings
- Obtain a string for the query object in
SPARQLStore
- Have a different methods for working with prepared query
Either way, the interface of Store ideally should have a good match with all the implementations of it that comes with RDFLib.