java.lang.Object
org.apache.jena.arq.querybuilder.updatebuilder.WhereQuadHolder
All Implemented Interfaces:
QuadHolder

public class WhereQuadHolder extends Object implements QuadHolder
The where processor. Generally handles update where clause.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addAll(WhereHandler whereHandler)
    Add all where attributes from the Where Handler argument.
    void
    addBind(String expression, org.apache.jena.sparql.core.Var var)
    Add a binding to the where clause.
    void
    addBind(org.apache.jena.sparql.expr.Expr expr, org.apache.jena.sparql.core.Var var)
    Add a binding to the where clause.
    void
    addFilter(String expression)
    Add an expression string as a filter.
    void
    addFilter(org.apache.jena.sparql.expr.Expr expr)
    add an expression as a filter.
    void
    addGraph(org.apache.jena.graph.Node graph, WhereHandler subQuery)
    Add a graph to the where clause.
    void
    Add a minus operation to the where clause.
    void
    addOptional(Collection<org.apache.jena.sparql.core.TriplePath> t)
    Add an optional TriplePath to the where clause
    void
    addOptional(WhereHandler whereHandler)
    Add the contents of a where handler as an optional statement.
    void
    addOptional(org.apache.jena.sparql.core.TriplePath t)
    Add an optional triple to the where clause
    void
    Add a subquery to the where clause.
    void
    Add a union to the where clause.
    void
    addWhere(Collection<org.apache.jena.sparql.core.TriplePath> t)
    Add a TriplePath collection to the where clause
    void
    addWhere(org.apache.jena.sparql.core.TriplePath t)
    Add the triple path to the where clause
    org.apache.jena.sparql.syntax.Element
     
    org.apache.jena.sparql.syntax.ElementGroup
    Get the element group for the clause.
    org.apache.jena.util.iterator.ExtendedIterator<org.apache.jena.sparql.core.Quad>
    Get an extended iterator over the quads this holder holds.
    org.apache.jena.util.iterator.ExtendedIterator<org.apache.jena.sparql.core.Quad>
    getQuads(org.apache.jena.graph.Node defaultGraphName)
     
    boolean
    True if there are no elements in the where processor.
    org.apache.jena.graph.Node
    list(Object... objs)
    Deprecated.
    use Converters.makeCollection(List.of(Object...))
    setValues(Map<org.apache.jena.sparql.core.Var,org.apache.jena.graph.Node> values)
    Apply values to the variables in the quads held by this holder.
    setVars(Map<org.apache.jena.sparql.core.Var,org.apache.jena.graph.Node> values)
    replace the vars in the expressions with the nodes in the values map.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • WhereQuadHolder

      public WhereQuadHolder(PrefixHandler prefixHandler)
      Constructor.
      Parameters:
      prefixHandler - the prefix handler to use.
  • Method Details

    • isEmpty

      public boolean isEmpty()
      True if there are no elements in the where processor.
      Returns:
      true if there are no elements.
    • getQuads

      public org.apache.jena.util.iterator.ExtendedIterator<org.apache.jena.sparql.core.Quad> getQuads()
      Description copied from interface: QuadHolder
      Get an extended iterator over the quads this holder holds.
      Specified by:
      getQuads in interface QuadHolder
      Returns:
      the extended iterator.
    • getQuads

      public org.apache.jena.util.iterator.ExtendedIterator<org.apache.jena.sparql.core.Quad> getQuads(org.apache.jena.graph.Node defaultGraphName)
    • addAll

      public void addAll(WhereHandler whereHandler)
      Add all where attributes from the Where Handler argument.
      Parameters:
      whereHandler - The Where Handler to copy from.
    • getClause

      public org.apache.jena.sparql.syntax.ElementGroup getClause()
      Get the element group for the clause. if The element group is not set, create and set it. Public for ExprFactory use.
      Returns:
      The element group.
    • addWhere

      public void addWhere(org.apache.jena.sparql.core.TriplePath t) throws IllegalArgumentException
      Add the triple path to the where clause
      Parameters:
      t - The triple path to add.
      Throws:
      IllegalArgumentException - If the triple path is not a valid triple path for a where clause.
    • addWhere

      public void addWhere(Collection<org.apache.jena.sparql.core.TriplePath> t) throws IllegalArgumentException
      Add a TriplePath collection to the where clause
      Parameters:
      t - The triple path to add.
      Throws:
      IllegalArgumentException - If the triple path is not a valid triple path for a where clause.
    • addOptional

      public void addOptional(org.apache.jena.sparql.core.TriplePath t) throws IllegalArgumentException
      Add an optional triple to the where clause
      Parameters:
      t - The triple path to add.
      Throws:
      IllegalArgumentException - If the triple is not a valid triple for a where clause.
    • addOptional

      public void addOptional(Collection<org.apache.jena.sparql.core.TriplePath> t) throws IllegalArgumentException
      Add an optional TriplePath to the where clause
      Parameters:
      t - The triple path to add.
      Throws:
      IllegalArgumentException - If the triple is not a valid triple for a where clause.
    • addOptional

      public void addOptional(WhereHandler whereHandler)
      Add the contents of a where handler as an optional statement.
      Parameters:
      whereHandler - The where handler to use as the optional statement.
    • addFilter

      public void addFilter(String expression)
      Add an expression string as a filter.
      Parameters:
      expression - The expression string to add.
    • addFilter

      public void addFilter(org.apache.jena.sparql.expr.Expr expr)
      add an expression as a filter.
      Parameters:
      expr - The expression to add.
    • addSubQuery

      public void addSubQuery(AbstractQueryBuilder<?> subQuery)
      Add a subquery to the where clause.
      Parameters:
      subQuery - The sub query to add.
    • addUnion

      public void addUnion(AbstractQueryBuilder<?> subQuery)
      Add a union to the where clause.
      Parameters:
      subQuery - The subquery to add as the union.
    • addGraph

      public void addGraph(org.apache.jena.graph.Node graph, WhereHandler subQuery)
      Add a graph to the where clause.
      Parameters:
      graph - The name of the graph.
      subQuery - The where handler that defines the graph.
    • addBind

      public void addBind(org.apache.jena.sparql.expr.Expr expr, org.apache.jena.sparql.core.Var var)
      Add a binding to the where clause.
      Parameters:
      expr - The expression to bind.
      var - The variable to bind it to.
    • addBind

      public void addBind(String expression, org.apache.jena.sparql.core.Var var)
      Add a binding to the where clause.
      Parameters:
      expression - The expression to bind.
      var - The variable to bind it to.
    • setVars

      public WhereQuadHolder setVars(Map<org.apache.jena.sparql.core.Var,org.apache.jena.graph.Node> values)
      replace the vars in the expressions with the nodes in the values map. Vars not listed in the values map are not changed. Will return null if the whereClause is null.
      Parameters:
      values - the value map to use
      Returns:
      A new Element instance with the values changed.
    • setValues

      public QuadHolder setValues(Map<org.apache.jena.sparql.core.Var,org.apache.jena.graph.Node> values)
      Description copied from interface: QuadHolder
      Apply values to the variables in the quads held by this holder. May return this holder or a new holder instance.
      Specified by:
      setValues in interface QuadHolder
      Parameters:
      values - the values to set.
      Returns:
      a QuadHolder in which the variables have been replaced.
    • list

      @Deprecated(since="5.0.0") public org.apache.jena.graph.Node list(Object... objs)
      Deprecated.
      use Converters.makeCollection(List.of(Object...))
      Create a list node from a list of objects as per RDF Collections. http://www.w3.org/TR/2013/REC-sparql11-query-20130321/#collections
      Parameters:
      objs - the list of objects for the list.
      Returns:
      the first blank node in the list.
    • addMinus

      public void addMinus(AbstractQueryBuilder<?> qb)
      Add a minus operation to the where clause. The prefixes will be updated with the prefixes from the abstract query builder.
      Parameters:
      qb - the abstract builder that defines the data to subtract.
    • build

      public org.apache.jena.sparql.syntax.Element build()
      Returns:
      Build the whereClause and return the element.