Package org.eclipse.rdf4j.workbench.util

## Class QueryEvaluator

- java.lang.Object
- - org.eclipse.rdf4j.workbench.util.QueryEvaluator

-     public final class QueryEvaluator
      extends Object

  Evaluates queries for QueryServlet.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static QueryEvaluator` | `INSTANCE` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `evaluateTupleQuery​(TupleResultBuilder builder, String xslPath, WorkbenchRequest req, javax.servlet.http.HttpServletResponse resp, CookieHandler cookies, TupleQuery query, boolean writeCookie, boolean paged, int offset, int limit)` | Evaluate a tuple query, and create an XML results document.
    `void` | `evaluateTupleQuery​(TupleResultBuilder builder, TupleQuery query)` | Evaluate a tuple query, and create an XML results document.
    `void` | `extractQueryAndEvaluate​(TupleResultBuilder builder, javax.servlet.http.HttpServletResponse resp, OutputStream out, String xslPath, RepositoryConnection con, String queryText, WorkbenchRequest req, CookieHandler cookies)` | Evaluates the query submitted with the given request.

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

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

- - ### Field Detail

    - #### INSTANCE

          public static final QueryEvaluator INSTANCE

  - ### Method Detail

    - #### extractQueryAndEvaluate

          public void extractQueryAndEvaluate​(TupleResultBuilder builder,
                                              javax.servlet.http.HttpServletResponse resp,
                                              OutputStream out,
                                              String xslPath,
                                              RepositoryConnection con,
                                              String queryText,
                                              WorkbenchRequest req,
                                              CookieHandler cookies)
                                       throws BadRequestException,
                                              RDF4JException

      Evaluates the query submitted with the given request.
      Parameters:
        `builder` - used to build the response
        `resp` - the response object
        `out` - the output writer
        `xslPath` - style sheet path
        `con` - connection to repository
        `queryText` - the query text, having been pulled using `QueryServlet` from one of three request parameters: "query", "queryhash" or "saved"
        `req` - the request object
        `cookies` - used to deal with browser cookies
      Throws:
        `BadRequestException` - if there's a problem getting request parameters or issuing the repository query
        `RDF4JException` - if there's a problem preparing the query

    - #### evaluateTupleQuery

          public void evaluateTupleQuery​(TupleResultBuilder builder,
                                         String xslPath,
                                         WorkbenchRequest req,
                                         javax.servlet.http.HttpServletResponse resp,
                                         CookieHandler cookies,
                                         TupleQuery query,
                                         boolean writeCookie,
                                         boolean paged,
                                         int offset,
                                         int limit)
                                  throws QueryEvaluationException,
                                         QueryResultHandlerException

      Evaluate a tuple query, and create an XML results document. This method completes writing of the response. !paged means use all results.
      Parameters:
        `builder` - response builder helper for generating the XML response to the client, which must not have had start() called on it
        `xslPath` - needed to begin writing response body after writing result count cookie
        `req` - needed to write result count cookie
        `resp` - needed to write result count cookie
        `cookies` - needed to write result count cookie
        `query` - the query to be evaluated
        `writeCookie` - whether to write the total result count cookie
        `paged` - whether to display a limited subset
      Throws:
        `QueryResultHandlerException`
        `QueryEvaluationException`

    - #### evaluateTupleQuery

          public void evaluateTupleQuery​(TupleResultBuilder builder,
                                         TupleQuery query)
                                  throws QueryEvaluationException,
                                         QueryResultHandlerException

      Evaluate a tuple query, and create an XML results document. It is still necessary to call end() on the builder after calling this method.
      Parameters:
        `builder` - response builder helper for generating the XML response to the client, which must have had start() called on it
        `query` - the query to be evaluated
      Throws:
        `QueryResultHandlerException`
        `QueryEvaluationException`