Class EvaluationStatistics.CardinalityCalculator
java.lang.Object
org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor<RuntimeException>
org.eclipse.rdf4j.query.algebra.evaluation.impl.EvaluationStatistics.CardinalityCalculator
- All Implemented Interfaces:
QueryModelVisitor<RuntimeException>
- Direct Known Subclasses:
TupleFunctionEvaluationStatistics.TupleFunctionCardinalityCalculator
- Enclosing class:
- EvaluationStatistics
protected static class EvaluationStatistics.CardinalityCalculator
extends AbstractQueryModelVisitor<RuntimeException>
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected int
countConstantVars
(Iterable<Var> vars) double
protected double
getCardinality
(double varCardinality, Collection<Var> vars) protected double
getCardinality
(double varCardinality, Var var) protected double
protected double
Override this if you are able to determine the cardinality based not only on the contextVar itself but also the other vars (e.g.protected double
getContextCardinality
(Var var) protected double
Override this if you are able to determine the cardinality based not only on the objectVar itself but also the other vars (e.g.protected double
getObjectCardinality
(Var var) protected double
Override this if you are able to determine the cardinality based not only on the predicateVar itself but also the other vars (e.g.protected double
protected double
Override this if you are able to determine the cardinality based not only on the subjectVar itself but also the other vars (e.g.protected double
getSubjectCardinality
(Var var) void
meet
(ArbitraryLengthPath node) void
meet
(BindingSetAssignment node) void
void
void
void
void
void
meet
(SingletonSet node) void
meet
(StatementPattern sp) void
void
meet
(ZeroLengthPath node) protected void
Method called by all meet methods with aBinaryTupleOperator
node as argument.protected void
meetNode
(QueryModelNode node) Method called by all of the other meet methods that are not overridden in subclasses.protected void
Method called by all meet methods with aUnaryTupleOperator
node as argument.Methods inherited from class org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor
meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meet, meetBinaryValueOperator, meetCompareSubQueryValueOperator, meetNAryValueOperator, meetOther, meetSubQueryValueOperator, meetUnaryValueOperator, meetUpdateExpr
-
Field Details
-
cardinality
protected double cardinality
-
-
Constructor Details
-
CardinalityCalculator
protected CardinalityCalculator()
-
-
Method Details
-
getCardinality
public double getCardinality() -
meet
- Specified by:
meet
in interfaceQueryModelVisitor<RuntimeException>
- Overrides:
meet
in classAbstractQueryModelVisitor<RuntimeException>
-
meet
- Specified by:
meet
in interfaceQueryModelVisitor<RuntimeException>
- Overrides:
meet
in classAbstractQueryModelVisitor<RuntimeException>
-
meet
- Specified by:
meet
in interfaceQueryModelVisitor<RuntimeException>
- Overrides:
meet
in classAbstractQueryModelVisitor<RuntimeException>
-
meet
- Specified by:
meet
in interfaceQueryModelVisitor<RuntimeException>
- Overrides:
meet
in classAbstractQueryModelVisitor<RuntimeException>
-
meet
- Specified by:
meet
in interfaceQueryModelVisitor<RuntimeException>
- Overrides:
meet
in classAbstractQueryModelVisitor<RuntimeException>
-
meet
- Specified by:
meet
in interfaceQueryModelVisitor<RuntimeException>
- Overrides:
meet
in classAbstractQueryModelVisitor<RuntimeException>
-
meet
- Specified by:
meet
in interfaceQueryModelVisitor<RuntimeException>
- Overrides:
meet
in classAbstractQueryModelVisitor<RuntimeException>
-
meet
- Specified by:
meet
in interfaceQueryModelVisitor<RuntimeException>
- Overrides:
meet
in classAbstractQueryModelVisitor<RuntimeException>
-
getCardinality
-
getSubjectCardinality
Override this if you are able to determine the cardinality based not only on the subjectVar itself but also the other vars (e.g. the predicate value might determine a subject subset). -
getSubjectCardinality
-
getPredicateCardinality
Override this if you are able to determine the cardinality based not only on the predicateVar itself but also the other vars (e.g. the subject value might determine a predicate subset). -
getPredicateCardinality
-
getObjectCardinality
Override this if you are able to determine the cardinality based not only on the objectVar itself but also the other vars (e.g. the predicate value might determine an object subset). -
getObjectCardinality
-
getContextCardinality
Override this if you are able to determine the cardinality based not only on the contextVar itself but also the other vars (e.g. the subject value might determine a context subset). -
getContextCardinality
-
getCardinality
-
getCardinality
-
countConstantVars
-
meet
- Specified by:
meet
in interfaceQueryModelVisitor<RuntimeException>
- Overrides:
meet
in classAbstractQueryModelVisitor<RuntimeException>
-
meet
- Specified by:
meet
in interfaceQueryModelVisitor<RuntimeException>
- Overrides:
meet
in classAbstractQueryModelVisitor<RuntimeException>
-
meetBinaryTupleOperator
Description copied from class:AbstractQueryModelVisitor
Method called by all meet methods with aBinaryTupleOperator
node as argument. Forwards the call toAbstractQueryModelVisitor.meetNode(org.eclipse.rdf4j.query.algebra.QueryModelNode)
by default.- Overrides:
meetBinaryTupleOperator
in classAbstractQueryModelVisitor<RuntimeException>
- Parameters:
node
- The node that is being visited.
-
meetUnaryTupleOperator
Description copied from class:AbstractQueryModelVisitor
Method called by all meet methods with aUnaryTupleOperator
node as argument. Forwards the call toAbstractQueryModelVisitor.meetNode(org.eclipse.rdf4j.query.algebra.QueryModelNode)
by default.- Overrides:
meetUnaryTupleOperator
in classAbstractQueryModelVisitor<RuntimeException>
- Parameters:
node
- The node that is being visited.
-
meet
- Specified by:
meet
in interfaceQueryModelVisitor<RuntimeException>
- Overrides:
meet
in classAbstractQueryModelVisitor<RuntimeException>
-
meetNode
Description copied from class:AbstractQueryModelVisitor
Method called by all of the other meet methods that are not overridden in subclasses. This method can be overridden in subclasses to define default behaviour when visiting nodes. The default behaviour of this method is to visit the node's children.- Overrides:
meetNode
in classAbstractQueryModelVisitor<RuntimeException>
- Parameters:
node
- The node that is being visited.
-