public class JSONLDWriter
extends org.openrdf.rio.helpers.RDFWriterBase
JSON-LD is a JSON-based format for serializing data in (a superset of) RDF as JSON and interpreting JSON contents as RDF. See http://www.w3.org/TR/json-ld/ for the format specification.
Similarly to RDF/XML, JSON-LD provides for several ways to encode the same triples. This
RDFWriter adopts a simple and consistent strategy whose output is a JSON-LD document consisting
of a sequence of resource blocks, one for each RDF resource of the configured root type (@see
JSONLD.ROOT_TYPES
).
Constructor and Description |
---|
JSONLDWriter(OutputStream stream)
Creates a new JSONLDWriter that will write to the supplied OutputStream.
|
JSONLDWriter(Writer writer)
Creates a new JSONLDWriter that will write to the supplied Writer.
|
Modifier and Type | Method and Description |
---|---|
void |
endRDF() |
org.openrdf.rio.RDFFormat |
getRDFFormat() |
void |
handleComment(String comment) |
void |
handleNamespace(String prefix,
String uri) |
void |
handleStatement(org.openrdf.model.Statement statement) |
void |
startRDF() |
public JSONLDWriter(OutputStream stream)
stream
- the OutputStream to write topublic JSONLDWriter(Writer writer)
writer
- the Writer to write topublic org.openrdf.rio.RDFFormat getRDFFormat()
public void startRDF() throws org.openrdf.rio.RDFHandlerException
org.openrdf.rio.RDFHandlerException
public void handleComment(String comment) throws org.openrdf.rio.RDFHandlerException
org.openrdf.rio.RDFHandlerException
public void handleNamespace(String prefix, String uri) throws org.openrdf.rio.RDFHandlerException
handleNamespace
in interface org.openrdf.rio.RDFHandler
handleNamespace
in class org.openrdf.rio.helpers.RDFWriterBase
org.openrdf.rio.RDFHandlerException
public void handleStatement(org.openrdf.model.Statement statement) throws org.openrdf.rio.RDFHandlerException
org.openrdf.rio.RDFHandlerException
public void endRDF() throws org.openrdf.rio.RDFHandlerException
org.openrdf.rio.RDFHandlerException
Copyright © 2015–2016 FBK-irst. All rights reserved.