public class RDFJSONWriter extends AbstractRDFWriter implements RDFWriter, CharSink
RDFWriter implementation for the RDF/JSON formatnamespaceTable, statementConsumer| Constructor and Description |
|---|
RDFJSONWriter(OutputStream out,
RDFFormat actualFormat) |
RDFJSONWriter(Writer writer,
RDFFormat actualFormat) |
| Modifier and Type | Method and Description |
|---|---|
void |
consumeStatement(org.eclipse.rdf4j.model.Statement statement) |
void |
endRDF() |
RDFFormat |
getRDFFormat() |
Collection<RioSetting<?>> |
getSupportedSettings() |
Writer |
getWriter() |
void |
handleComment(String comment) |
void |
handleNamespace(String prefix,
String uri) |
static void |
modelToRdfJsonInternal(org.eclipse.rdf4j.model.Model graph,
WriterConfig writerConfig,
com.fasterxml.jackson.core.JsonGenerator jg) |
static String |
resourceToString(org.eclipse.rdf4j.model.Resource uriOrBnode)
Returns the correct syntax for a Resource, depending on whether it is a URI or a Blank Node (ie, BNode)
|
void |
startRDF() |
static void |
writeObject(org.eclipse.rdf4j.model.Value object,
Set<org.eclipse.rdf4j.model.Resource> contexts,
com.fasterxml.jackson.core.JsonGenerator jg)
Helper method to reduce complexity of the JSON serialisation algorithm Any null contexts will only be serialised
to JSON if there are also non-null contexts in the contexts array
|
checkWritingStarted, getFileFormat, getWriterConfig, handleStatement, isWritingStarted, set, setWriterConfigclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetWriterConfig, set, setWriterConfighandleStatementacceptsFileFormat, getFileFormatpublic RDFJSONWriter(OutputStream out, RDFFormat actualFormat)
public void startRDF()
throws RDFHandlerException
startRDF in interface RDFHandlerstartRDF in class AbstractRDFWriterRDFHandlerExceptionpublic void endRDF()
throws RDFHandlerException
endRDF in interface RDFHandlerRDFHandlerExceptionpublic RDFFormat getRDFFormat()
getRDFFormat in interface RDFWriterpublic Collection<RioSetting<?>> getSupportedSettings()
getSupportedSettings in interface RDFWritergetSupportedSettings in class AbstractRDFWriterpublic void handleComment(String comment) throws RDFHandlerException
handleComment in interface RDFHandlerRDFHandlerExceptionpublic void handleNamespace(String prefix, String uri) throws RDFHandlerException
handleNamespace in interface RDFHandlerhandleNamespace in class AbstractRDFWriterRDFHandlerExceptionpublic void consumeStatement(org.eclipse.rdf4j.model.Statement statement) throws RDFHandlerException
consumeStatement in class AbstractRDFWriterRDFHandlerExceptionpublic static void writeObject(org.eclipse.rdf4j.model.Value object, Set<org.eclipse.rdf4j.model.Resource> contexts, com.fasterxml.jackson.core.JsonGenerator jg) throws com.fasterxml.jackson.core.JsonGenerationException, IOException
object - The RDF value to serialisecontexts - The set of contexts that are relevant to this object, including null contexts as they are found.jg - the JsonGenerator to write to.IOExceptioncom.fasterxml.jackson.core.JsonGenerationExceptionpublic static String resourceToString(org.eclipse.rdf4j.model.Resource uriOrBnode)
uriOrBnode - The resource to serialise to a stringpublic static void modelToRdfJsonInternal(org.eclipse.rdf4j.model.Model graph, WriterConfig writerConfig, com.fasterxml.jackson.core.JsonGenerator jg) throws IOException
IOExceptionCopyright © 2015-2021 Eclipse Foundation. All Rights Reserved.