Class CheckStatementPattern
java.lang.Object
org.eclipse.rdf4j.federated.algebra.CheckStatementPattern
- All Implemented Interfaces:
Serializable
,Cloneable
,BoundJoinTupleExpr
,FedXTupleExpr
,QueryRef
,StatementTupleExpr
,VariableExpr
,QueryModelNode
,TupleExpr
A statement pattern with no free variables when provided with some particular BindingSet in evaluate. For evaluation
a boolean ASK query is performed.
Wraps a StatementTupleExpr
- Author:
- Andreas Schwarte
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns a (deep) clone of this query model node.evaluate
(BindingSet bindings) Evaluate this expression using the provided bindingsGets the names of the bindings that are guaranteed to be present in the results produced by this tuple expression.Gets the names of the bindings that are, or can be, returned by this tuple expression when it is evaluated.double
int
getId()
Gets the node's parent.Retrieve the attached query information of the tuple expressionlong
double
Returns the number of tuples that this QueryNode predicts will be outputted.Returns the signature of this query model node.long
boolean
hasFreeVarsFor
(BindingSet binding) returns true iff this statement has free variables in the presence of the specified binding setvoid
replaceChildNode
(QueryModelNode current, QueryModelNode replacement) Replaces one of the child nodes with a new node.void
replaceWith
(QueryModelNode replacement) Substitutes this node with a new node in the query model tree.void
setCostEstimate
(double costEstimate) void
setParentNode
(QueryModelNode parent) Sets the node's parent.void
setResultSizeActual
(long resultSizeActual) void
setResultSizeEstimate
(double resultSizeEstimate) void
setTotalTimeNanosActual
(long totalTimeNanosActual) <X extends Exception>
voidvisit
(QueryModelVisitor<X> visitor) Visits this node.<X extends Exception>
voidvisitChildren
(QueryModelVisitor<X> visitor) Visits the children of this node.Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.rdf4j.query.algebra.QueryModelNode
equals, toString
-
Field Details
-
stmt
-
id
-
queryInfo
-
-
Constructor Details
-
CheckStatementPattern
-
-
Method Details
-
getStatementPattern
-
getFreeVarCount
public int getFreeVarCount()- Specified by:
getFreeVarCount
in interfaceFedXTupleExpr
- Returns:
- the number of free (i.e. unbound) variables in this expression
-
getFreeVars
- Specified by:
getFreeVars
in interfaceVariableExpr
- Returns:
- a list of free (i.e. unbound) variables in this expression
-
getId
- Specified by:
getId
in interfaceStatementTupleExpr
- Returns:
- the id of this expr
-
getStatementSources
- Specified by:
getStatementSources
in interfaceStatementTupleExpr
- Returns:
- a list of sources that are relevant for evaluation of this expression
-
hasFreeVarsFor
Description copied from interface:StatementTupleExpr
returns true iff this statement has free variables in the presence of the specified binding set- Specified by:
hasFreeVarsFor
in interfaceStatementTupleExpr
- Parameters:
binding
-- Returns:
- whether the statement has free vars
-
getAssuredBindingNames
Description copied from interface:TupleExpr
Gets the names of the bindings that are guaranteed to be present in the results produced by this tuple expression.- Specified by:
getAssuredBindingNames
in interfaceTupleExpr
- Returns:
- A set of binding names.
-
getBindingNames
Description copied from interface:TupleExpr
Gets the names of the bindings that are, or can be, returned by this tuple expression when it is evaluated.- Specified by:
getBindingNames
in interfaceTupleExpr
- Returns:
- A set of binding names.
-
getParentNode
Description copied from interface:QueryModelNode
Gets the node's parent.- Specified by:
getParentNode
in interfaceQueryModelNode
- Returns:
- The parent node, if any.
-
getSignature
Description copied from interface:QueryModelNode
Returns the signature of this query model node. Signatures normally include the node's name and any parameters, but not parent or child nodes. This method is used byQueryModelNode.toString()
.- Specified by:
getSignature
in interfaceQueryModelNode
- Returns:
- The node's signature, e.g. SLICE (offset=10, limit=10).
-
replaceChildNode
Description copied from interface:QueryModelNode
Replaces one of the child nodes with a new node.- Specified by:
replaceChildNode
in interfaceQueryModelNode
- Parameters:
current
- The current child node.replacement
- The new child node.
-
replaceWith
Description copied from interface:QueryModelNode
Substitutes this node with a new node in the query model tree.- Specified by:
replaceWith
in interfaceQueryModelNode
- Parameters:
replacement
- The new node.
-
setParentNode
Description copied from interface:QueryModelNode
Sets the node's parent.- Specified by:
setParentNode
in interfaceQueryModelNode
- Parameters:
parent
- The parent node for this node.
-
visit
Description copied from interface:QueryModelNode
Visits this node. The node reports itself to the visitor with the proper runtime type.- Specified by:
visit
in interfaceQueryModelNode
- Throws:
X
-
visitChildren
Description copied from interface:QueryModelNode
Visits the children of this node. The node callsQueryModelNode.visit(QueryModelVisitor)
on all of its child nodes.- Specified by:
visitChildren
in interfaceQueryModelNode
- Throws:
X
-
clone
Description copied from interface:QueryModelNode
Returns a (deep) clone of this query model node. This method recursively clones the entire node tree, starting from this nodes. -
getResultSizeEstimate
public double getResultSizeEstimate()Description copied from interface:QueryModelNode
Returns the number of tuples that this QueryNode predicts will be outputted. For a StatementPattern this would be the estimated cardinality provided by the EvaluationStatistics. For a Join the would be the resulting number of joined tuples.- Specified by:
getResultSizeEstimate
in interfaceQueryModelNode
- Returns:
- rows
-
setResultSizeEstimate
public void setResultSizeEstimate(double resultSizeEstimate) - Specified by:
setResultSizeEstimate
in interfaceQueryModelNode
-
getResultSizeActual
public long getResultSizeActual()- Specified by:
getResultSizeActual
in interfaceQueryModelNode
-
setResultSizeActual
public void setResultSizeActual(long resultSizeActual) - Specified by:
setResultSizeActual
in interfaceQueryModelNode
-
getCostEstimate
public double getCostEstimate()- Specified by:
getCostEstimate
in interfaceQueryModelNode
-
setCostEstimate
public void setCostEstimate(double costEstimate) - Specified by:
setCostEstimate
in interfaceQueryModelNode
-
getTotalTimeNanosActual
public long getTotalTimeNanosActual()- Specified by:
getTotalTimeNanosActual
in interfaceQueryModelNode
-
setTotalTimeNanosActual
public void setTotalTimeNanosActual(long totalTimeNanosActual) - Specified by:
setTotalTimeNanosActual
in interfaceQueryModelNode
-
evaluate
public CloseableIteration<BindingSet,QueryEvaluationException> evaluate(BindingSet bindings) throws QueryEvaluationException Description copied from interface:StatementTupleExpr
Evaluate this expression using the provided bindings- Specified by:
evaluate
in interfaceStatementTupleExpr
- Parameters:
bindings
-- Returns:
- the result iteration
- Throws:
QueryEvaluationException
-
getQueryInfo
Description copied from interface:QueryRef
Retrieve the attached query information of the tuple expression- Specified by:
getQueryInfo
in interfaceQueryRef
- Returns:
- the
QueryInfo
-