Class GraphPattern

java.lang.Object
org.eclipse.rdf4j.query.parser.sparql.GraphPattern

@InternalUseOnly public class GraphPattern extends Object
A graph pattern consisting of (required and optional) tuple expressions, binding assignments and boolean constraints.
Author:
Arjohn Kampman
  • Constructor Details Link icon

    • GraphPattern Link icon

      public GraphPattern()
      Creates a new graph pattern.
    • GraphPattern Link icon

      public GraphPattern(GraphPattern parent)
      Creates a new graph pattern that inherits the context and scope from a parent graph pattern.
  • Method Details Link icon

    • setContextVar Link icon

      public void setContextVar(Var contextVar)
    • getContextVar Link icon

      public Var getContextVar()
    • setStatementPatternScope Link icon

      public void setStatementPatternScope(StatementPattern.Scope spScope)
    • getStatementPatternScope Link icon

      public StatementPattern.Scope getStatementPatternScope()
    • addRequiredTE Link icon

      public void addRequiredTE(TupleExpr te)
    • addRequiredSP Link icon

      public void addRequiredSP(Var subjVar, Var predVar, Var objVar)
    • getRequiredTEs Link icon

      public List<TupleExpr> getRequiredTEs()
    • addOptionalTE Link icon

      public void addOptionalTE(TupleExpr te, List<ValueExpr> constraints)
      add the supplied tuple expression as an optional expression, with a list of constraints that hold as conditions.
      Parameters:
      te - a tuple expression
      constraints - a list of constraints that form a condition for the LeftJoin to be formed from the optional TE.
    • getOptionalTEs Link icon

      public List<Map.Entry<TupleExpr,List<ValueExpr>>> getOptionalTEs()
      Retrieves the optional tuple expressions as a list of tuples with the tuple expression as the key and the list of value expressions as the value.
      Returns:
      a list of Map entries.
    • addConstraint Link icon

      public void addConstraint(ValueExpr constraint)
    • addConstraints Link icon

      public void addConstraints(Collection<ValueExpr> constraints)
    • getConstraints Link icon

      public List<ValueExpr> getConstraints()
    • removeAllConstraints Link icon

      public List<ValueExpr> removeAllConstraints()
    • clear Link icon

      public void clear()
      Removes all tuple expressions and constraints.
    • buildTupleExpr Link icon

      public TupleExpr buildTupleExpr()
      Builds a combined tuple expression from the tuple expressions and constraints in this graph pattern.
      Returns:
      A tuple expression for this graph pattern.
    • buildOptionalTE Link icon

      public TupleExpr buildOptionalTE(TupleExpr result)
      Build optionals to the supplied TE