In a dataset named graphs are often used to represent different aspects of resources, see the Graph Per Aspect design pattern. If we want to query a certain 'slice' of the dataset (specifically for patterns and property paths that cross graph boundaries), the FROM and FROM NAMED clauses can be used to enumerate the IRIs of the graphs over which the query will operate, but this can prove impractical for datasets containing hundreds of thousands of named graphs.
Currently this involves running first query to identify the graph IRIs of interest, and using those results to either:
Construct the FROM and FROM NAMED clauses in a second query, or
Construct the request with appropriate default-graph-uri and named-graph-uri query (string) parameters per SPARQL 1.1 Protocol
Previous work
Unknown
Proposed solution
Extend the grammar for FROM and FROM NAMED to allow SubSelect:
Why?
In a dataset named graphs are often used to represent different aspects of resources, see the Graph Per Aspect design pattern. If we want to query a certain 'slice' of the dataset (specifically for patterns and property paths that cross graph boundaries), the
FROM
andFROM NAMED
clauses can be used to enumerate the IRIs of the graphs over which the query will operate, but this can prove impractical for datasets containing hundreds of thousands of named graphs.Currently this involves running first query to identify the graph IRIs of interest, and using those results to either:
FROM
andFROM NAMED
clauses in a second query, ordefault-graph-uri
andnamed-graph-uri
query (string) parameters per SPARQL 1.1 ProtocolPrevious work
Unknown
Proposed solution
Extend the grammar for
FROM
andFROM NAMED
to allowSubSelect
:Whereby the subselect should project a single variable whose values are used as the graph IRIs.
For example:
Considerations for backward compatibility
Extension of the specification, so none foreseen.