public class SPARQLResultsTSVWriter extends AbstractQueryResultWriter implements TupleQueryResultWriter, CharSink
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
tupleVariablesFound |
protected Writer |
writer |
| Constructor and Description |
|---|
SPARQLResultsTSVWriter(OutputStream out) |
SPARQLResultsTSVWriter(Writer writer) |
| Modifier and Type | Method and Description |
|---|---|
void |
endHeader()
Indicates the end of the header.
|
void |
endQueryResult()
Indicates the end of a sequence of solutions.
|
TupleQueryResultFormat |
getQueryResultFormat()
Gets the query result format that this writer uses.
|
TupleQueryResultFormat |
getTupleQueryResultFormat()
Gets the query result format that this writer uses.
|
Writer |
getWriter()
|
void |
handleBoolean(boolean value)
Handles the specified boolean value.
|
void |
handleLinks(List<String> linkUrls)
Handles the links elements which are present in SPARQL Results JSON and SPARQL Results XML documents in the
header.
|
void |
handleNamespace(String prefix,
String uri)
Handles a namespace prefix declaration.
|
protected void |
handleSolutionImpl(BindingSet bindingSet)
Extending classes must implement this method instead of overriding
AbstractQueryResultWriter.handleSolution(BindingSet) in order
to benefit from automatic handling of RDF* encoding. |
void |
handleStylesheet(String stylesheetUrl)
Handles a stylesheet URL.
|
void |
startDocument()
Indicates the start of the document.
|
void |
startHeader()
Indicates the start of the header.
|
void |
startQueryResult(List<String> bindingNames)
Indicates the start of a sequence of Solutions.
|
protected void |
writeBNode(BNode bNode) |
protected void |
writeResource(Resource res) |
protected void |
writeURI(IRI uri) |
protected void |
writeValue(Value val) |
getFileFormat, getSupportedSettings, getWriterConfig, handleSolution, setWriterConfig, xsdStringToPlainLiteralclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetSupportedSettings, getWriterConfig, setWriterConfighandleSolutionacceptsFileFormat, getFileFormatprotected Writer writer
protected boolean tupleVariablesFound
public SPARQLResultsTSVWriter(OutputStream out)
out - public SPARQLResultsTSVWriter(Writer writer)
public void startQueryResult(List<String> bindingNames) throws TupleQueryResultHandlerException
QueryResultHandlerstartQueryResult in interface QueryResultHandlerstartQueryResult in class AbstractQueryResultWriterbindingNames - An ordered set of binding names.TupleQueryResultHandlerException - If there was an error during the starting of the query result handler.
This exception may be thrown if the QueryResultHandler.handleBoolean(boolean)
method was called before this method and the handler cannot process both
boolean and tuple results simultaneously.public void endQueryResult()
throws TupleQueryResultHandlerException
QueryResultHandlerendQueryResult in interface QueryResultHandlerTupleQueryResultHandlerException - If there was an error during the ending of the query result handler.
This exception may be thrown if the QueryResultHandler.handleBoolean(boolean)
method was called before this method and the handler cannot process both
boolean and tuple results simultaneously.protected void handleSolutionImpl(BindingSet bindingSet) throws TupleQueryResultHandlerException
AbstractQueryResultWriterAbstractQueryResultWriter.handleSolution(BindingSet) in order
to benefit from automatic handling of RDF* encoding.handleSolutionImpl in class AbstractQueryResultWriterbindingSet - the solution to handleTupleQueryResultHandlerExceptionpublic TupleQueryResultFormat getTupleQueryResultFormat()
TupleQueryResultWritergetTupleQueryResultFormat in interface TupleQueryResultWriterpublic final TupleQueryResultFormat getQueryResultFormat()
QueryResultWritergetQueryResultFormat in interface QueryResultWriterprotected void writeValue(Value val) throws IOException
IOExceptionprotected void writeResource(Resource res) throws IOException
IOExceptionprotected void writeURI(IRI uri) throws IOException
IOExceptionprotected void writeBNode(BNode bNode) throws IOException
IOExceptionpublic void startDocument()
throws TupleQueryResultHandlerException
QueryResultWriterstartDocument in interface QueryResultWriterTupleQueryResultHandlerExceptionpublic void handleStylesheet(String stylesheetUrl) throws TupleQueryResultHandlerException
QueryResultWriterQueryResultWriter.startDocument() and before
QueryResultWriter.startHeader().
NOTE: If the format does not support stylesheets, it must silently ignore calls to this method.
handleStylesheet in interface QueryResultWriterstylesheetUrl - The URL of the stylesheet to be used to style the results.TupleQueryResultHandlerExceptionpublic void startHeader()
throws TupleQueryResultHandlerException
QueryResultWriterstartHeader in interface QueryResultWriterTupleQueryResultHandlerExceptionpublic void handleLinks(List<String> linkUrls) throws TupleQueryResultHandlerException
QueryResultHandlerNOTE: If the format does not support links, it must silently ignore a call to this method.
An accumulating handler should accumulate these links.
handleLinks in interface QueryResultHandlerlinkUrls - The URLs of the links to handle.TupleQueryResultHandlerExceptionpublic void endHeader()
throws TupleQueryResultHandlerException
QueryResultWriterQueryResultWriter.startHeader() and before any calls to
QueryResultHandler.handleSolution(org.eclipse.rdf4j.query.BindingSet).endHeader in interface QueryResultWriterTupleQueryResultHandlerExceptionpublic void handleBoolean(boolean value)
throws QueryResultHandlerException
QueryResultHandlerhandleBoolean in interface QueryResultHandlervalue - The boolean value to handle.QueryResultHandlerException - If there was an error during the handling of this value. This exception may
be thrown if the QueryResultHandler.startQueryResult(List),
QueryResultHandler.handleSolution(BindingSet) or QueryResultHandler.endQueryResult() methods
were called before this method was called, and the handler cannot process
both boolean and tuple results simultaneously.public void handleNamespace(String prefix, String uri) throws QueryResultHandlerException
QueryResultWriterQueryResultWriter.startDocument() 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.
handleNamespace in interface QueryResultWriterprefix - The prefix to use for the namespaceuri - The full URI that is to be represented by the prefix.QueryResultHandlerExceptionCopyright © 2015-2020 Eclipse Foundation. All Rights Reserved.