public class ResultSetFormatter extends Object
Modifier and Type | Method and Description |
---|---|
static Resource |
asRDF(Model model,
boolean booleanResult)
Encode the boolean as RDF in the model provided.
|
static Resource |
asRDF(Model model,
ResultSet resultSet)
Encode the result set as RDF in the model provided.
|
static String |
asText(ResultSet qresults)
Return a string that has the result set serilized as a text table
|
static String |
asText(ResultSet qresults,
Prologue prologue)
Return a string that has the result set serilized as a text table
|
static String |
asXMLString(boolean booleanResult)
Return a string that has the result set serilized as XML (not RDF)
|
static String |
asXMLString(boolean booleanResult,
String stylesheet)
Return a string that has the result set serilized as XML (not RDF)
|
static String |
asXMLString(ResultSet qresults)
Return a string that has the result set serilized as XML (not RDF)
|
static String |
asXMLString(ResultSet qresults,
String stylesheet)
Return a string that has the result set serilized as XML (not RDF)
with a style sheet directive inserted into the XML.
|
static int |
consume(ResultSet resultSet)
This operation faithfully walks the results but does nothing with them.
|
static void |
out(boolean answer)
Output an ASK answer
|
static void |
out(OutputStream out,
boolean answer)
Output an ASK answer
|
static void |
out(OutputStream out,
ResultSet qresults)
Output a result set in a text format.
|
static void |
out(OutputStream out,
ResultSet qresults,
PrefixMapping pmap)
Output a result set in a text format.
|
static void |
out(OutputStream out,
ResultSet qresults,
Prologue prologue)
Output a result set in a text format.
|
static void |
out(ResultSet qresults)
Output a result set in a text format.
|
static void |
out(ResultSet qresults,
PrefixMapping pmap)
Output a result set in a text format.
|
static void |
out(ResultSet qresults,
Prologue prologue)
Output a result set in a text format.
|
static void |
out(ResultSet qresults,
Query query)
Output a result set in a text format.
|
static void |
output(OutputStream outStream,
ResultSet resultSet,
ResultsFormat rFmt)
Output a ResultSet in some format.
|
static void |
output(ResultSet resultSet,
ResultsFormat rFmt)
Output a ResultSet in some format.
|
static void |
outputAsBIO(OutputStream out,
ResultSet results)
Output a result set in BIO format
|
static void |
outputAsCSV(boolean booleanResult)
Output a boolean result in CSV format
|
static void |
outputAsCSV(OutputStream outStream,
boolean booleanResult)
Output a boolean result in in CSV format
|
static void |
outputAsCSV(OutputStream outStream,
ResultSet resultSet)
Output a result set in CSV format
|
static void |
outputAsCSV(ResultSet resultSet)
Output a result set in CSV format
|
static void |
outputAsJSON(boolean booleanResult)
Output a result set in the JSON format
Format: Serializing SPARQL Query Results in JSON
JSON: http://json.org/
|
static void |
outputAsJSON(OutputStream outStream,
boolean booleanResult)
Output a result set in the JSON format
Format: Serializing SPARQL Query Results in JSON
JSON: http://json.org/
|
static void |
outputAsJSON(OutputStream outStream,
ResultSet resultSet)
Output a result set in the JSON format
Format: Serializing SPARQL Query Results in JSON
JSON: http://json.org/
|
static void |
outputAsJSON(ResultSet resultSet)
Output a result set in the JSON format
Format: Serializing SPARQL Query Results in JSON
JSON: http://json.org/
|
static void |
outputAsRDF(OutputStream outStream,
String format,
boolean booleanResult)
Write out an RDF model that encodes a boolean result
|
static void |
outputAsRDF(OutputStream outStream,
String format,
ResultSet resultSet)
Write out an RDF model that encodes the result set
|
static void |
outputAsRDF(String format,
boolean booleanResult)
Write out an RDF model that encodes a boolean result
|
static void |
outputAsRDF(String format,
ResultSet resultSet)
Write out an RDF model that encodes the result set
|
static void |
outputAsSSE(boolean booleanResult)
Output a boolean result in the SSE format
Format: SSE
|
static void |
outputAsSSE(OutputStream outStream,
boolean booleanResult)
Output a boolean result in the SSE format
Format: SSE
|
static void |
outputAsSSE(OutputStream outStream,
ResultSet resultSet)
Output a result set in the SSE format
Format: SSE
|
static void |
outputAsSSE(OutputStream outStream,
ResultSet resultSet,
Prologue prologue)
Output a result set in the SSE format
Format: SSE
|
static void |
outputAsSSE(ResultSet resultSet)
Output a result set in the SSE format
Format: SSE
|
static void |
outputAsSSE(ResultSet resultSet,
Prologue prologue)
Output a result set in the SSE format
Format: SSE
|
static void |
outputAsTSV(boolean booleanResult)
Output a boolean result in TSV (tab separated values) format
|
static void |
outputAsTSV(OutputStream outStream,
boolean booleanResult)
Output a boolean result in in TSV format
|
static void |
outputAsTSV(OutputStream outStream,
ResultSet resultSet)
Output a result set in TSV format
|
static void |
outputAsTSV(ResultSet resultSet)
Output a result set in TSV format
|
static void |
outputAsXML(boolean booleanResult)
Output a boolean result in the XML format
|
static void |
outputAsXML(boolean booleanResult,
String stylesheet)
Output a boolean result in the XML format
|
static void |
outputAsXML(OutputStream outStream,
boolean booleanResult)
Output a boolean result in the XML format
|
static void |
outputAsXML(OutputStream outStream,
boolean booleanResult,
String stylesheet)
Output a boolean result in the XML format
|
static void |
outputAsXML(OutputStream outStream,
ResultSet qresults)
Output a result set in the XML format
|
static void |
outputAsXML(OutputStream outStream,
ResultSet qresults,
String stylesheet)
Output a result set in the XML format, inserting a style sheet in the XMl output
|
static void |
outputAsXML(ResultSet qresults)
Output a result set in the XML format
|
static void |
outputAsXML(ResultSet qresults,
String stylesheet)
Output a result set in the XML format, inserting a style sheet in the XMl output
|
static List<QuerySolution> |
toList(ResultSet resultSet)
Turn the result set into a java.util.List
|
static Model |
toModel(boolean booleanResult)
Encode a boolean result set as RDF.
|
static Model |
toModel(ResultSet resultSet)
Encode the result set as RDF.
|
public static void out(ResultSet qresults)
qresults
- result setpublic static void out(OutputStream out, ResultSet qresults)
out
- OutputStreamqresults
- result setpublic static void out(ResultSet qresults, Query query)
qresults
- result setquery
- May be used to abbreviate URIspublic static void out(ResultSet qresults, Prologue prologue)
qresults
- result setprologue
- May be used to abbreviate URIspublic static void out(ResultSet qresults, PrefixMapping pmap)
qresults
- result setpmap
- Prefix mapping for abbreviating URIs.public static void out(OutputStream out, ResultSet qresults, PrefixMapping pmap)
out
- OutputStreamqresults
- result setpmap
- Prefix mapping for abbreviating URIs.public static void out(OutputStream out, ResultSet qresults, Prologue prologue)
out
- OutputStreamqresults
- result setprologue
- Prologue, used to abbreviate IRIspublic static void out(boolean answer)
answer
- The boolean answerpublic static void out(OutputStream out, boolean answer)
out
- OutputStreamanswer
- The boolean answerpublic static String asText(ResultSet qresults)
qresults
- result setpublic static String asText(ResultSet qresults, Prologue prologue)
qresults
- result setprologue
- Prologue, used to abbreviate IRIspublic static int consume(ResultSet resultSet)
public static List<QuerySolution> toList(ResultSet resultSet)
resultSet
- The result setpublic static Model toModel(ResultSet resultSet)
resultSet
- public static Model toModel(boolean booleanResult)
booleanResult
- public static Resource asRDF(Model model, ResultSet resultSet)
model
- The place where to put the RDF.resultSet
- public static Resource asRDF(Model model, boolean booleanResult)
model
- The place where to put the RDF.booleanResult
- public static void output(ResultSet resultSet, ResultsFormat rFmt)
resultSet
- Result setrFmt
- A format to encode the result set inpublic static void output(OutputStream outStream, ResultSet resultSet, ResultsFormat rFmt)
outStream
- OutputresultSet
- Result setrFmt
- A format to encode the result set inpublic static void outputAsRDF(String format, ResultSet resultSet)
format
- Name of RDF format (names as Jena writers)resultSet
- The result set to encode in RDFpublic static void outputAsRDF(OutputStream outStream, String format, ResultSet resultSet)
outStream
- Outputformat
- Name of RDF format (names as Jena writers)resultSet
- The result set to encode in RDFpublic static void outputAsRDF(String format, boolean booleanResult)
format
- Name of RDF format (names as Jena writers)booleanResult
- The boolean result to encode in RDFpublic static void outputAsRDF(OutputStream outStream, String format, boolean booleanResult)
outStream
- Outputformat
- Name of RDF format (names as Jena writers)booleanResult
- The boolean result to encode in RDFpublic static void outputAsXML(ResultSet qresults)
qresults
- result setpublic static void outputAsXML(OutputStream outStream, ResultSet qresults)
outStream
- output streamqresults
- result setpublic static void outputAsXML(ResultSet qresults, String stylesheet)
qresults
- result setstylesheet
- The URL of the stylsheetpublic static void outputAsXML(OutputStream outStream, ResultSet qresults, String stylesheet)
outStream
- output streamqresults
- result setstylesheet
- The URL of the stylsheetpublic static void outputAsXML(boolean booleanResult)
booleanResult
- The boolean result to encodepublic static void outputAsXML(OutputStream outStream, boolean booleanResult)
outStream
- output streambooleanResult
- The boolean result to encodepublic static void outputAsXML(boolean booleanResult, String stylesheet)
booleanResult
- stylesheet
- The URL of the stylesheetpublic static void outputAsXML(OutputStream outStream, boolean booleanResult, String stylesheet)
outStream
- output streambooleanResult
- stylesheet
- The URL of the stylesheetpublic static String asXMLString(ResultSet qresults)
qresults
- result setpublic static String asXMLString(ResultSet qresults, String stylesheet)
qresults
- result setstylesheet
- public static String asXMLString(boolean booleanResult)
booleanResult
- The boolean result to encodepublic static String asXMLString(boolean booleanResult, String stylesheet)
booleanResult
- The boolean result to encodestylesheet
- public static void outputAsJSON(ResultSet resultSet)
resultSet
- result setpublic static void outputAsJSON(OutputStream outStream, ResultSet resultSet)
outStream
- output streamresultSet
- result setpublic static void outputAsJSON(boolean booleanResult)
booleanResult
- The boolean result to encodepublic static void outputAsJSON(OutputStream outStream, boolean booleanResult)
outStream
- output streambooleanResult
- The boolean result to encodepublic static void outputAsSSE(boolean booleanResult)
booleanResult
- The boolean result to encodepublic static void outputAsSSE(OutputStream outStream, boolean booleanResult)
outStream
- output streambooleanResult
- The boolean result to encodepublic static void outputAsSSE(ResultSet resultSet)
resultSet
- result setpublic static void outputAsSSE(ResultSet resultSet, Prologue prologue)
resultSet
- result setpublic static void outputAsSSE(OutputStream outStream, ResultSet resultSet)
outStream
- The output streamresultSet
- The result setpublic static void outputAsSSE(OutputStream outStream, ResultSet resultSet, Prologue prologue)
outStream
- output streamresultSet
- result setprologue
- public static void outputAsCSV(boolean booleanResult)
booleanResult
- The boolean result to encodepublic static void outputAsCSV(OutputStream outStream, boolean booleanResult)
outStream
- output streambooleanResult
- The boolean result to encodepublic static void outputAsCSV(ResultSet resultSet)
resultSet
- result setpublic static void outputAsCSV(OutputStream outStream, ResultSet resultSet)
outStream
- The output streamresultSet
- The result setpublic static void outputAsTSV(boolean booleanResult)
booleanResult
- The boolean result to encodepublic static void outputAsTSV(OutputStream outStream, boolean booleanResult)
outStream
- output streambooleanResult
- The boolean result to encodepublic static void outputAsTSV(ResultSet resultSet)
resultSet
- result setpublic static void outputAsTSV(OutputStream outStream, ResultSet resultSet)
outStream
- The output streamresultSet
- The result setpublic static void outputAsBIO(OutputStream out, ResultSet results)
Licenced under the Apache License, Version 2.0