Class SPARQLStarResultsJSONWriter
- java.lang.Object
-
- org.eclipse.rdf4j.query.resultio.AbstractQueryResultWriter
-
- org.eclipse.rdf4j.query.resultio.sparqljson.SPARQLResultsJSONWriter
-
- org.eclipse.rdf4j.query.resultio.sparqljson.SPARQLStarResultsJSONWriter
-
- All Implemented Interfaces:
org.eclipse.rdf4j.common.io.CharSink,org.eclipse.rdf4j.common.io.Sink,QueryResultHandler,QueryResultWriter,TupleQueryResultWriter,TupleQueryResultHandler
- Direct Known Subclasses:
SPARQLStarResultsJSONWriter
public class SPARQLStarResultsJSONWriter extends SPARQLResultsJSONWriter
Writer for SPARQL-star JSON results. This is equivalent to the SPARQL JSON writer with the addition of support for RDF-star triples. SeeSPARQLStarResultsJSONConstantsfor a description of the RDF-star extension.- Author:
- Pavel Mihaylov
-
-
Field Summary
Fields Modifier and Type Field Description protected booleandocumentOpenprotected booleanfirstTupleWrittenprotected booleanheaderCompleteprotected booleanheaderOpenprotected com.fasterxml.jackson.core.JsonGeneratorjgprotected booleanlinksFoundprotected booleantupleVariablesFound
-
Constructor Summary
Constructors Constructor Description SPARQLStarResultsJSONWriter(OutputStream out)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanacceptsFileFormat(org.eclipse.rdf4j.common.lang.FileFormat format)protected voidendDocument()voidendHeader()voidendQueryResult()TupleQueryResultFormatgetQueryResultFormat()Collection<org.eclipse.rdf4j.rio.RioSetting<?>>getSupportedSettings()TupleQueryResultFormatgetTupleQueryResultFormat()WritergetWriter()voidhandleBoolean(boolean value)voidhandleLinks(List<String> linkUrls)voidhandleNamespace(String prefix, String uri)protected voidhandleSolutionImpl(BindingSet bindingSet)voidhandleStylesheet(String stylesheetUrl)voidstartDocument()voidstartHeader()voidstartQueryResult(List<String> columnHeaders)-
Methods inherited from class org.eclipse.rdf4j.query.resultio.sparqljson.SPARQLResultsJSONWriter
writeValue
-
Methods inherited from class org.eclipse.rdf4j.query.resultio.AbstractQueryResultWriter
getFileFormat, getWriterConfig, handleSolution, setWriterConfig, xsdStringToPlainLiteral
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.rdf4j.query.QueryResultHandler
endQueryResult, handleBoolean, handleLinks, handleSolution, startQueryResult
-
Methods inherited from interface org.eclipse.rdf4j.query.resultio.QueryResultWriter
endHeader, getSupportedSettings, getWriterConfig, handleNamespace, handleStylesheet, setWriterConfig, startDocument, startHeader
-
-
-
-
Field Detail
-
firstTupleWritten
protected boolean firstTupleWritten
-
documentOpen
protected boolean documentOpen
-
headerOpen
protected boolean headerOpen
-
headerComplete
protected boolean headerComplete
-
tupleVariablesFound
protected boolean tupleVariablesFound
-
linksFound
protected boolean linksFound
-
jg
protected final com.fasterxml.jackson.core.JsonGenerator jg
-
-
Constructor Detail
-
SPARQLStarResultsJSONWriter
public SPARQLStarResultsJSONWriter(OutputStream out)
-
-
Method Detail
-
getTupleQueryResultFormat
public TupleQueryResultFormat getTupleQueryResultFormat()
- Specified by:
getTupleQueryResultFormatin interfaceTupleQueryResultWriter- Overrides:
getTupleQueryResultFormatin classSPARQLResultsJSONWriter
-
getQueryResultFormat
public TupleQueryResultFormat getQueryResultFormat()
- Specified by:
getQueryResultFormatin interfaceQueryResultWriter- Overrides:
getQueryResultFormatin classSPARQLResultsJSONWriter
-
acceptsFileFormat
public boolean acceptsFileFormat(org.eclipse.rdf4j.common.lang.FileFormat format)
-
getWriter
public final Writer getWriter()
- Specified by:
getWriterin interfaceorg.eclipse.rdf4j.common.io.CharSink
-
endHeader
public void endHeader() throws QueryResultHandlerException- Specified by:
endHeaderin interfaceQueryResultWriter- Throws:
QueryResultHandlerException
-
startQueryResult
public void startQueryResult(List<String> columnHeaders) throws TupleQueryResultHandlerException
- Specified by:
startQueryResultin interfaceQueryResultHandler- Overrides:
startQueryResultin classAbstractQueryResultWriter- Throws:
TupleQueryResultHandlerException
-
handleSolutionImpl
protected void handleSolutionImpl(BindingSet bindingSet) throws TupleQueryResultHandlerException
- Overrides:
handleSolutionImplin classAbstractQueryResultWriter- Throws:
TupleQueryResultHandlerException
-
endQueryResult
public void endQueryResult() throws TupleQueryResultHandlerException- Specified by:
endQueryResultin interfaceQueryResultHandler- Throws:
TupleQueryResultHandlerException
-
startDocument
public void startDocument() throws QueryResultHandlerException- Specified by:
startDocumentin interfaceQueryResultWriter- Throws:
QueryResultHandlerException
-
handleStylesheet
public void handleStylesheet(String stylesheetUrl) throws QueryResultHandlerException
- Specified by:
handleStylesheetin interfaceQueryResultWriter- Throws:
QueryResultHandlerException
-
startHeader
public void startHeader() throws QueryResultHandlerException- Specified by:
startHeaderin interfaceQueryResultWriter- Throws:
QueryResultHandlerException
-
handleLinks
public void handleLinks(List<String> linkUrls) throws QueryResultHandlerException
- Specified by:
handleLinksin interfaceQueryResultHandler- Throws:
QueryResultHandlerException
-
handleBoolean
public void handleBoolean(boolean value) throws QueryResultHandlerException- Specified by:
handleBooleanin interfaceQueryResultHandler- Throws:
QueryResultHandlerException
-
getSupportedSettings
public final Collection<org.eclipse.rdf4j.rio.RioSetting<?>> getSupportedSettings()
- Specified by:
getSupportedSettingsin interfaceQueryResultWriter- Overrides:
getSupportedSettingsin classAbstractQueryResultWriter
-
handleNamespace
public void handleNamespace(String prefix, String uri) throws QueryResultHandlerException
- Specified by:
handleNamespacein interfaceQueryResultWriter- Throws:
QueryResultHandlerException
-
endDocument
protected void endDocument() throws IOException- Throws:
IOException
-
-