Package org.eclipse.rdf4j.federated.algebra

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

  - ### 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 result
    `FilterValueExpr` | `getFilterExpr()` |
    `int` | `getFreeVarCount()` |
    `List<String>` | `getFreeVars()` |
    `String` | `getId()` |
    `QueryInfo` | `getQueryInfo()` | Retrieve the attached query information of the tuple expression
    `int` | `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 set
    `protected void` | `initFreeVars()` |
    `void` | `setUpperLimit​(long upperLimit)` | Set the upper limit for this statement expression (i.e.
    `<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.StatementPattern

      `clone, equals, getAssuredBindingNames, getBindingNames, getContextVar, getObjectVar, getPredicateVar, getScope, getSignature, getSubjectVar, getVarList, getVars, hashCode, replaceChildNode, 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 Detail

    - #### statementSources

          protected final List<StatementSource> statementSources

    - #### id

          protected final String id

    - #### queryInfo

          protected final QueryInfo queryInfo

    - #### freeVars

          protected final List<String> freeVars

    - #### 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 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 `StatementPattern`
      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`
      Overrides:
        `visit` in class `StatementPattern`
      Throws:
        `X extends Exception`

    - #### initFreeVars

          protected void initFreeVars()

    - #### 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

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

    - #### getId

          public String getId()

      Specified by:
        `getId` in interface `StatementTupleExpr`
      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 interface `StatementTupleExpr`
      Returns:
        whether the statement has free vars

    - #### getStatementSources

          public List<StatementSource> getStatementSources()

      Specified by:
        `getStatementSources` in interface `StatementTupleExpr`
      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 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

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

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

    - #### 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)