public class ResultSetFactory extends Object
Constructor and Description |
---|
ResultSetFactory() |
Modifier and Type | Method and Description |
---|---|
static ResultSetRewindable |
copyResults(ResultSet results)
Take a copy of a result set - the result set returns is an in-memory
copy.
|
static ResultSet |
create(QueryIterator queryIterator,
List<String> vars)
Build a result set from one of ARQ's lower level query iterator.
|
static ResultSet |
fromJSON(InputStream in)
Read from an input stream which is the format of the SPARQL result set
format in JSON.
|
static ResultSet |
fromRDF(Model model)
Turns an RDF model, with properties and classses from the result set
vocabulary, into a SPARQL result set.
|
static ResultSet |
fromSSE(InputStream in)
Read from an input stream which is the format of the SPARQL result set
format in SSE.
|
static ResultSet |
fromTSV(InputStream in)
Read from an input stream which is the format of the SPARQL result set
format in TSV.
|
static ResultSet |
fromXML(InputStream in)
Read XML which is the format of the SPARQL result set format.
|
static ResultSet |
fromXML(String str)
Read XML which is the format of the SPARQL result set format.
|
static ResultSet |
load(InputStream input,
ResultsFormat format)
Load a result set from input stream into a result set (memory backed).
|
static ResultSet |
load(String filenameOrURI)
Load a result set from file or URL into a result set (memory backed).
|
static ResultSet |
load(String filenameOrURI,
ResultsFormat format)
Load a result set from file or URL into a result set (memory backed).
|
static Model |
loadAsModel(Model model,
String filenameOrURI)
Load a result set (or any other model) from file or URL
|
static Model |
loadAsModel(Model model,
String filenameOrURI,
ResultsFormat format)
Load a result set (or any other model) from file or URL.
|
static Model |
loadAsModel(String filenameOrURI)
Load a result set (or any other model) from file or URL
|
static Model |
loadAsModel(String filenameOrURI,
ResultsFormat format)
Load a result set (or any other model) from file or URL
|
static ResultSetPeekable |
makePeekable(ResultSet resultSet)
Turns an existing result set into one with peeking capabilities
|
static ResultSet |
makeResults(Model model)
Turns an RDF model, with properties and classses from the result set
vocabulary, into a SPARQL result set.
|
static ResultSetRewindable |
makeRewindable(Model model)
Turns an RDF model, with properties and classses from the result set
vocabulary, into a SPARQL result set which is rewindable (has a
.reset()operation).
|
static ResultSetRewindable |
makeRewindable(ResultSet resultSet)
Turn an existing result set into a rewindable one.
|
static ResultSet |
makeSorted(ResultSet resultSet,
List<SortCondition> conditions)
Deprecated.
This will be removed.
Sort an existing result set. Experimental. The list of variables is a
list of names (strings), with "x" for ascending in variable "x" and "-x"
for descending in variable "x"
|
static SPARQLResult |
result(String filenameOrURI)
Read in any kind of result kind (result set, boolean, graph) Guess the
syntax based on filename/URL extension.
|
static SPARQLResult |
result(String filenameOrURI,
ResultsFormat format)
Read in any kind of result kind (result set, boolean, graph)
|
public static ResultSet load(String filenameOrURI)
filenameOrURI
- public static ResultSet load(String filenameOrURI, ResultsFormat format)
filenameOrURI
- format
- public static ResultSet load(InputStream input, ResultsFormat format)
input
- format
- public static Model loadAsModel(String filenameOrURI)
filenameOrURI
- public static Model loadAsModel(Model model, String filenameOrURI)
model
- Load into this model (returned)filenameOrURI
- public static Model loadAsModel(String filenameOrURI, ResultsFormat format)
filenameOrURI
- format
- public static Model loadAsModel(Model model, String filenameOrURI, ResultsFormat format)
model
- Load into this model (returned)filenameOrURI
- format
- public static SPARQLResult result(String filenameOrURI)
public static SPARQLResult result(String filenameOrURI, ResultsFormat format)
public static ResultSet fromXML(InputStream in)
in
- InputStreampublic static ResultSet fromXML(String str)
str
- String to processpublic static ResultSet fromRDF(Model model)
model
- public static ResultSet fromJSON(InputStream in)
in
- InputStreampublic static ResultSet fromTSV(InputStream in)
in
- InputStreampublic static ResultSet fromSSE(InputStream in)
in
- InputStreampublic static ResultSet makeResults(Model model)
model
- public static ResultSetRewindable makeRewindable(Model model)
model
- public static ResultSetRewindable makeRewindable(ResultSet resultSet)
resultSet
- public static ResultSetPeekable makePeekable(ResultSet resultSet)
Using the returned result set consumes the result set passed in, the underlying result set must be at the start in order to be made peeking. If you create such a result set you should avoid accessing the underlying result set directly as this may cause results to be missed or put the returned peekable result set into an invalid state.
Note that rewindable results may typically also be peekable so may be more broadly applicable if you can afford the cost of loading all the results into memory.resultSet
- Result set to wrap@Deprecated public static ResultSet makeSorted(ResultSet resultSet, List<SortCondition> conditions)
resultSet
- conditions
- public static ResultSetRewindable copyResults(ResultSet results)
results
- public static ResultSet create(QueryIterator queryIterator, List<String> vars)
queryIterator
- vars
- List of variables, by name, for the result setLicenced under the Apache License, Version 2.0