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:
StatementSourcePattern,ExclusiveStatement, Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.rdf4j.query.algebra.StatementPattern
StatementPattern.Scope
-
-
Field Summary
Fields Modifier and Type Field Description protected QueryBindingSetboundFiltersprotected FilterValueExprfilterExprprotected List<String>freeVarsprotected Stringidprotected QueryInfoqueryInfoprotected List<StatementSource>statementSourcesprotected longupperLimit-
Fields inherited from class org.eclipse.rdf4j.query.algebra.StatementPattern
CARDINALITY_NOT_SET
-
-
Constructor Summary
Constructors Constructor Description FedXStatementPattern(StatementPattern node, QueryInfo queryInfo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBoundFilter(String varName, Value value)register a filter that can be directly expressed as a binding, e.g.voidaddFilterExpr(FilterExpr expr)register a new filter expression.BindingSetgetBoundFilters()Returns bound filter bindings, that need to be added as additional bindings to the final resultFilterValueExprgetFilterExpr()intgetFreeVarCount()List<String>getFreeVars()StringgetId()QueryInfogetQueryInfo()Retrieve the attached query information of the tuple expressionintgetSourceCount()List<StatementSource>getStatementSources()longgetUpperLimit()booleanhasFilter()booleanhasFreeVarsFor(BindingSet bindings)returns true iff this statement has free variables in the presence of the specified binding setprotected voidinitFreeVars()voidsetUpperLimit(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, getContextVar, getObjectVar, getPredicateVar, getScope, getSignature, getSubjectVar, getVarList, getVars, hashCode, replaceChildNode, setContextVar, setObjectVar, setPredicateVar, setScope, setSubjectVar, shouldCacheCardinality
-
Methods inherited from class org.eclipse.rdf4j.query.algebra.AbstractQueryModelNode
getCardinality, getCostEstimate, getParentNode, getResultSizeActual, getResultSizeEstimate, getTotalTimeNanosActual, isCardinalitySet, isGraphPatternGroup, isVariableScopeChange, nullEquals, replaceNodeInList, replaceWith, resetCardinality, setCardinality, 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 Detail
-
statementSources
protected final List<StatementSource> statementSources
-
id
protected final String id
-
queryInfo
protected final QueryInfo queryInfo
-
filterExpr
protected FilterValueExpr filterExpr
-
boundFilters
protected QueryBindingSet boundFilters
-
upperLimit
protected long upperLimit
-
-
Constructor Detail
-
FedXStatementPattern
public FedXStatementPattern(StatementPattern node, QueryInfo queryInfo)
-
-
Method Detail
-
visitChildren
public <X extends Exception> void visitChildren(QueryModelVisitor<X> visitor) throws X extends Exception
Description copied from class:AbstractQueryModelNodeDummy 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:
visitChildrenin interfaceQueryModelNode- Overrides:
visitChildrenin classStatementPattern- Throws:
X extends Exception
-
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- Overrides:
visitin classStatementPattern- Throws:
X extends Exception
-
initFreeVars
protected void initFreeVars()
-
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 interfaceFilterTuple- Specified by:
getFreeVarsin interfaceVariableExpr- Returns:
- a list of free (i.e. unbound) variables in this expression
-
getQueryInfo
public QueryInfo getQueryInfo()
Description copied from interface:QueryRefRetrieve the attached query information of the tuple expression- Specified by:
getQueryInfoin interfaceQueryRef- Returns:
- the
QueryInfo
-
getId
public String getId()
- Specified by:
getIdin interfaceStatementTupleExpr- Returns:
- the id of this expr
-
hasFreeVarsFor
public boolean hasFreeVarsFor(BindingSet bindings)
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
-
getStatementSources
public List<StatementSource> getStatementSources()
- Specified by:
getStatementSourcesin interfaceStatementTupleExpr- Returns:
- a list of sources that are relevant for evaluation of this expression
-
getSourceCount
public int getSourceCount()
-
getFilterExpr
public FilterValueExpr getFilterExpr()
- Specified by:
getFilterExprin interfaceFilterTuple- Returns:
- the currently registered filter expressions, usually of type
FilterExprorConjunctiveFilterExpr
-
getBoundFilters
public BindingSet getBoundFilters()
Description copied from interface:FilterTupleReturns bound filter bindings, that need to be added as additional bindings to the final result- Specified by:
getBoundFiltersin interfaceFilterTuple- Returns:
- the bound filters, or
null
-
hasFilter
public boolean hasFilter()
- Specified by:
hasFilterin interfaceFilterTuple- Returns:
- true if this expression has a filter to apply
-
addFilterExpr
public void addFilterExpr(FilterExpr expr)
Description copied from interface:FilterTupleregister a new filter expression. If the expr has already a filter registered, the new expression is added to aConjunctiveFilterExpr.- Specified by:
addFilterExprin interfaceFilterTuple
-
addBoundFilter
public void addBoundFilter(String varName, Value value)
Description copied from interface:FilterTupleregister 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:
addBoundFilterin 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)
-
-