Class ExclusiveGroup
- java.lang.Object
-
- org.eclipse.rdf4j.query.algebra.AbstractQueryModelNode
-
- org.eclipse.rdf4j.federated.algebra.ExclusiveGroup
-
- All Implemented Interfaces:
Serializable,Cloneable,ExclusiveTupleExpr,FedXTupleExpr,FilterTuple,QueryRef,StatementTupleExpr,VariableExpr,GraphPatternGroupable,QueryModelNode,TupleExpr,VariableScopeChange
public class ExclusiveGroup extends AbstractQueryModelNode implements StatementTupleExpr, FilterTuple, ExclusiveTupleExpr
Represents a group ofExclusiveTupleExprthat can only produce results at a single endpoint, theStatementSource.- Author:
- Andreas Schwarte
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected QueryBindingSetboundFiltersprotected FilterValueExprfilterExprprotected Set<String>freeVarsprotected Stringidprotected List<ExclusiveTupleExpr>ownedprotected EndpointownedEndpointprotected StatementSourceownerprotected QueryInfoqueryInfo
-
Constructor Summary
Constructors Constructor Description ExclusiveGroup(Collection<? extends ExclusiveTupleExpr> ownedNodes, StatementSource owner, 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.ExclusiveGroupclone()Returns a (deep) clone of this query model node.CloseableIteration<BindingSet,QueryEvaluationException>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.BindingSetgetBoundFilters()Returns bound filter bindings, that need to be added as additional bindings to the final resultList<ExclusiveTupleExpr>getExclusiveExpressions()FilterValueExprgetFilterExpr()intgetFreeVarCount()List<String>getFreeVars()StringgetId()EndpointgetOwnedEndpoint()StatementSourcegetOwner()QueryInfogetQueryInfo()Retrieve the attached query information of the tuple expressionList<StatementSource>getStatementSources()booleanhasFilter()booleanhasFreeVarsFor(BindingSet bindings)returns true iff this statement has free variables in the presence of the specified binding setprotected voidinit()Initialize free variables<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.AbstractQueryModelNode
getCostEstimate, getParentNode, getResultSizeActual, getResultSizeEstimate, getSignature, getTotalTimeNanosActual, isGraphPatternGroup, isVariableScopeChange, nullEquals, replaceChildNode, replaceNodeInList, replaceWith, setCostEstimate, setGraphPatternGroup, setParentNode, setResultSizeActual, setResultSizeEstimate, setTotalTimeNanosActual, setVariableScopeChange, toString
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, 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
-
-
-
-
Field Detail
-
owned
protected final List<ExclusiveTupleExpr> owned
-
owner
protected final StatementSource owner
-
id
protected final String id
-
queryInfo
protected final transient QueryInfo queryInfo
-
filterExpr
protected FilterValueExpr filterExpr
-
boundFilters
protected QueryBindingSet boundFilters
-
ownedEndpoint
protected transient Endpoint ownedEndpoint
-
-
Constructor Detail
-
ExclusiveGroup
public ExclusiveGroup(Collection<? extends ExclusiveTupleExpr> ownedNodes, StatementSource owner, QueryInfo queryInfo)
-
-
Method Detail
-
init
protected void init()
Initialize free variables
-
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 classAbstractQueryModelNode- 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- Throws:
X extends Exception
-
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.
-
clone
public ExclusiveGroup 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.- Specified by:
clonein interfaceQueryModelNode- Specified by:
clonein interfaceTupleExpr- Overrides:
clonein classAbstractQueryModelNode- Returns:
- A deep clone of this query model node.
-
getOwner
public StatementSource getOwner()
- Specified by:
getOwnerin interfaceExclusiveTupleExpr- Returns:
- the owner for this expression
-
getOwnedEndpoint
public Endpoint getOwnedEndpoint()
-
getExclusiveExpressions
public List<ExclusiveTupleExpr> getExclusiveExpressions()
-
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
-
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 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
-
evaluate
public CloseableIteration<BindingSet,QueryEvaluationException> 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
-
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
-
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
-
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
-
getQueryInfo
public QueryInfo getQueryInfo()
Description copied from interface:QueryRefRetrieve the attached query information of the tuple expression- Specified by:
getQueryInfoin interfaceQueryRef- Returns:
- the
QueryInfo
-
-