public class QueryEngineHTTP extends Object implements QueryExecution
| Modifier and Type | Field and Description |
|---|---|
static String |
QUERY_MIME_TYPE |
static String[] |
supportedAskContentTypes |
static String[] |
supportedSelectContentTypes |
| Constructor and Description |
|---|
QueryEngineHTTP(String serviceURI,
Query query) |
QueryEngineHTTP(String serviceURI,
String queryString) |
| Modifier and Type | Method and Description |
|---|---|
void |
abort()
Stop in mid execution.
|
void |
addDefaultGraph(String defaultGraph) |
void |
addNamedGraph(String name) |
void |
addParam(String field,
String value) |
void |
cancel() |
void |
close()
Close the query execution and stop query evaluation as soon as convenient.
|
boolean |
execAsk()
Execute an ASK query
|
Model |
execConstruct()
Execute a CONSTRUCT query
|
Model |
execConstruct(Model model)
Execute a CONSTRUCT query, putting the statements into 'model'.
|
Iterator<Triple> |
execConstructTriples()
Execute a CONSTRUCT query, returning the results as an iterator of
Triple. |
Model |
execDescribe()
Execute a DESCRIBE query
|
Model |
execDescribe(Model model)
Execute a DESCRIBE query, putting the statements into 'model'.
|
Iterator<Triple> |
execDescribeTriples()
Execute a DESCRIBE query, returning the results as an iterator of
Triple. |
ResultSet |
execSelect()
Execute a SELECT query
|
Context |
getContext()
The properties associated with a query execution -
implementation specific parameters This includes
Java objects (so it is not an RDF graph).
|
Dataset |
getDataset()
The dataset against which the query will execute.
|
Query |
getQuery()
The query associated with a query execution.
|
void |
setAllowDeflate(boolean allowed)
Sets whether the HTTP requests will specify Accept-Encoding: deflate
|
void |
setAllowGZip(boolean allowed)
Sets whether the HTTP request will specify Accept-Encoding: gzip
|
void |
setAskContentType(String contentType)
Sets the Content Type for ASK queries provided that the format is supported
|
void |
setBasicAuthentication(String user,
char[] password)
Set user and password for basic authentication.
|
void |
setDefaultGraphURIs(List<String> defaultGraphURIs) |
void |
setFileManager(FileManager fm)
Set the FileManger that might be used to load files.
|
void |
setInitialBinding(QuerySolution binding)
Set the initial association of variables and values.
|
void |
setInitialBindings(ResultSet table) |
void |
setModelContentType(String contentType)
Sets the Content Type for CONSTRUCT/DESCRIBE queries provided that the format is supported
|
void |
setNamedGraphURIs(List<String> namedGraphURIs) |
void |
setSelectContentType(String contentType)
Sets the Content Type for SELECT queries provided that the format is supported
|
void |
setTimeout(long readTimeout)
Set time, in milliseconds
|
void |
setTimeout(long readTimeout,
long connectTimeout)
Set time, in milliseconds
|
void |
setTimeout(long readTimeout,
TimeUnit timeoutUnits)
Set a timeout on the query execution.
|
void |
setTimeout(long timeout1,
TimeUnit timeUnit1,
long timeout2,
TimeUnit timeUnit2)
Set timeouts on the query execution; the first timeout refers to time to first result,
the second refers to overall query execution after the first result.
|
String |
toString() |
public static final String QUERY_MIME_TYPE
public static String[] supportedSelectContentTypes
public static String[] supportedAskContentTypes
public void setFileManager(FileManager fm)
QueryExecutionsetFileManager in interface QueryExecutionpublic void setInitialBinding(QuerySolution binding)
QueryExecutionsetInitialBinding in interface QueryExecutionpublic void setInitialBindings(ResultSet table)
public void setDefaultGraphURIs(List<String> defaultGraphURIs)
defaultGraphURIs - The defaultGraphURIs to set.public void setNamedGraphURIs(List<String> namedGraphURIs)
namedGraphURIs - The namedGraphURIs to set.public void setAllowGZip(boolean allowed)
public void setAllowDeflate(boolean allowed)
public void addDefaultGraph(String defaultGraph)
defaultGraph - The defaultGraph to add.public void addNamedGraph(String name)
name - The URI to add.public void setBasicAuthentication(String user, char[] password)
user - password - public ResultSet execSelect()
QueryExecutionexecSelect in interface QueryExecutionpublic Model execConstruct()
QueryExecutionexecConstruct in interface QueryExecutionpublic Model execConstruct(Model model)
QueryExecutionexecConstruct in interface QueryExecutionpublic Iterator<Triple> execConstructTriples()
QueryExecutionTriple.
Caution: This method may return duplicate Triples. This method may be useful if you only
need the results for stream processing, as it can avoid having to place the results in a Model.execConstructTriples in interface QueryExecutionpublic Model execDescribe()
QueryExecutionexecDescribe in interface QueryExecutionpublic Model execDescribe(Model model)
QueryExecutionexecDescribe in interface QueryExecutionpublic Iterator<Triple> execDescribeTriples()
QueryExecutionTriple.
Caution: This method may return duplicate Triples. This method may be useful if you only
need the results for stream processing, as it can avoid having to place the results in a Model.execDescribeTriples in interface QueryExecutionpublic boolean execAsk()
QueryExecutionexecAsk in interface QueryExecutionpublic Context getContext()
QueryExecutiongetContext in interface QueryExecutionpublic Dataset getDataset()
QueryExecutiongetDataset in interface QueryExecutionpublic Query getQuery()
QueryExecutiongetQuery in interface QueryExecutionpublic void setTimeout(long readTimeout)
QueryExecutionsetTimeout in interface QueryExecutionQueryExecution.setTimeout(long, TimeUnit)public void setTimeout(long readTimeout,
long connectTimeout)
QueryExecutionsetTimeout in interface QueryExecutionQueryExecution.setTimeout(long, TimeUnit, long, TimeUnit)public void setTimeout(long readTimeout,
TimeUnit timeoutUnits)
QueryExecutionsetTimeout in interface QueryExecutionpublic void setTimeout(long timeout1,
TimeUnit timeUnit1,
long timeout2,
TimeUnit timeUnit2)
QueryExecutionsetTimeout in interface QueryExecutionpublic void cancel()
public void abort()
QueryExecutionabort in interface QueryExecutionpublic void close()
QueryExecutionclose in interface QueryExecutionpublic void setSelectContentType(String contentType)
contentType - public void setAskContentType(String contentType)
contentType - public void setModelContentType(String contentType)
contentType - Licenced under the Apache License, Version 2.0