|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP
public class QueryEngineHTTP
A query execution implementation where queries are executed against a remote service
| Field Summary | |
|---|---|
static String |
QUERY_MIME_TYPE
|
static String[] |
supportedAskContentTypes
Supported content types for ASK queries |
static String[] |
supportedSelectContentTypes
Supported content types for SELECT queries |
| Constructor Summary | |
|---|---|
QueryEngineHTTP(String serviceURI,
Query query)
|
|
QueryEngineHTTP(String serviceURI,
Query query,
HttpAuthenticator authenticator)
|
|
QueryEngineHTTP(String serviceURI,
String queryString)
|
|
QueryEngineHTTP(String serviceURI,
String queryString,
HttpAuthenticator authenticator)
|
|
| Method Summary | |
|---|---|
void |
abort()
Stop in mid execution. |
void |
addDefaultGraph(String defaultGraph)
|
void |
addNamedGraph(String name)
|
void |
addParam(String field,
String value)
|
void |
cancel()
Cancel query evaluation |
void |
close()
Close the query execution and stop query evaluation as soon as convenient. |
static String |
defaultAskHeader()
|
static String |
defaultConstructHeader()
|
static String |
defaultSelectHeader()
|
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 |
boolean |
getAllowDeflate()
Gets whether HTTP requests will indicate to the remote server that Deflate encoding of responses is accepted |
boolean |
getAllowGZip()
Gets whether HTTP requests will indicate to the remote server that GZip encoding of responses is accepted |
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. |
long |
getTimeout1()
Return the first timeout (time to first result), in millseconds: negative if unset |
long |
getTimeout2()
Return the second timeout (overall query execution after first result), in millseconds: negative if unset |
boolean |
isUsingBasicAuthentication()
Gets whether an authentication mechanism has been provided. |
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 |
setAuthenticator(HttpAuthenticator authenticator)
Sets the HTTP authenticator to use, if none is set then the default authenticator is used. |
void |
setBasicAuthentication(String user,
char[] password)
Set user and password for basic authentication. |
void |
setDefaultGraphURIs(List<String> defaultGraphURIs)
|
void |
setFileManager(FileManager fm)
Deprecated. |
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()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String QUERY_MIME_TYPE
public static String[] supportedSelectContentTypes
public static String[] supportedAskContentTypes
| Constructor Detail |
|---|
public QueryEngineHTTP(String serviceURI,
Query query)
public QueryEngineHTTP(String serviceURI,
Query query,
HttpAuthenticator authenticator)
public QueryEngineHTTP(String serviceURI,
String queryString)
public QueryEngineHTTP(String serviceURI,
String queryString,
HttpAuthenticator authenticator)
| Method Detail |
|---|
@Deprecated public void setFileManager(FileManager fm)
QueryExecution
setFileManager in interface QueryExecutionpublic void setInitialBinding(QuerySolution binding)
QueryExecution
setInitialBinding 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 addParam(String field,
String value)
public void addDefaultGraph(String defaultGraph)
defaultGraph - The defaultGraph to add.public void addNamedGraph(String name)
name - The URI to add.public boolean isUsingBasicAuthentication()
Even if this returns false authentication may still be used if the
default authenticator applies, this is controlled via the
HttpOp.setDefaultAuthenticator(HttpAuthenticator) method
public void setBasicAuthentication(String user,
char[] password)
Note that it may be more flexible to
user - password - public void setAuthenticator(HttpAuthenticator authenticator)
HttpOp.setDefaultAuthenticator(HttpAuthenticator) method.
authenticator - HTTP authenticatorpublic ResultSet execSelect()
QueryExecutionImportant: The name of this method is somewhat of a misnomer in that depending on the underlying implementation this typically does not execute the SELECT query but rather answers a wrapper over an internal data structure that can be used to answer the query. In essence calling this method only returns a plan for executing this query which only gets evaluated when you actually start iterating over the results.
execSelect in interface QueryExecutionpublic Model execConstruct()
QueryExecution
execConstruct in interface QueryExecutionpublic Model execConstruct(Model model)
QueryExecution
execConstruct 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.
Important: The name of this method is somewhat of a misnomer in that depending on the underlying implementation this typically does not execute the CONSTRUCT query but rather answers a wrapper over an internal data structure that can be used to answer the query. In essence calling this method only returns a plan for executing this query which only gets evaluated when you actually start iterating over the results.
execConstructTriples in interface QueryExecutionpublic Model execDescribe()
QueryExecution
execDescribe in interface QueryExecutionpublic Model execDescribe(Model model)
QueryExecution
execDescribe 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.
Important: The name of this method is somewhat of a misnomer in that depending on the underlying implementation this typically does not execute the DESCRIBE query but rather answers a wrapper over an internal data structure that can be used to answer the query. In essence calling this method only returns a plan for executing this query which only gets evaluated when you actually start iterating over the results.
execDescribeTriples in interface QueryExecutionpublic boolean execAsk()
QueryExecution
execAsk in interface QueryExecutionpublic Context getContext()
QueryExecution
getContext in interface QueryExecutionpublic Dataset getDataset()
QueryExecution
getDataset in interface QueryExecutionpublic Query getQuery()
QueryExecution
getQuery in interface QueryExecutionpublic void setTimeout(long readTimeout)
QueryExecution
setTimeout in interface QueryExecutionQueryExecution.setTimeout(long, TimeUnit)
public void setTimeout(long readTimeout,
long connectTimeout)
QueryExecution
setTimeout in interface QueryExecutionQueryExecution.setTimeout(long, TimeUnit, long, TimeUnit)
public void setTimeout(long readTimeout,
TimeUnit timeoutUnits)
QueryExecution
setTimeout in interface QueryExecution
public void setTimeout(long timeout1,
TimeUnit timeUnit1,
long timeout2,
TimeUnit timeUnit2)
QueryExecution
setTimeout in interface QueryExecutionpublic long getTimeout1()
QueryExecution
getTimeout1 in interface QueryExecutionpublic long getTimeout2()
QueryExecution
getTimeout2 in interface QueryExecutionpublic boolean getAllowGZip()
public boolean getAllowDeflate()
public void cancel()
public void abort()
QueryExecution
abort in interface QueryExecutionpublic void close()
QueryExecution
close in interface QueryExecutionpublic String toString()
toString in class Objectpublic void setSelectContentType(String contentType)
contentType - public void setAskContentType(String contentType)
contentType - public void setModelContentType(String contentType)
contentType - public static String defaultSelectHeader()
public static String defaultAskHeader()
public static String defaultConstructHeader()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||