Open apicouSP opened 1 month ago
I now use Dataset instead of ConjunctiveGraph as this one is now deprecated. I also fixed style and type errors in new tests. Now black, ruff and mypy should pass. Let me know if you need something to merge this! Sorry I made too much commits.
Summary of changes
WHAT
FROM
orFROM NAMED
clause: redefine entirely the query's RDF datasetWhen a query (
SELECT
,CONSTRUCT
,ASK
,DESCRIBE
) is using aFROM
orFROM NAMED
clause, we redefine entirely the query's RDF dataset Include only the graphs inFROM
clauses in the query's default graph Include only the graphs in theFROM NAMED
clauses in the query's named graphsAs a consequence, when a user defines a
FROM
clause in his query but does not defineFROM NAMED
, then the named graphs are considered empty set. And vice versa: if a user defines aFROM NAMED
clause but does not define aFROM
clause, then the default graph is considered empty. I added tests specifically for that That's my interpretation of thisAlso since the RDF Dataset is entirely redefined when using
FROM
orFROM NAMED
clauses then for those queries the parameterSPARQL_DEFAULT_GRAPH_UNION
will be ignoredLoad external graphs only if they don't already exist
Try to load external graphs only if they don't already exist in the given
ConjunctiveGraph
As a consequence, you don't have to set
SPARQL_DEFAULT_GRAPH_UNION
toFalse
if all the graphs mentioned inFROM
andFROM NAMED
clauses already exist in the givenConjunctiveGraph
WHAT it is not
DELETE
andINSERT
). Since code is independent, I will probably make another PR for thatWHY:
So queries behave closer to W3C spec
Issues:
This PR fixes this issue (confirmed) And also that issue as far as I understand This also solves partially this discussion
Checklist