Class ExecHTTPBuilder<X,Y>

java.lang.Object
org.apache.jena.http.sys.ExecHTTPBuilder<X,Y>
Direct Known Subclasses:
QueryExecHTTPBuilder, QueryExecutionHTTPBuilder

public abstract class ExecHTTPBuilder<X,Y> extends Object
Execution builder for remote queries.
  • Constructor Details

    • ExecHTTPBuilder

      public ExecHTTPBuilder()
  • Method Details

    • endpoint

      public Y endpoint(String serviceURL)
      Set the URL of the query endpoint.
    • parseCheck

      public Y parseCheck(boolean parseCheck)
      Whether to parse query strings passed to query(String).
    • query

      public Y query(Query query)
      Set the query - this also sets the query string to agree with the query argument.
    • query

      public Y query(String queryStr)
      Set the query - the the string must be valid syntax. Use queryString to pass in a query with other syntax (e.g. the remote end has SPARQL syntax extensions).
    • query

      public Y query(String queryStr, Syntax syntax)
    • queryString

      public Y queryString(String queryString)
      Set the query string - this also clears any Query already set. The queryString is not interpreted and it may contain SPARQL syntax extensions supported by the target triple store.
    • addDefaultGraphURI

      public Y addDefaultGraphURI(String uri)
    • addNamedGraphURI

      public Y addNamedGraphURI(String uri)
    • httpClient

      public Y httpClient(HttpClient httpClient)
    • sendMode

      public Y sendMode(QuerySendMode mode)
      Choose how to send the query string over HTTP.

      The default is QuerySendMode.systemDefault which is QuerySendMode.asGetWithLimitBody – send by HTTP GET and a query string unless too long (see urlLimit), when it switch to POST and application/sparql-query".

      See Also:
    • useGetWithLimit

      public Y useGetWithLimit()
      Send the query using HTTP GET and the HTTP URL query string, unless the request exceeds the urlGetLimit(int) (system default HttpEnv.urlLimit).

      If it exceeds the limit, switch to using a HTML form and POST request. By default, queries with a log URL are sent in an HTTP form with POST.

      This is the default setting.

      See Also:
    • useGet

      public Y useGet()
      Send the query using HTTP GET and the HTTP URL query string regardless of length. By default, queries with a long URL are sent in an HTTP POST.
    • postQuery

      public Y postQuery()
      Send the query request using POST with a Content-Type of as a "application/sparql-query"
    • urlGetLimit

      public Y urlGetLimit(int urlLimit)
      Maximum length for a GET request URL, this includes the length of the service endpoint URL - longer than this and the request will use POST/Form.

      Long URLs can be silently truncated by intermediate systems and proxies. Use of the URL query string means that request are not cached.

      See also postQuery() to send the request using HTTP POST with the query in the POST body using Content-Type "application/sparql-query"

      See also sendMode to choose a specific "send" policy.

    • params

      public Y params(Params other)
      Merge in Params from another object.
    • param

      public Y param(String name)
    • param

      public Y param(String name, String value)
    • substitution

      public Y substitution(Binding binding)
    • substitution

      public Y substitution(String var, org.apache.jena.graph.Node value)
    • substitution

      public Y substitution(Var var, org.apache.jena.graph.Node value)
    • acceptHeader

      public Y acceptHeader(String acceptHeader)
    • httpHeader

      public Y httpHeader(String headerName, String headerValue)
    • httpHeaders

      public Y httpHeaders(Map<String,String> headers)
    • context

      public Y context(Context context)
      Set the Context. This defaults to the global settings of ARQ.getContext(). If there was a previous call of context the multiple contexts are merged.
    • set

      public Y set(Symbol symbol, Object value)
    • set

      public Y set(Symbol symbol, boolean value)
    • timeout

      public Y timeout(long timeout, TimeUnit timeoutUnit)
      Set a timeout of the overall operation. Time-to-connect can be set with a custom HttpClient - see HttpClient.Builder.connectTimeout(java.time.Duration).
    • build

      public final X build()