org.eclipse.rdf4j.federated.algebra

## 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 of `ExclusiveTupleExpr` that can only produce results at a single endpoint, the `StatementSource`.
  Author:
    Andreas Schwarte
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected QueryBindingSet` | `boundFilters`
    `protected FilterValueExpr` | `filterExpr`
    `protected Set<String>` | `freeVars`
    `protected String` | `id`
    `protected List<ExclusiveTupleExpr>` | `owned`
    `protected Endpoint` | `ownedEndpoint`
    `protected StatementSource` | `owner`
    `protected QueryInfo` | `queryInfo`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExclusiveGroup(Collection<? extends ExclusiveTupleExpr> ownedNodes, StatementSource owner, QueryInfo queryInfo)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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.
    `ExclusiveGroup` | `clone()` Returns a (deep) clone of this query model node.
    `CloseableIteration<BindingSet,QueryEvaluationException>` | `evaluate(BindingSet bindings)` Evaluate this expression using the provided bindings
    `Set<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.
    `BindingSet` | `getBoundFilters()` Returns bound filter bindings, that need to be added as additional bindings to the final result
    `List<ExclusiveTupleExpr>` | `getExclusiveExpressions()`
    `FilterValueExpr` | `getFilterExpr()`
    `int` | `getFreeVarCount()`
    `List<String>` | `getFreeVars()`
    `String` | `getId()`
    `Endpoint` | `getOwnedEndpoint()`
    `StatementSource` | `getOwner()`
    `QueryInfo` | `getQueryInfo()` Retrieve the attached query information of the tuple expression
    `List<StatementSource>` | `getStatementSources()`
    `boolean` | `hasFilter()`
    `boolean` | `hasFreeVarsFor(BindingSet bindings)` returns true iff this statement has free variables in the presence of the specified binding set
    `protected void` | `init()` Initialize free variables
    `<X extends Exception> void` | `visit(QueryModelVisitor<X> visitor)` Visits this node.
    `<X extends Exception> void` | `visitChildren(QueryModelVisitor<X> visitor)` Dummy implementation of `QueryModelNode.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

    - #### freeVars

          protected final Set<String> freeVars

    - #### 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: `AbstractQueryModelNode`
      Dummy implementation of `QueryModelNode.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 interface `QueryModelNode`
      Overrides:
        `visitChildren` in class `AbstractQueryModelNode`
      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 interface `QueryModelNode`
      Throws:
        `X extends Exception`

    - #### getAssuredBindingNames

          public Set<String> getAssuredBindingNames()

      Description copied from interface: `TupleExpr`
      Gets the names of the bindings that are guaranteed to be present in the results produced by this tuple expression.
      Specified by:
        `getAssuredBindingNames` in interface `TupleExpr`
      Returns:
        A set of binding names.

    - #### getBindingNames

          public Set<String> getBindingNames()

      Description copied from interface: `TupleExpr`
      Gets the names of the bindings that are, or can be, returned by this tuple expression when it is evaluated.
      Specified by:
        `getBindingNames` in interface `TupleExpr`
      Returns:
        A set of binding names.

    - #### clone

          public ExclusiveGroup clone()

      Description copied from interface: `QueryModelNode`
      Returns a (deep) clone of this query model node. This method recursively clones the entire node tree, starting from this nodes.
      Specified by:
        `clone` in interface `QueryModelNode`
      Specified by:
        `clone` in interface `TupleExpr`
      Overrides:
        `clone` in class `AbstractQueryModelNode`
      Returns:
        A deep clone of this query model node.

    - #### getOwner

          public StatementSource getOwner()

      Specified by:
        `getOwner` in interface `ExclusiveTupleExpr`
      Returns:
        the owner for this expression

    - #### getOwnedEndpoint

          public Endpoint getOwnedEndpoint()

    - #### getExclusiveExpressions

          public List<ExclusiveTupleExpr> getExclusiveExpressions()

    - #### getFreeVarCount

          public int getFreeVarCount()

      Specified by:
        `getFreeVarCount` in interface `FedXTupleExpr`
      Returns:
        the number of free (i.e. unbound) variables in this expression

    - #### getFreeVars

          public List<String> getFreeVars()

      Specified by:
        `getFreeVars` in interface `FilterTuple`
      Specified by:
        `getFreeVars` in interface `VariableExpr`
      Returns:
        a list of free (i.e. unbound) variables in this expression

    - #### getId

          public String getId()

      Specified by:
        `getId` in interface `StatementTupleExpr`
      Returns:
        the id of this expr

    - #### getStatementSources

          public List<StatementSource> getStatementSources()

      Specified by:
        `getStatementSources` in interface `StatementTupleExpr`
      Returns:
        a list of sources that are relevant for evaluation of this expression

    - #### 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 interface `StatementTupleExpr`
      Returns:
        whether the statement has free vars

    - #### evaluate

          public CloseableIteration<BindingSet,QueryEvaluationException> evaluate(BindingSet bindings)
                                                                           throws QueryEvaluationException

      Description copied from interface: `StatementTupleExpr`
      Evaluate this expression using the provided bindings
      Specified by:
        `evaluate` in interface `StatementTupleExpr`
      Returns:
        the result iteration
      Throws:
        `QueryEvaluationException`

    - #### 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 a `ConjunctiveFilterExpr`.
      Specified by:
        `addFilterExpr` in interface `FilterTuple`

    - #### getFilterExpr

          public FilterValueExpr getFilterExpr()

      Specified by:
        `getFilterExpr` in interface `FilterTuple`
      Returns:
        the currently registered filter expressions, usually of type `FilterExpr` or `ConjunctiveFilterExpr`

    - #### 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 interface `FilterTuple`
      Returns:
        the bound filters, or `null`

    - #### hasFilter

          public boolean hasFilter()

      Specified by:
        `hasFilter` in interface `FilterTuple`
      Returns:
        true if this expression has a filter to apply

    - #### 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 interface `FilterTuple`

    - #### getQueryInfo

          public QueryInfo getQueryInfo()

      Description copied from interface: `QueryRef`
      Retrieve the attached query information of the tuple expression
      Specified by:
        `getQueryInfo` in interface `QueryRef`
      Returns:
        the `QueryInfo`

Copyright © 2015-2021 Eclipse Foundation. All Rights Reserved.