View unfolding and query optimisation for SPARQL 1.2.
Rewrites a SPARQL 1.2 query posed over views into an equivalent query over the data those views are
defined on.
A mapping is one or more SPARQL CONSTRUCT queries defining a view: the template (head) says which
triples the view holds, the WHERE clause (body) how they are found in the data. A pipeline of
transformations is then run over the user query, the first of which unfolds that mapping into every
triple pattern and the rest of which optimise what comes out.
Running SPARQL 1.2 queries - triple terms and all - against RDF 1.1 data is the case this was built for:
a view then says how RDF 1.1 data represents RDF 1.2, and the rewrite hands back plain SPARQL 1.1.
This entry point is platform-neutral, and is kept that way deliberately: the one transformation
needing a Comunica runtime is reached through the sparql-view-unfold/comunica subpath instead, because
re-exporting it here would put node:module and node:path in every consumer's module graph. See
the Comunica entry point for why a bundler cannot shake that back out.
Fileoverview
View unfolding and query optimisation for SPARQL 1.2.
Rewrites a SPARQL 1.2 query posed over views into an equivalent query over the data those views are defined on.
A mapping is one or more SPARQL CONSTRUCT queries defining a view: the template (head) says which triples the view holds, the WHERE clause (body) how they are found in the data. A pipeline of transformations is then run over the user query, the first of which unfolds that mapping into every triple pattern and the rest of which optimise what comes out.
Running SPARQL 1.2 queries - triple terms and all - against RDF 1.1 data is the case this was built for: a view then says how RDF 1.1 data represents RDF 1.2, and the rewrite hands back plain SPARQL 1.1.
This entry point is platform-neutral, and is kept that way deliberately: the one transformation needing a Comunica runtime is reached through the
sparql-view-unfold/comunicasubpath instead, because re-exporting it here would putnode:moduleandnode:pathin every consumer's module graph. See the Comunica entry point for why a bundler cannot shake that back out.See
https://w3c.github.io/rdf-interop/spec/ RDF 1.2 Interoperability Spec
Example