Package org.eclipse.rdf4j.query.resultio
Class AbstractQueryResultWriter
java.lang.Object
org.eclipse.rdf4j.query.resultio.AbstractQueryResultWriter
- All Implemented Interfaces:
Sink,QueryResultHandler,QueryResultWriter
- Direct Known Subclasses:
BinaryQueryResultWriter,BooleanTextWriter,ConsoleQueryResultWriter,SPARQLBooleanJSONWriter,SPARQLBooleanXMLWriter,SPARQLResultsCSVWriter,SPARQLResultsJSONWriter,SPARQLResultsTSVWriter,SPARQLResultsXMLWriter
Base class for
QueryResultWriters offering common functionality for query result writers.- Author:
- Peter Ansell
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet theFileFormatthis sink uses.Collection<RioSetting<?>>Retrieves the current writer configuration as a single object.voidhandleSolution(BindingSet bindingSet) Handles a solution.protected voidhandleSolutionImpl(BindingSet bindings) Extending classes must implement this method instead of overridinghandleSolution(BindingSet)in order to benefit from automatic handling of RDF-star encoding.voidsetWriterConfig(WriterConfig config) Sets all supplied writer configuration options.voidstartQueryResult(List<String> bindingNames) Indicates the start of a sequence of Solutions.protected booleanMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.rdf4j.query.QueryResultHandler
endQueryResult, handleBoolean, handleLinksMethods inherited from interface org.eclipse.rdf4j.query.resultio.QueryResultWriter
endHeader, getQueryResultFormat, handleNamespace, handleStylesheet, startDocument, startHeaderMethods inherited from interface org.eclipse.rdf4j.common.io.Sink
acceptsFileFormat
-
Constructor Details
-
AbstractQueryResultWriter
public AbstractQueryResultWriter()
-
-
Method Details
-
setWriterConfig
Description copied from interface:QueryResultWriterSets all supplied writer configuration options.- Specified by:
setWriterConfigin interfaceQueryResultWriter- Parameters:
config- a writer configuration object.
-
getWriterConfig
Description copied from interface:QueryResultWriterRetrieves the current writer configuration as a single object.- Specified by:
getWriterConfigin interfaceQueryResultWriter- Returns:
- a writer configuration object representing the current configuration of the writer.
-
getSupportedSettings
- Specified by:
getSupportedSettingsin interfaceQueryResultWriter- Returns:
- A collection of
RioSettings that are supported by thisQueryResultWriter.
-
getFileFormat
Description copied from interface:SinkGet theFileFormatthis sink uses.- Specified by:
getFileFormatin interfaceSink- Returns:
- a
FileFormat. May not benull.
-
startQueryResult
Description copied from interface:QueryResultHandlerIndicates the start of a sequence of Solutions. The supplied bindingNames are an indication of the values that are in the Solutions. For example, a SPARQL query like select ?X ?Y where { ?X ?P ?Y } will have binding names X and Y.- Specified by:
startQueryResultin interfaceQueryResultHandler- Parameters:
bindingNames- An ordered set of binding names.- Throws:
TupleQueryResultHandlerException- If there was an error during the starting of the query result handler. This exception may be thrown if theQueryResultHandler.handleBoolean(boolean)method was called before this method and the handler cannot process both boolean and tuple results simultaneously.
-
handleSolution
Description copied from interface:QueryResultHandlerHandles a solution.- Specified by:
handleSolutionin interfaceQueryResultHandler- Parameters:
bindingSet- A single set of tuple results, with binding names bound to values. Each of the binding names in the solution must have previously been registered with theQueryResultHandler.startQueryResult(List)method.- Throws:
TupleQueryResultHandlerException- If there was an error during the handling of the query solution. This exception may be thrown if theQueryResultHandler.handleBoolean(boolean)method was called before this method and the handler cannot process both boolean and tuple results simultaneously.
-
handleSolutionImpl
Extending classes must implement this method instead of overridinghandleSolution(BindingSet)in order to benefit from automatic handling of RDF-star encoding.- Parameters:
bindings- the solution to handle- Throws:
TupleQueryResultHandlerException- Since:
- 3.2.0
-
xsdStringToPlainLiteral
protected boolean xsdStringToPlainLiteral()
-