Package com.complexible.stardog.api
Interface ReadQuery<T>
- All Superinterfaces:
Query<T>
- All Known Subinterfaces:
BooleanQuery,GraphQuery,PathQuery,SelectPlanQuery,SelectQuery
A read-only query, ie a select, construct, graph or ask query.
- Since:
- 2.0
- Version:
- 6.0
- Author:
- Michael Grove
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longConstant value used to specify that a query should not have any limit imposed on the number of results it returns.static final longConstant value used to specify that a query has no offset in its query resultsFields inherited from interface com.complexible.stardog.api.Query
NO_ID, NO_TIMEOUT -
Method Summary
Modifier and TypeMethodDescriptionSpecify the dataset this query will be executed against.execute(FileFormat theFormat) Execute a query and return an input stream where the query results are serialized in the given file format.default longlimit()limit(long theLimit) Set the maximum number of results that can be returned by this query.default longoffset()offset(long theOffset) Set the offset of the query results.Methods inherited from interface com.complexible.stardog.api.Query
baseURI, dataset, execute, explain, explain, explain, getID, getSchema, hint, hints, id, isReasoningEnabled, parameter, parameter, parameter, parameter, parameter, parameter, parameter, parameter, parameter, parameter, parameter, parameter, parameter, parameters, queryString, reasoning, schema, timeout, timeout, toString
-
Field Details
-
NO_LIMIT
static final long NO_LIMITConstant value used to specify that a query should not have any limit imposed on the number of results it returns.- See Also:
-
NO_OFFSET
static final long NO_OFFSETConstant value used to specify that a query has no offset in its query results- See Also:
-
-
Method Details
-
execute
Execute a query and return an input stream where the query results are serialized in the given file format. This function is not supported for embedded connections.- Parameters:
theFormat- the result format- Returns:
- query result serialization
- Throws:
StardogException- if query execution fails
-
limit
default long limit() -
offset
default long offset() -
limit
Set the maximum number of results that can be returned by this query. Setting the limit on the query will override any limit specified in the original query string, however, setting the limit toNO_LIMITwill not remove the limit if it is specified in the query, but you can use it to remove a limit that has already been set if there was not a limit specified in the query originally.- Parameters:
theLimit- the new limit- Returns:
- this query
-
offset
Set the offset of the query results. Similar tolimit()this will override an offset in the query, and you can useNO_OFFSETto remove an offset specified on the query, but not in the query string.- Parameters:
theOffset- the offset- Returns:
- this query
-
dataset
Specify the dataset this query will be executed against. This defines the active graph for the query and will override anything specified within the query. UseDatasets.NO_DATASETremove the dataset.
-