All Classes and Interfaces
Class
Description
TODO Separate cache specific parts from query containment ones
Combines an RDF graph with meta information
Modeled after
ApplyTransformVisitor.Note: The reason why SparqlConjunctiveQuery and
QuadFilterPatternCanonical are not the same object (i.e.
Performs a top down traversal of an algebra tree and labels
nodes with which sets of variables are allowed to be distinct
DISTINCT(PROJECT ?s (UNION(A, B)))
-> A: DISTINCT ?s
-> B: DISTINCT ?s
This class captures the following generic SPARQL query set:
Select (project / extend) { // postDistinctVarDefs
select distinct (project / extend) { // preDestinctVarDefs
[subOp]
filter(...)
}
}
- if there is no distinct, there are no post-distinct definitions (indicated by null); only pre-distinct ones
- the filters are always expressed to reference pre-distinct variables
this means, that any filter must be expanded first using the post-distinct definitions
and subsequently the pre-distsinct definitions
-
initially:
as long as there is no distinct encountered:
- have all projections / expressions affect the pre-distinct definitions
When encountering distinct:
- Any new distinct makes a prior one obsolete.
This class captures the following generic SPARQL query set:
Select (project / extend) { // postDistinctVarDefs
select distinct (project / extend) { // preDestinctVarDefs
[subOp]
filter(...)
}
}
- if there is no distinct, there are no post-distinct definitions (indicated by null); only pre-distinct ones
- the filters are always expressed to reference pre-distinct variables
this means, that any filter must be expanded first using the post-distinct definitions
and subsequently the pre-distsinct definitions
-
initially:
as long as there is no distinct encountered:
- have all projections / expressions affect the pre-distinct definitions
When encountering distinct:
- Any new distinct makes a prior one obsolete.
Deduplicate triple / quad patterns;
E.g.
Base transformation that forwards every encountered
Triple and TriplePath object
to the concrete implementation.A generalization of
TransformBase class that evals everything to null.
Wrap another transform and pass on the transform operation
A generalization of the interface of
OpExecutor where the result type is not restricted to QueryIter.Base class that evals everything to null.
Holder for holding an immutable expression in different representations,
such as normal forms.
Flatten nested functions, such as f(a, f(b, c), d) -> f(a, b, c, d)
Useful for concat expressions
Substitute unary function with its argument - i.e.
Decode "blanknode URIs" - i.e.
Fixes substr(str, start, len) of virtuoso which raises an error if the
requested substring is longer than the string.
N-way disjunction.
Create a directed labeled graph representation of a SPARQL algebra expression.
An operator that references a result set by key, such as a key of a cache entry.
TODO Maybe rename to OpWithModifiers
The intent of this class is to capture a 'core' op together with specific modifiers to be
applied afterwards:
- projection, distinct and filters
Issue: In which order to apply these? distinct and filters can be swapped;
I suppose a reasonable order could be: filter, project, distinct
Further, I think a OpWithModifiers is itself an Op again, so that the distinct / project / filter can be nested.
We can directly convert BGPs and expressions to an RDF graph.
Substitution strategy for constants in SPARQL graph patterns.
Given extend(subOp, ?var: 'value') it adds an extra filter
filter(extend(subOp, { ?var: 'value'}), { ?var: 'value'})
This is used to streamline satisfiability checking.
Transform OpAssign to OpExtend.
A transformer that adds SERVICE <cache:env://REMOTE> { } blocks
Transforms
Turn a join of unions into a union of joins.
A transformer that evaluates every op whose sub ops are all
OpTable instances
to another OpTable instance.Transformer that rewrites
Transform GROUP([count(distinct *) AS ?.0], subOp)
to GROUP([count(*) AS ?.0], DISTINCT(subOp))
Used to mitigate a bug in Virtuoso
Transform expressions to property functions.
Given a table extract all variables that map to the same constant to a bind block:
Given:
VALUES (?x ?y) {
(a b1)
(a b2)
}
it becomes:
VALUES (?y) { b1 b2 )
BIND(a AS ?x)
Transform OpFilter(false, subOp) to OpTable(empty)
Join(LeftJoin(A, B), C) -> LeftJoin(Join(A, C), B) -
if all vars of C shared with B are also shared with A
Transform an expression of
LeftJoin(
LeftJoin(bl, br, be),
ar, ae)
with the expression e and ae TRUE
to
LeftJoinSet(bl, ar, br)
Further:
LeftJoinSet(X,
LeftJoin(l, r, e))
becomes:
LeftJoinSet(l, X, r)
project(project(op, varsA), varsB) -> project(op, VarsB)
Assumes that the op expression is valid, such that only the variables
of the outer most projection need to be retained.
Replace
GRAPH X { }.Note: TransformRedundantProjectionRemoval seems to be the better choice.
Pulls up Extend over joins and distinct
join(extend(?foo...), extend(?bar...)) becomes
extend(?foo...
Pull filters up so that they may be distributed over a join
Example:
Join(
Filter({_?v1_}), ?v1=_),
{ _?v1_ })
Becomes:
Filter(Join({_?v1_}, {_?v1_},?v1=_))
Allows: Subsequent filter placement:
Join(
Filter({ _?v1_}), ?v1=_),
Filter({ _?v1_ }, ?v1=_)
TransformMergeBGPS only works if the operands of a join are BGPS.
Given filter expressions of form ?x = , where ?x is an undistinguished (mandatory) variable
(i.e.
Transformation that pushes slices further down and into service clauses.
Remove filters in patterns such as
OpFilter(OpExtend(constant AS ?x, (subOp)), ?x = constant)
Currently this works only if the OpExtend is an immediate child of OpFilter
Mainly needed as a workaround for Virtuoso...
Notes on path resolutions:
- Aliased paths do not appear to make sense here:
- One might think that aliases could be used to resolve properties in templates of
partitioned queries such as ?s rdfs:label ?v1, ?v2.