org.eclipse.rdf4j.query.algebra.evaluation

## Class QueryContext

- java.lang.Object
- - org.eclipse.rdf4j.query.algebra.evaluation.QueryContext

-     public class QueryContext
      extends Object

  A `QueryContext` provides a means to pass arbitrary local state to a `Function` or `TupleFunction`. The implementation of `org.eclipse.rdf4j.sail.SailConnection#evaluate()` is responsible for initialising a QueryContext and making it available during evaluation via `QueryContextIteration`. A QueryContext is commonly used to provide a `QueryPreparer` for the current SailConnection. This allows, for example, Functions to be written that conveniently express more complex queries.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `QueryContext()`
    `QueryContext(QueryPreparer qp)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `begin()`
    `void` | `end()`
    `<T> T` | `getAttribute(String name)`
    `static QueryContext` | `getQueryContext()`
    `QueryPreparer` | `getQueryPreparer()`
    `void` | `setAttribute(String name, Object value)`

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

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

- - ### Constructor Detail

    - #### QueryContext

          public QueryContext()

    - #### QueryContext

          public QueryContext(QueryPreparer qp)

  - ### Method Detail

    - #### getQueryContext

          public static QueryContext getQueryContext()

    - #### begin

          public void begin()

    - #### getQueryPreparer

          public QueryPreparer getQueryPreparer()

    - #### setAttribute

          public void setAttribute(String name,
                                   Object value)

    - #### getAttribute

          public <T> T getAttribute(String name)

    - #### end

          public void end()

Copyright © 2015-2021 Eclipse Foundation. All Rights Reserved.