org.eclipse.rdf4j.federated.algebra

## Class CheckStatementPattern

- java.lang.Object
- - org.eclipse.rdf4j.federated.algebra.CheckStatementPattern

- All Implemented Interfaces:
    Serializable, Cloneable, BoundJoinTupleExpr, FedXTupleExpr, QueryRef, StatementTupleExpr, VariableExpr, QueryModelNode, TupleExpr

      public class CheckStatementPattern
      extends Object
      implements StatementTupleExpr, BoundJoinTupleExpr

  A statement pattern with no free variables when provided with some particular BindingSet in evaluate. For evaluation a boolean ASK query is performed. Wraps a StatementTupleExpr
  Author:
    Andreas Schwarte
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected String` | `id`
    `protected QueryInfo` | `queryInfo`
    `protected StatementTupleExpr` | `stmt`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CheckStatementPattern(StatementTupleExpr stmt, QueryInfo queryInfo)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `CheckStatementPattern` | `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.
    `double` | `getCostEstimate()`
    `int` | `getFreeVarCount()`
    `List<String>` | `getFreeVars()`
    `String` | `getId()`
    `QueryModelNode` | `getParentNode()` Gets the node's parent.
    `QueryInfo` | `getQueryInfo()` Retrieve the attached query information of the tuple expression
    `long` | `getResultSizeActual()`
    `double` | `getResultSizeEstimate()` Returns the number of tuples that this QueryNode predicts will be outputted.
    `String` | `getSignature()` Returns the signature of this query model node.
    `StatementPattern` | `getStatementPattern()`
    `List<StatementSource>` | `getStatementSources()`
    `long` | `getTotalTimeNanosActual()`
    `boolean` | `hasFreeVarsFor(BindingSet binding)` returns true iff this statement has free variables in the presence of the specified binding set
    `void` | `replaceChildNode(QueryModelNode current, QueryModelNode replacement)` Replaces one of the child nodes with a new node.
    `void` | `replaceWith(QueryModelNode replacement)` Substitutes this node with a new node in the query model tree.
    `void` | `setCostEstimate(double costEstimate)`
    `void` | `setParentNode(QueryModelNode parent)` Sets the node's parent.
    `void` | `setResultSizeActual(long resultSizeActual)`
    `void` | `setResultSizeEstimate(double resultSizeEstimate)`
    `void` | `setTotalTimeNanosActual(long totalTimeNanosActual)`
    `<X extends Exception> void` | `visit(QueryModelVisitor<X> visitor)` Visits this node.
    `<X extends Exception> void` | `visitChildren(QueryModelVisitor<X> visitor)` Visits the children of this node.

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.eclipse.rdf4j.query.algebra.QueryModelNode

      `equals, toString`

- - ### Field Detail

    - #### stmt

          protected final StatementTupleExpr stmt

    - #### id

          protected final String id

    - #### queryInfo

          protected final QueryInfo queryInfo

  - ### Constructor Detail

    - #### CheckStatementPattern

          public CheckStatementPattern(StatementTupleExpr stmt,
                                       QueryInfo queryInfo)

  - ### Method Detail

    - #### getStatementPattern

          public StatementPattern getStatementPattern()

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

      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

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

    - #### getParentNode

          public QueryModelNode getParentNode()

      Description copied from interface: `QueryModelNode`
      Gets the node's parent.
      Specified by:
        `getParentNode` in interface `QueryModelNode`
      Returns:
        The parent node, if any.

    - #### getSignature

          public String getSignature()

      Description copied from interface: `QueryModelNode`
      Returns the signature of this query model node. Signatures normally include the node's name and any parameters, but not parent or child nodes. This method is used by `QueryModelNode.toString()`.
      Specified by:
        `getSignature` in interface `QueryModelNode`
      Returns:
        The node's signature, e.g. `SLICE (offset=10, limit=10)`.

    - #### replaceChildNode

          public void replaceChildNode(QueryModelNode current,
                                       QueryModelNode replacement)

      Description copied from interface: `QueryModelNode`
      Replaces one of the child nodes with a new node.
      Specified by:
        `replaceChildNode` in interface `QueryModelNode`
      Parameters:
        `current` - The current child node.
        `replacement` - The new child node.

    - #### replaceWith

          public void replaceWith(QueryModelNode replacement)

      Description copied from interface: `QueryModelNode`
      Substitutes this node with a new node in the query model tree.
      Specified by:
        `replaceWith` in interface `QueryModelNode`
      Parameters:
        `replacement` - The new node.

    - #### setParentNode

          public void setParentNode(QueryModelNode parent)

      Description copied from interface: `QueryModelNode`
      Sets the node's parent.
      Specified by:
        `setParentNode` in interface `QueryModelNode`
      Parameters:
        `parent` - The parent node for this node.

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

    - #### visitChildren

          public <X extends Exception> void visitChildren(QueryModelVisitor<X> visitor)
                                                   throws X extends Exception

      Description copied from interface: `QueryModelNode`
      Visits the children of this node. The node calls `QueryModelNode.visit(QueryModelVisitor)` on all of its child nodes.
      Specified by:
        `visitChildren` in interface `QueryModelNode`
      Throws:
        `X extends Exception`

    - #### clone

          public CheckStatementPattern 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 `Object`
      Returns:
        A deep clone of this query model node.

    - #### getResultSizeEstimate

          public double getResultSizeEstimate()

      Description copied from interface: `QueryModelNode`
      Returns the number of tuples that this QueryNode predicts will be outputted. For a StatementPattern this would be the estimated cardinality provided by the EvaluationStatistics. For a Join the would be the resulting number of joined tuples.
      Specified by:
        `getResultSizeEstimate` in interface `QueryModelNode`
      Returns:
        rows

    - #### setResultSizeEstimate

          public void setResultSizeEstimate(double resultSizeEstimate)

      Specified by:
        `setResultSizeEstimate` in interface `QueryModelNode`

    - #### getResultSizeActual

          public long getResultSizeActual()

      Specified by:
        `getResultSizeActual` in interface `QueryModelNode`

    - #### setResultSizeActual

          public void setResultSizeActual(long resultSizeActual)

      Specified by:
        `setResultSizeActual` in interface `QueryModelNode`

    - #### getCostEstimate

          public double getCostEstimate()

      Specified by:
        `getCostEstimate` in interface `QueryModelNode`

    - #### setCostEstimate

          public void setCostEstimate(double costEstimate)

      Specified by:
        `setCostEstimate` in interface `QueryModelNode`

    - #### getTotalTimeNanosActual

          public long getTotalTimeNanosActual()

      Specified by:
        `getTotalTimeNanosActual` in interface `QueryModelNode`

    - #### setTotalTimeNanosActual

          public void setTotalTimeNanosActual(long totalTimeNanosActual)

      Specified by:
        `setTotalTimeNanosActual` in interface `QueryModelNode`

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

    - #### 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-2022 Eclipse Foundation. All Rights Reserved.