Class FedXStatementPattern
java.lang.Object
org.eclipse.rdf4j.query.algebra.AbstractQueryModelNode
org.eclipse.rdf4j.query.algebra.StatementPattern
org.eclipse.rdf4j.federated.algebra.FedXStatementPattern
- All Implemented Interfaces:
Serializable
,Cloneable
,BoundJoinTupleExpr
,FedXTupleExpr
,FilterTuple
,QueryRef
,StatementTupleExpr
,VariableExpr
,GraphPatternGroupable
,QueryModelNode
,TupleExpr
,VariableScopeChange
- Direct Known Subclasses:
ExclusiveStatement
,StatementSourcePattern
public abstract class FedXStatementPattern
extends StatementPattern
implements StatementTupleExpr, FilterTuple, BoundJoinTupleExpr
Base class providing all common functionality for FedX StatementPatterns
- Author:
- Andreas Schwarte
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.rdf4j.query.algebra.StatementPattern
StatementPattern.Scope
-
Field Summary
Modifier and TypeFieldDescriptionprotected QueryBindingSet
protected FilterValueExpr
protected final String
protected final QueryInfo
protected final List<StatementSource>
protected long
Fields inherited from class org.eclipse.rdf4j.query.algebra.StatementPattern
CARDINALITY_NOT_SET
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addBoundFilter
(String varName, Value value) register a filter that can be directly expressed as a binding, e.g.void
addFilterExpr
(FilterExpr expr) register a new filter expression.Returns bound filter bindings, that need to be added as additional bindings to the final resultint
getId()
Retrieve the attached query information of the tuple expressionint
long
boolean
boolean
hasFreeVarsFor
(BindingSet bindings) returns true iff this statement has free variables in the presence of the specified binding setprotected void
void
setUpperLimit
(long upperLimit) Set the upper limit for this statement expression (i.e.<X extends Exception>
voidvisit
(QueryModelVisitor<X> visitor) Visits this node.<X extends Exception>
voidvisitChildren
(QueryModelVisitor<X> visitor) Dummy implementation ofQueryModelNode.visitChildren(org.eclipse.rdf4j.query.algebra.QueryModelVisitor<X>)
that does nothing.Methods inherited from class org.eclipse.rdf4j.query.algebra.StatementPattern
clone, equals, getAssuredBindingNames, getBindingNames, getCardinality, getContextVar, getObjectVar, getPredicateVar, getScope, getSignature, getSubjectVar, getVarList, getVars, hashCode, isCardinalitySet, replaceChildNode, setCardinality, setContextVar, setObjectVar, setPredicateVar, setScope, setSubjectVar
Methods inherited from class org.eclipse.rdf4j.query.algebra.AbstractQueryModelNode
getCostEstimate, getParentNode, getResultSizeActual, getResultSizeEstimate, getTotalTimeNanosActual, isGraphPatternGroup, isVariableScopeChange, nullEquals, replaceNodeInList, replaceWith, setCostEstimate, setGraphPatternGroup, setParentNode, setResultSizeActual, setResultSizeEstimate, setTotalTimeNanosActual, setVariableScopeChange, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.rdf4j.query.algebra.QueryModelNode
equals, getCostEstimate, getParentNode, getResultSizeActual, getResultSizeEstimate, getSignature, getTotalTimeNanosActual, replaceChildNode, replaceWith, setCostEstimate, setParentNode, setResultSizeActual, setResultSizeEstimate, setTotalTimeNanosActual, toString
Methods inherited from interface org.eclipse.rdf4j.federated.algebra.StatementTupleExpr
evaluate
Methods inherited from interface org.eclipse.rdf4j.query.algebra.TupleExpr
clone, getAssuredBindingNames, getBindingNames
-
Field Details
-
statementSources
-
id
-
queryInfo
-
freeVars
-
filterExpr
-
boundFilters
-
upperLimit
protected long upperLimit
-
-
Constructor Details
-
FedXStatementPattern
-
-
Method Details
-
visitChildren
Description copied from class:AbstractQueryModelNode
Dummy implementation ofQueryModelNode.visitChildren(org.eclipse.rdf4j.query.algebra.QueryModelVisitor<X>)
that does nothing. Subclasses should override this method when they have child nodes.- Specified by:
visitChildren
in interfaceQueryModelNode
- Overrides:
visitChildren
in classStatementPattern
- Throws:
X extends Exception
-
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
- Overrides:
visit
in classStatementPattern
- Throws:
X extends Exception
-
initFreeVars
protected void initFreeVars() -
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 interfaceFilterTuple
- Specified by:
getFreeVars
in interfaceVariableExpr
- Returns:
- a list of free (i.e. unbound) variables in this expression
-
getQueryInfo
Description copied from interface:QueryRef
Retrieve the attached query information of the tuple expression- Specified by:
getQueryInfo
in interfaceQueryRef
- Returns:
- the
QueryInfo
-
getId
- Specified by:
getId
in interfaceStatementTupleExpr
- Returns:
- the id of this expr
-
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
- Returns:
- whether the statement has free vars
-
getStatementSources
- Specified by:
getStatementSources
in interfaceStatementTupleExpr
- Returns:
- a list of sources that are relevant for evaluation of this expression
-
getSourceCount
public int getSourceCount() -
getFilterExpr
- Specified by:
getFilterExpr
in interfaceFilterTuple
- Returns:
- the currently registered filter expressions, usually of type
FilterExpr
orConjunctiveFilterExpr
-
getBoundFilters
Description copied from interface:FilterTuple
Returns bound filter bindings, that need to be added as additional bindings to the final result- Specified by:
getBoundFilters
in interfaceFilterTuple
- Returns:
- the bound filters, or
null
-
hasFilter
public boolean hasFilter()- Specified by:
hasFilter
in interfaceFilterTuple
- Returns:
- true if this expression has a filter to apply
-
addFilterExpr
Description copied from interface:FilterTuple
register a new filter expression. If the expr has already a filter registered, the new expression is added to aConjunctiveFilterExpr
.- Specified by:
addFilterExpr
in interfaceFilterTuple
-
addBoundFilter
Description copied from interface:FilterTuple
register a filter that can be directly expressed as a binding, e.g. SELECT * WHERE { ?s p o . FILTER (?s = X) } is equivalent to SELECT * WHERE { X p o . }- Specified by:
addBoundFilter
in interfaceFilterTuple
-
setUpperLimit
public void setUpperLimit(long upperLimit) Set the upper limit for this statement expression (i.e. applied in the evaluation to individual subqueries of this expr)- Parameters:
upperLimit
- the upper limit, a negative number means unlimited
-
getUpperLimit
public long getUpperLimit()- Returns:
- the upper limit or a negative number (meaning no LIMIT)
-