public class QueryExecutionBase extends Object implements QueryExecution
Constructor and Description |
---|
QueryExecutionBase(Query query,
Dataset dataset,
Context context,
QueryEngineFactory qeFactory) |
Modifier and Type | Method and Description |
---|---|
void |
abort()
Stop in mid execution.
|
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.
|
Plan |
getPlan() |
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
|
void |
setFileManager(FileManager fm)
Set the FileManger that might be used to load files.
|
void |
setInitialBinding(QuerySolution startSolution)
Set the initial association of variables and values.
|
void |
setInitialBindings(ResultSet table) |
void |
setTimeout(long timeout)
Set time, in milliseconds
|
void |
setTimeout(long timeout1,
long timeout2)
Set time, in milliseconds
|
void |
setTimeout(long timeout,
TimeUnit timeUnit)
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.
|
static Context |
setupContext(Context context,
DatasetGraph dataset) |
public QueryExecutionBase(Query query, Dataset dataset, Context context, QueryEngineFactory qeFactory)
public static Context setupContext(Context context, DatasetGraph dataset)
public void close()
QueryExecution
close
in interface QueryExecution
public void abort()
QueryExecution
abort
in interface QueryExecution
public ResultSet execSelect()
QueryExecution
Important: 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 QueryExecution
public Model execConstruct()
QueryExecution
execConstruct
in interface QueryExecution
public Model execConstruct(Model model)
QueryExecution
execConstruct
in interface QueryExecution
public Iterator<Triple> execConstructTriples()
QueryExecution
Triple
.
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 QueryExecution
public Model execDescribe()
QueryExecution
execDescribe
in interface QueryExecution
public Model execDescribe(Model model)
QueryExecution
execDescribe
in interface QueryExecution
public Iterator<Triple> execDescribeTriples()
QueryExecution
Triple
.
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 QueryExecution
public boolean execAsk()
QueryExecution
execAsk
in interface QueryExecution
public void setTimeout(long timeout, TimeUnit timeUnit)
QueryExecution
setTimeout
in interface QueryExecution
public void setTimeout(long timeout)
QueryExecution
setTimeout
in interface QueryExecution
QueryExecution.setTimeout(long, TimeUnit)
public void setTimeout(long timeout1, TimeUnit timeUnit1, long timeout2, TimeUnit timeUnit2)
QueryExecution
setTimeout
in interface QueryExecution
public void setTimeout(long timeout1, long timeout2)
QueryExecution
setTimeout
in interface QueryExecution
QueryExecution.setTimeout(long, TimeUnit, long, TimeUnit)
public long getTimeout1()
QueryExecution
getTimeout1
in interface QueryExecution
public long getTimeout2()
QueryExecution
getTimeout2
in interface QueryExecution
public Plan getPlan()
public Context getContext()
QueryExecution
getContext
in interface QueryExecution
public Dataset getDataset()
QueryExecution
getDataset
in interface QueryExecution
public Query getQuery()
QueryExecution
getQuery
in interface QueryExecution
public void setFileManager(FileManager fm)
QueryExecution
setFileManager
in interface QueryExecution
public void setInitialBinding(QuerySolution startSolution)
QueryExecution
setInitialBinding
in interface QueryExecution
public void setInitialBindings(ResultSet table)
Licenced under the Apache License, Version 2.0