Package com.complexible.stardog.api
Interface ReadQuery<T>
-
- All Superinterfaces:
Query<T>
- All Known Subinterfaces:
BooleanQuery,GraphQuery,PathQuery,SelectPlanQuery,SelectQuery
public interface ReadQuery<T> extends Query<T>
A read-only query, ie a select, construct, graph or ask query.
- Since:
- 2.0
- Version:
- 6.0
- Author:
- Michael Grove
-
-
Field Summary
Fields Modifier and Type Field Description static longNO_LIMITConstant value used to specify that a query should not have any limit imposed on the number of results it returns.static longNO_OFFSETConstant value used to specify that a query has no offset in its query results-
Fields inherited from interface com.complexible.stardog.api.Query
NO_ID, NO_TIMEOUT
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ReadQuery<T>dataset(Dataset theDataset)Specify the dataset this query will be executed against.java.io.InputStreamexecute(FileFormat theFormat)Execute a query and return an input stream where the query results are serialized in the given file format.default longlimit()ReadQuery<T>limit(long theLimit)Set the maximum number of results that can be returned by this query.default longoffset()ReadQuery<T>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 Detail
-
NO_LIMIT
static final long NO_LIMIT
Constant value used to specify that a query should not have any limit imposed on the number of results it returns.- See Also:
- Constant Field Values
-
NO_OFFSET
static final long NO_OFFSET
Constant value used to specify that a query has no offset in its query results- See Also:
- Constant Field Values
-
-
Method Detail
-
execute
java.io.InputStream execute(FileFormat theFormat) throws StardogException
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
ReadQuery<T> limit(long theLimit)
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
ReadQuery<T> offset(long theOffset)
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
ReadQuery<T> dataset(Dataset theDataset)
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.
-
-