Class QueryEvaluator


  • public final class QueryEvaluator
    extends Object
    Evaluates queries for QueryServlet.
    • 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