public class RDFJSONWriter extends AbstractRDFWriter implements RDFWriter
RDFWriter implementation for the RDF/JSON formatnamespaceTable| Constructor and Description | 
|---|
| RDFJSONWriter(OutputStream out,
             RDFFormat actualFormat) | 
| RDFJSONWriter(Writer writer,
             RDFFormat actualFormat) | 
| Modifier and Type | Method and Description | 
|---|---|
| void | endRDF()Signals the end of the RDF data. | 
| RDFFormat | getRDFFormat()Gets the RDF format that this RDFWriter uses. | 
| Collection<RioSetting<?>> | getSupportedSettings() | 
| void | handleComment(String comment)Handles a comment. | 
| void | handleNamespace(String prefix,
               String uri)Handles a namespace declaration/definition. | 
| void | handleStatement(Statement statement)Handles a statement. | 
| static void | modelToRdfJsonInternal(Model graph,
                      WriterConfig writerConfig,
                      com.fasterxml.jackson.core.JsonGenerator jg) | 
| static String | resourceToString(Resource uriOrBnode)Returns the correct syntax for a Resource, depending on whether it is a URI or a Blank Node (ie, BNode) | 
| void | startRDF()Signals the start of the RDF data. | 
| static void | writeObject(Value object,
           Set<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 | 
getWriterConfig, set, setWriterConfigclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetWriterConfig, set, setWriterConfigpublic RDFJSONWriter(OutputStream out, RDFFormat actualFormat)
public void endRDF()
            throws RDFHandlerException
RDFHandlerendRDF in interface RDFHandlerRDFHandlerException - If the RDF handler has encountered an unrecoverable error.public RDFFormat getRDFFormat()
RDFWritergetRDFFormat in interface RDFWriterpublic Collection<RioSetting<?>> getSupportedSettings()
getSupportedSettings in interface RDFWritergetSupportedSettings in class AbstractRDFWriterRioSettings that are supported by this RDFWriter.public void handleComment(String comment) throws RDFHandlerException
RDFHandlerhandleComment in interface RDFHandlercomment - The comment.RDFHandlerException - If the RDF handler has encountered an unrecoverable error.public void handleNamespace(String prefix, String uri) throws RDFHandlerException
RDFHandlerhandleNamespace in interface RDFHandlerhandleNamespace in class AbstractRDFWriterprefix - The prefix for the namespace, or an empty string in case of a default namespace.uri - The URI that the prefix maps to.RDFHandlerException - If the RDF handler has encountered an unrecoverable error.public void handleStatement(Statement statement) throws RDFHandlerException
RDFHandlerhandleStatement in interface RDFHandlerstatement - The statement.RDFHandlerException - If the RDF handler has encountered an unrecoverable error.public void startRDF()
              throws RDFHandlerException
RDFHandlerstartRDF in interface RDFHandlerRDFHandlerException - If the RDF handler has encountered an unrecoverable error.public static void writeObject(Value object, Set<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.JsonGenerationExceptionJSONExceptionpublic static String resourceToString(Resource uriOrBnode)
uriOrBnode - The resource to serialise to a stringpublic static void modelToRdfJsonInternal(Model graph, WriterConfig writerConfig, com.fasterxml.jackson.core.JsonGenerator jg) throws IOException, com.fasterxml.jackson.core.JsonGenerationException
IOExceptioncom.fasterxml.jackson.core.JsonGenerationExceptionCopyright © 2015-2020 Eclipse Foundation. All Rights Reserved.