Interface QueryResultWriter
- All Superinterfaces:
QueryResultHandler
- All Known Subinterfaces:
BooleanQueryResultWriter, TupleQueryResultWriter
- All Known Implementing Classes:
AbstractQueryResultWriter, BinaryQueryResultWriter, BooleanTextWriter, ConsoleQueryResultWriter, SPARQLBooleanJSONWriter, SPARQLBooleanXMLWriter, SPARQLResultsCSVWriter, SPARQLResultsJSONWriter, SPARQLResultsODSWriter, SPARQLResultsTSVWriter, SPARQLResultsXLSXWriter, SPARQLResultsXMLWriter, SPARQLStarResultsJSONWriter, SPARQLStarResultsTSVWriter, SPARQLStarResultsXMLWriter, WorkbenchTupleResultWriter
The base interface for writers of query results sets and boolean results.
- Author:
- Peter Ansell
-
Method Summary
Modifier and TypeMethodDescriptionvoidIndicates the end of the header.Gets the query result format that this writer uses.Collection<RioSetting<?>> Retrieves the current writer configuration as a single object.voidhandleNamespace(String prefix, String uri) Handles a namespace prefix declaration.voidhandleStylesheet(String stylesheetUrl) Handles a stylesheet URL.voidsetWriterConfig(WriterConfig config) Sets all supplied writer configuration options.voidIndicates the start of the document.voidIndicates the start of the header.Methods inherited from interface QueryResultHandler
endQueryResult, handleBoolean, handleLinks, handleSolution, startQueryResultModifier and TypeMethodDescriptionvoidIndicates the end of a sequence of solutions.voidhandleBoolean(boolean value) Handles the specified boolean value.voidhandleLinks(List<String> linkUrls) Handles the links elements which are present in SPARQL Results JSON and SPARQL Results XML documents in the header.voidhandleSolution(BindingSet bindingSet) Handles a solution.voidstartQueryResult(List<String> bindingNames) Indicates the start of a sequence of Solutions.
-
Method Details
-
getQueryResultFormat
QueryResultFormat getQueryResultFormat()Gets the query result format that this writer uses. -
handleNamespace
Handles a namespace prefix declaration. If this is called, it should be called beforestartDocument()to ensure that it has a document wide effect.NOTE: If the format does not support namespaces, it must silently ignore calls to this method.
- Parameters:
prefix- The prefix to use for the namespaceuri- The full URI that is to be represented by the prefix.- Throws:
QueryResultHandlerException
-
startDocument
Indicates the start of the document.- Throws:
QueryResultHandlerException- If there was an error starting the writing of the results.
-
handleStylesheet
Handles a stylesheet URL. If this is called, it must be called afterstartDocument()and beforestartHeader().NOTE: If the format does not support stylesheets, it must silently ignore calls to this method.
- Parameters:
stylesheetUrl- The URL of the stylesheet to be used to style the results.- Throws:
QueryResultHandlerException- If there was an error handling the stylesheet. This error is not thrown in cases where stylesheets are not supported.
-
startHeader
Indicates the start of the header.- Throws:
QueryResultHandlerException- If there was an error writing the start of the header.- See Also:
-
endHeader
Indicates the end of the header. This must be called afterstartHeader()and before any calls toQueryResultHandler.handleSolution(BindingSet).- Throws:
QueryResultHandlerException- If there was an error writing the end of the header.
-
setWriterConfig
Sets all supplied writer configuration options.- Parameters:
config- a writer configuration object.
-
getWriterConfig
WriterConfig getWriterConfig()Retrieves the current writer configuration as a single object.- Returns:
- a writer configuration object representing the current configuration of the writer.
-
getSupportedSettings
Collection<RioSetting<?>> getSupportedSettings()- Returns:
- A collection of
RioSettings that are supported by thisQueryResultWriter.
-