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 QueryBindingSet
boundFilters
protected FilterValueExpr
filterExpr
protected List<String>
freeVars
protected String
id
protected QueryInfo
queryInfo
protected List<StatementSource>
statementSources
protected long
upperLimit
-
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 void
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.BindingSet
getBoundFilters()
Returns bound filter bindings, that need to be added as additional bindings to the final resultFilterValueExpr
getFilterExpr()
int
getFreeVarCount()
List<String>
getFreeVars()
String
getId()
QueryInfo
getQueryInfo()
Retrieve the attached query information of the tuple expressionint
getSourceCount()
List<StatementSource>
getStatementSources()
long
getUpperLimit()
boolean
hasFilter()
boolean
hasFreeVarsFor(BindingSet bindings)
returns true iff this statement has free variables in the presence of the specified binding setprotected void
initFreeVars()
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, 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: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
public <X extends Exception> void visit(QueryModelVisitor<X> visitor) throws X extends Exception
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
public List<String> getFreeVars()
- Specified by:
getFreeVars
in interfaceFilterTuple
- Specified by:
getFreeVars
in interfaceVariableExpr
- Returns:
- a list of free (i.e. unbound) variables in this expression
-
getQueryInfo
public QueryInfo getQueryInfo()
Description copied from interface:QueryRef
Retrieve the attached query information of the tuple expression- Specified by:
getQueryInfo
in interfaceQueryRef
- Returns:
- the
QueryInfo
-
getId
public String getId()
- Specified by:
getId
in interfaceStatementTupleExpr
- Returns:
- the id of this expr
-
hasFreeVarsFor
public boolean hasFreeVarsFor(BindingSet bindings)
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
public List<StatementSource> getStatementSources()
- Specified by:
getStatementSources
in interfaceStatementTupleExpr
- Returns:
- a list of sources that are relevant for evaluation of this expression
-
getSourceCount
public int getSourceCount()
-
getFilterExpr
public FilterValueExpr getFilterExpr()
- Specified by:
getFilterExpr
in interfaceFilterTuple
- Returns:
- the currently registered filter expressions, usually of type
FilterExpr
orConjunctiveFilterExpr
-
getBoundFilters
public BindingSet 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
public void addFilterExpr(FilterExpr expr)
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
public void addBoundFilter(String varName, Value value)
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)
-
-