Class FedXStatementPattern

All Implemented Interfaces:
Serializable, Cloneable, BoundJoinTupleExpr, FedXTupleExpr, FilterTuple, QueryRef, StatementTupleExpr, VariableExpr, 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:
  • Field Details

  • Constructor Details

  • Method Details

    • visitChildren

      public <X extends Exception> void visitChildren(QueryModelVisitor<X> visitor) throws X
      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
      Overrides:
      visitChildren in class StatementPattern
      Throws:
      X
    • visit

      public <X extends Exception> void visit(QueryModelVisitor<X> visitor) throws X
      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
    • 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
      Parameters:
      bindings -
      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
      Parameters:
      expr -
    • 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
      Parameters:
      varName -
      value -
    • 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)