public abstract class AGQuery extends AbstractQuery
Modifier and Type | Field and Description |
---|---|
static String |
RDFS_PLUS_PLUS
The default entailment regime to use when inferences are included.
|
static String |
RESTRICTION
An entailment regime that includes hasValue, someValuesFrom and
allValuesFrom reasoning in addition to RDFS++ entailment.
|
static String |
SPARQL_COVERAGE_PLANNER
The default query planner for SPARQL.
|
static String |
SPARQL_IDENTITY_PLANNER
A query planner for SPARQL that processes queries without doing
any reordering of clauses or optimization, useful if the user
knows the best order for processing the query.
|
Constructor and Description |
---|
AGQuery(AGRepositoryConnection con,
QueryLanguage ql,
String queryString,
String baseURI) |
Modifier and Type | Method and Description |
---|---|
String |
analyze()
Returns the query analysis for the query.
|
void |
download(File file)
Evaluates the query and saves the results to a file.
|
void |
download(File file,
String mimeType)
Evaluates the query and saves the results to a file.
|
void |
download(String file)
Evaluates the query and saves the results to a file.
|
void |
download(String file,
String mimeType)
Evaluates the query and saves the results to a file.
|
String |
getBaseURI()
Gets the baseURI for this query.
|
Binding[] |
getBindingsArray() |
String |
getEngine()
Deprecated.
internal use only
|
String |
getEntailmentRegime()
Gets the entailment regime being used when including inferences
with this query.
|
static String |
getFranzOptionPrefixString(String option,
String value)
Returns a String of the form "PREFIX franzOption_OPTION: <franz:VALUE> "
suitable for appending to a SPARQL query.
|
QueryLanguage |
getLanguage()
Gets the query language for this query.
|
int |
getLimit()
Gets the limit on the number of solutions for this query.
|
String |
getName()
Gets the savedName for the query.
|
int |
getOffset()
Gets the offset, the number of solutions to skip for this query.
|
String |
getPlanner()
Gets the query planner that processes the query.
|
String |
getQueryString()
Gets the query string for this query.
|
boolean |
isCheckVariables()
Gets the flag for checkVariables.
|
boolean |
isLoggingEnabled()
Gets the loggingEnabled setting for this query.
|
boolean |
isPrepared()
Gets the prepared flag for the query.
|
void |
setCheckVariables(boolean checkVariables)
A boolean that defaults to false, indicating whether an error
should be raised when a SPARQL query selects variables that
are not mentioned in the query body.
|
void |
setEngine(String engine)
Deprecated.
internal use only
|
void |
setEntailmentRegime(String entailmentRegime)
Sets the entailment regime to use when including inferences with this
query.
|
void |
setIncludeInferred(boolean includeInferred)
Determine whether evaluation results of this query should include inferred
statements (if any inferred statements are present in the repository).
|
void |
setLimit(int limit)
Sets the limit.
|
void |
setLoggingEnabled(boolean loggingEnabled)
Sets the loggingEnabled parameter for this query.
|
void |
setOffset(int offset)
Sets the offset.
|
void |
setPlanner(String planner)
Sets the query planner to use when processing the query.
|
void |
setPrepared(boolean prepared)
Sets the prepared flag for the query.
|
void |
setSaveName(String name)
Sets the name to use when saving this query with the
server's saved query service.
|
InputStream |
stream()
Evaluates the query and returns the result as an input stream.
|
InputStream |
stream(String mimeType)
Evaluates the query and returns the result as an input stream.
|
String |
toString() |
getMaxQueryTime, setMaxQueryTime
clearBindings, getBindings, getDataset, getIncludeInferred, getMaxExecutionTime, removeBinding, setBinding, setDataset, setMaxExecutionTime
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
clearBindings, getBindings, getDataset, getIncludeInferred, getMaxExecutionTime, removeBinding, setBinding, setDataset, setMaxExecutionTime
public static final String SPARQL_COVERAGE_PLANNER
public static final String SPARQL_IDENTITY_PLANNER
public static final String RDFS_PLUS_PLUS
public static final String RESTRICTION
public AGQuery(AGRepositoryConnection con, QueryLanguage ql, String queryString, String baseURI)
public static String getFranzOptionPrefixString(String option, String value) throws org.apache.commons.httpclient.URIException
option
- the name of a valid AllegroGraph SPARQL Query Optionvalue
- String value to be encoded as the value of the prefixOptionorg.apache.commons.httpclient.URIException
- if there is an error while encoding value
public void setIncludeInferred(boolean includeInferred)
setIncludeInferred
in interface Operation
setIncludeInferred
in class AbstractOperation
includeInferred
- indicates whether inferred statements should included in the
result.setEntailmentRegime(String)
public String getEntailmentRegime()
public void setEntailmentRegime(String entailmentRegime)
entailmentRegime
- indicates the entailment regime to use when reasoningRDFS_PLUS_PLUS
,
RESTRICTION
,
setIncludeInferred(boolean)
public QueryLanguage getLanguage()
public String getQueryString()
public boolean isLoggingEnabled()
public void setLoggingEnabled(boolean loggingEnabled)
Default is false.
loggingEnabled
- boolean indicating whether logging is enabledpublic String getBaseURI()
public String getPlanner()
public void setPlanner(String planner)
planner
- the planner namepublic String getEngine()
public void setEngine(String engine)
engine
- the name of the query engine to use for this querygetEngine()
public void setSaveName(String name)
name
- the saved namepublic String getName()
public boolean isPrepared()
public void setPrepared(boolean prepared)
prepared
- the prepared flagpublic void download(File file) throws QueryEvaluationException
Output format is determined by the server.
file
- Output path.QueryEvaluationException
- if there is an error while evaluating querypublic void download(String file) throws QueryEvaluationException
Output format is determined by the server.
file
- Output path.QueryEvaluationException
- if there is an error while evaluating querypublic void download(File file, String mimeType) throws QueryEvaluationException
file
- Output path.mimeType
- MIME type that will be requested from the server (i.e. output format).QueryEvaluationException
- if there is an error while evaluating querypublic void download(String file, String mimeType) throws QueryEvaluationException
file
- Output path.mimeType
- MIME type that will be requested from the server (i.e. output format).QueryEvaluationException
- if there is an error while evaluating querypublic InputStream stream(String mimeType) throws QueryEvaluationException
Note that it is important to close the returned stream, to avoid resource leaks.
mimeType
- MIME type that will be requested from the server (i.e. output format).QueryEvaluationException
- if there is an error while evaluating querypublic InputStream stream() throws QueryEvaluationException
The output format will be chosen by the server.
QueryEvaluationException
- if there is an error while evaluating querypublic String analyze() throws QueryEvaluationException
The query is not evaluated.
QueryEvaluationException
- if there is an error while evaluating querypublic boolean isCheckVariables()
public void setCheckVariables(boolean checkVariables)
checkVariables
- the checkVariables flagpublic Binding[] getBindingsArray()
public int getLimit()
public void setLimit(int limit)
By default, the value is -1, meaning no constraint is imposed.
limit
- the max number of solutions to collect for this querypublic int getOffset()
public void setOffset(int offset)
offset
- the number of solutions to skip for this query
By default, the value is -1, meaning no constraint is imposed.
Copyright © 2018 Franz Inc.. All rights reserved.