Class CheckStatementPattern
- java.lang.Object
-
- org.eclipse.rdf4j.federated.algebra.CheckStatementPattern
-
- All Implemented Interfaces:
Serializable,Cloneable,BoundJoinTupleExpr,FedXTupleExpr,QueryRef,StatementTupleExpr,VariableExpr,QueryModelNode,TupleExpr
public class CheckStatementPattern extends Object implements StatementTupleExpr, BoundJoinTupleExpr
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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CheckStatementPattern(StatementTupleExpr stmt, QueryInfo queryInfo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CheckStatementPatternclone()Returns a (deep) clone of this query model node.CloseableIteration<BindingSet>evaluate(BindingSet bindings)Evaluate this expression using the provided bindingsSet<String>getAssuredBindingNames()Gets the names of the bindings that are guaranteed to be present in the results produced by this tuple expression.Set<String>getBindingNames()Gets the names of the bindings that are, or can be, returned by this tuple expression when it is evaluated.doublegetCostEstimate()intgetFreeVarCount()List<String>getFreeVars()StringgetId()QueryModelNodegetParentNode()Gets the node's parent.QueryInfogetQueryInfo()Retrieve the attached query information of the tuple expressionlonggetResultSizeActual()doublegetResultSizeEstimate()Returns the number of tuples that this QueryNode predicts will be outputted.StringgetSignature()Returns the signature of this query model node.StatementPatterngetStatementPattern()List<StatementSource>getStatementSources()longgetTotalTimeNanosActual()booleanhasFreeVarsFor(BindingSet binding)returns true iff this statement has free variables in the presence of the specified binding setvoidreplaceChildNode(QueryModelNode current, QueryModelNode replacement)Replaces one of the child nodes with a new node.voidreplaceWith(QueryModelNode replacement)Substitutes this node with a new node in the query model tree.voidsetCostEstimate(double costEstimate)voidsetParentNode(QueryModelNode parent)Sets the node's parent.voidsetResultSizeActual(long resultSizeActual)voidsetResultSizeEstimate(double resultSizeEstimate)voidsetTotalTimeNanosActual(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 Detail
-
stmt
protected final StatementTupleExpr stmt
-
id
protected final String id
-
queryInfo
protected final QueryInfo queryInfo
-
-
Constructor Detail
-
CheckStatementPattern
public CheckStatementPattern(StatementTupleExpr stmt, QueryInfo queryInfo)
-
-
Method Detail
-
getStatementPattern
public StatementPattern getStatementPattern()
-
getFreeVarCount
public int getFreeVarCount()
- Specified by:
getFreeVarCountin interfaceFedXTupleExpr- Returns:
- the number of free (i.e. unbound) variables in this expression
-
getFreeVars
public List<String> getFreeVars()
- Specified by:
getFreeVarsin interfaceVariableExpr- Returns:
- a list of free (i.e. unbound) variables in this expression
-
getId
public String getId()
- Specified by:
getIdin interfaceStatementTupleExpr- Returns:
- the id of this expr
-
getStatementSources
public List<StatementSource> getStatementSources()
- Specified by:
getStatementSourcesin interfaceStatementTupleExpr- Returns:
- a list of sources that are relevant for evaluation of this expression
-
hasFreeVarsFor
public boolean hasFreeVarsFor(BindingSet binding)
Description copied from interface:StatementTupleExprreturns true iff this statement has free variables in the presence of the specified binding set- Specified by:
hasFreeVarsForin interfaceStatementTupleExpr- Returns:
- whether the statement has free vars
-
getAssuredBindingNames
public Set<String> getAssuredBindingNames()
Description copied from interface:TupleExprGets the names of the bindings that are guaranteed to be present in the results produced by this tuple expression.- Specified by:
getAssuredBindingNamesin interfaceTupleExpr- Returns:
- A set of binding names.
-
getBindingNames
public Set<String> getBindingNames()
Description copied from interface:TupleExprGets the names of the bindings that are, or can be, returned by this tuple expression when it is evaluated.- Specified by:
getBindingNamesin interfaceTupleExpr- Returns:
- A set of binding names.
-
getParentNode
public QueryModelNode getParentNode()
Description copied from interface:QueryModelNodeGets the node's parent.- Specified by:
getParentNodein interfaceQueryModelNode- Returns:
- The parent node, if any.
-
getSignature
public String getSignature()
Description copied from interface:QueryModelNodeReturns 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:
getSignaturein interfaceQueryModelNode- Returns:
- The node's signature, e.g. SLICE (offset=10, limit=10).
-
replaceChildNode
public void replaceChildNode(QueryModelNode current, QueryModelNode replacement)
Description copied from interface:QueryModelNodeReplaces one of the child nodes with a new node.- Specified by:
replaceChildNodein interfaceQueryModelNode- Parameters:
current- The current child node.replacement- The new child node.
-
replaceWith
public void replaceWith(QueryModelNode replacement)
Description copied from interface:QueryModelNodeSubstitutes this node with a new node in the query model tree.- Specified by:
replaceWithin interfaceQueryModelNode- Parameters:
replacement- The new node.
-
setParentNode
public void setParentNode(QueryModelNode parent)
Description copied from interface:QueryModelNodeSets the node's parent.- Specified by:
setParentNodein interfaceQueryModelNode- Parameters:
parent- The parent node for this node.
-
visit
public <X extends Exception> void visit(QueryModelVisitor<X> visitor) throws X extends Exception
Description copied from interface:QueryModelNodeVisits this node. The node reports itself to the visitor with the proper runtime type.- Specified by:
visitin interfaceQueryModelNode- Throws:
X extends Exception
-
visitChildren
public <X extends Exception> void visitChildren(QueryModelVisitor<X> visitor) throws X extends Exception
Description copied from interface:QueryModelNodeVisits the children of this node. The node callsQueryModelNode.visit(QueryModelVisitor)on all of its child nodes.- Specified by:
visitChildrenin interfaceQueryModelNode- Throws:
X extends Exception
-
clone
public CheckStatementPattern clone()
Description copied from interface:QueryModelNodeReturns 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:QueryModelNodeReturns 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:
getResultSizeEstimatein interfaceQueryModelNode- Returns:
- rows
-
setResultSizeEstimate
public void setResultSizeEstimate(double resultSizeEstimate)
- Specified by:
setResultSizeEstimatein interfaceQueryModelNode
-
getResultSizeActual
public long getResultSizeActual()
- Specified by:
getResultSizeActualin interfaceQueryModelNode
-
setResultSizeActual
public void setResultSizeActual(long resultSizeActual)
- Specified by:
setResultSizeActualin interfaceQueryModelNode
-
getCostEstimate
public double getCostEstimate()
- Specified by:
getCostEstimatein interfaceQueryModelNode
-
setCostEstimate
public void setCostEstimate(double costEstimate)
- Specified by:
setCostEstimatein interfaceQueryModelNode
-
getTotalTimeNanosActual
public long getTotalTimeNanosActual()
- Specified by:
getTotalTimeNanosActualin interfaceQueryModelNode
-
setTotalTimeNanosActual
public void setTotalTimeNanosActual(long totalTimeNanosActual)
- Specified by:
setTotalTimeNanosActualin interfaceQueryModelNode
-
evaluate
public CloseableIteration<BindingSet> evaluate(BindingSet bindings) throws QueryEvaluationException
Description copied from interface:StatementTupleExprEvaluate this expression using the provided bindings- Specified by:
evaluatein interfaceStatementTupleExpr- Returns:
- the result iteration
- Throws:
QueryEvaluationException
-
getQueryInfo
public QueryInfo getQueryInfo()
Description copied from interface:QueryRefRetrieve the attached query information of the tuple expression- Specified by:
getQueryInfoin interfaceQueryRef- Returns:
- the
QueryInfo
-
-