java.lang.Object
com.hp.hpl.jena.graph.query.Stage
com.hp.hpl.jena.graph.query.ConstraintStage
- public class ConstraintStage
- extends Stage
A ConstraintStage implements the constraint evaluation part of a
query. Any constraints not handled by previous PatternStages are prepared
against the mapping and valuated against each binding that comes down
the pipe; only bindings that evaluate to true are passed onward.
|
Field Summary |
protected ValuatorSet |
prepared
The set of prepared Valuators representing the constraint. |
|
Constructor Summary |
ConstraintStage(Mapping map,
ExpressionSet constraint)
Initialise this ConstraintStage with the mapping [from names to indexes] and
ExpressionSet [the constraint expressions] that will be evaluated when the
constraint stage runs. |
|
Method Summary |
Pipe |
deliver(Pipe L)
the delivery component: read the domain elements out of the
input pipe, and only pass on those that satisfy the predicate. |
private boolean |
evalConstraint(Domain d,
ValuatorSet e)
Evaluate the prepared constraints with the values given by the domain. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
prepared
protected ValuatorSet prepared
- The set of prepared Valuators representing the constraint.
ConstraintStage
public ConstraintStage(Mapping map,
ExpressionSet constraint)
- Initialise this ConstraintStage with the mapping [from names to indexes] and
ExpressionSet [the constraint expressions] that will be evaluated when the
constraint stage runs.
evalConstraint
private boolean evalConstraint(Domain d,
ValuatorSet e)
- Evaluate the prepared constraints with the values given by the domain.
Answer true if the constraint evaluates to true, and false if it evaluates to
false or throws an exception.
deliver
public Pipe deliver(Pipe L)
- the delivery component: read the domain elements out of the
input pipe, and only pass on those that satisfy the predicate.
- Specified by:
deliver in class Stage