com.hp.hpl.jena.sparql.algebra.optimize
Class TransformFilterInequality
java.lang.Object
com.hp.hpl.jena.sparql.algebra.TransformCopy
com.hp.hpl.jena.sparql.algebra.optimize.TransformFilterInequality
- All Implemented Interfaces:
- Transform
public class TransformFilterInequality
- extends TransformCopy
A transform that aims to optimize queries where there is an inequality
constraint on a variable in an attempt to speed up evaluation e.g
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT *
WHERE
{
?s rdf:type <http://type> ;
?p ?o .
FILTER(?p != rdf:type)
}
Would transform to the following:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT *
WHERE
{
?s rdf:type <http://type> ;
?p ?o .
MINUS { VALUES ?p { rdf:type } }
}
Status
Performance testing has shown that often this gives minimal performance
benefit so this optimization is not enabled by default. It may be explicitly
enabled by setting the ARQ.optFilterInequality symbol in your
Context or the ARQ global context (ARQ.getContext() to
true
Applicability
This optimizer is conservative in that it only makes the optimization where
the inequality constraint is against a non-literal as otherwise substituting
the value changes the query semantics because it switches from value equality
to the more restrictive term equality. The optimization is safe for
non-literals because for those value and term equality are equivalent (in
fact value equality is defined to be term equality).
There are also various nested algebra structures that can make the
optimization unsafe and so it does not take place if any of those situations
is detected.
| Methods inherited from class com.hp.hpl.jena.sparql.algebra.TransformCopy |
transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform |
TransformFilterInequality
public TransformFilterInequality()
- Creates a new transform
transform
public Op transform(OpFilter opFilter,
Op subOp)
- Specified by:
transform in interface Transform- Overrides:
transform in class TransformCopy
Licenced under the Apache License, Version 2.0