public class Encoder extends Object
Modifier and Type | Field and Description |
---|---|
protected ReadContext |
context |
protected static EncoderPlugin |
defaultPlugin |
protected boolean |
oneResult |
protected EncoderPlugin |
rules |
Modifier and Type | Method and Description |
---|---|
org.apache.jena.atlas.json.JsonObject |
encode(com.hp.hpl.jena.query.Dataset dataset)
Write out a collection of named graphs plus a default graph
|
protected void |
encode(com.hp.hpl.jena.query.Dataset dataset,
JSONWriterFacade jw)
Write out a collection of named graphs plus a default graph
|
void |
encode(com.hp.hpl.jena.query.Dataset dataset,
Writer writer)
Write out a collection of named graphs plus a default graph
|
void |
encode(com.hp.hpl.jena.query.Dataset dataset,
Writer writer,
boolean pretty)
Write out a collection of named graphs plus a default graph
|
org.apache.jena.atlas.json.JsonObject |
encode(com.hp.hpl.jena.rdf.model.Model model)
Encode the whole of the given RDF model into the writer
|
org.apache.jena.atlas.json.JsonObject |
encode(com.hp.hpl.jena.rdf.model.Model model,
List<com.hp.hpl.jena.rdf.model.Resource> roots)
Encode a list of resources from the given RDF model, only top level assertions and
bNode closures connected to them will be output.
|
protected void |
encode(com.hp.hpl.jena.rdf.model.Model model,
List<com.hp.hpl.jena.rdf.model.Resource> roots,
JSONWriterFacade jw) |
void |
encode(com.hp.hpl.jena.rdf.model.Model model,
List<com.hp.hpl.jena.rdf.model.Resource> roots,
Writer writer)
Encode a list of resources from the given RDF model, only top level assertions and
bNode closures connected to them will be output.
|
void |
encode(com.hp.hpl.jena.rdf.model.Model model,
List<com.hp.hpl.jena.rdf.model.Resource> roots,
Writer writer,
boolean pretty)
Encode a list of resources from the given RDF model, only top level assertions and
bNode closures connected to them will be output.
|
void |
encode(com.hp.hpl.jena.rdf.model.Model model,
Writer writer)
Encode the whole of the given RDF model into the writer
|
void |
encode(com.hp.hpl.jena.rdf.model.Model model,
Writer writer,
boolean pretty)
Encode a list of resources from the given RDF model, only top level assertions and
bNode closures connected to them will be output.
|
org.apache.jena.atlas.json.JsonObject |
encodeRecursive(com.hp.hpl.jena.rdf.model.Model model,
List<com.hp.hpl.jena.rdf.model.Resource> roots)
Encode the given list of resources from the given model, plus any resources that those
roots reference - whether bNodes or URIs.
|
protected void |
encodeRecursive(com.hp.hpl.jena.rdf.model.Model model,
List<com.hp.hpl.jena.rdf.model.Resource> roots,
JSONWriterFacade jw) |
void |
encodeRecursive(com.hp.hpl.jena.rdf.model.Model model,
List<com.hp.hpl.jena.rdf.model.Resource> roots,
Writer writer)
Encode the given list of resources from the given model, plus any resources that those
roots reference - whether bNodes or URIs.
|
void |
encodeRecursive(com.hp.hpl.jena.rdf.model.Model model,
List<com.hp.hpl.jena.rdf.model.Resource> roots,
Writer writer,
boolean pretty)
Encode the given list of resources from the given model, plus any resources that those
roots reference - whether bNodes or URIs.
|
static Encoder |
get(EncoderPlugin rules)
Return an encoder using the specified rules and no Context, any
Context information will be generated on-the-fly.
|
static Encoder |
get(EncoderPlugin rules,
ReadContext fromOntology)
Return an encoder using the specified rules and the specified
base ontology.
|
static Encoder |
get(ReadContext context)
Return an encoder using the default rules and no Context, any
Context information will be generated on-the-fly.
|
static Encoder |
getForOneResult() |
static Encoder |
getForOneResult(ReadContext c) |
protected static EncoderPlugin defaultPlugin
protected final EncoderPlugin rules
protected final ReadContext context
protected final boolean oneResult
public static Encoder getForOneResult(ReadContext c)
public static Encoder getForOneResult()
public static Encoder get(ReadContext context)
public static Encoder get(EncoderPlugin rules)
public static Encoder get(EncoderPlugin rules, ReadContext fromOntology)
public void encode(com.hp.hpl.jena.rdf.model.Model model, Writer writer) throws IOException
model
- The RDF to be encodedwriter
- The output writer, ideally platform neutral charset like UTF-8IOException
public org.apache.jena.atlas.json.JsonObject encode(com.hp.hpl.jena.rdf.model.Model model)
model
- The RDF to be encodedpublic void encode(com.hp.hpl.jena.rdf.model.Model model, Writer writer, boolean pretty) throws IOException
model
- The RDF to be encodedwriter
- The output writer, ideally platform neutral charset like UTF-8pretty
- set to true to pretty-print the jsonIOException
public void encode(com.hp.hpl.jena.rdf.model.Model model, List<com.hp.hpl.jena.rdf.model.Resource> roots, Writer writer) throws IOException
model
- The RDF to be encodedroots
- the root resources to be encodedwriter
- The output writer, ideally platform neutral charset like UTF-8IOException
public org.apache.jena.atlas.json.JsonObject encode(com.hp.hpl.jena.rdf.model.Model model, List<com.hp.hpl.jena.rdf.model.Resource> roots)
model
- The RDF to be encodedroots
- the root resources to be encodedpublic void encode(com.hp.hpl.jena.rdf.model.Model model, List<com.hp.hpl.jena.rdf.model.Resource> roots, Writer writer, boolean pretty)
model
- The RDF to be encodedroots
- the root resources to be encodedwriter
- The output writer, ideally platform neutral charset like UTF-8pretty
- set to true to pretty-print the jsonIOException
protected void encode(com.hp.hpl.jena.rdf.model.Model model, List<com.hp.hpl.jena.rdf.model.Resource> roots, JSONWriterFacade jw)
public void encodeRecursive(com.hp.hpl.jena.rdf.model.Model model, List<com.hp.hpl.jena.rdf.model.Resource> roots, Writer writer, boolean pretty)
model
- The RDF to be encodedroots
- the root resources from which encoding should startwriter
- The output writer, ideally platform neutral charset like UTF-8pretty
- set to true to pretty-print the jsonpublic void encodeRecursive(com.hp.hpl.jena.rdf.model.Model model, List<com.hp.hpl.jena.rdf.model.Resource> roots, Writer writer)
model
- The RDF to be encodedroots
- the root resources from which encoding should startwriter
- The output writer, ideally platform neutral charset like UTF-8IOException
public org.apache.jena.atlas.json.JsonObject encodeRecursive(com.hp.hpl.jena.rdf.model.Model model, List<com.hp.hpl.jena.rdf.model.Resource> roots)
model
- The RDF to be encodedroots
- the root resources from which encoding should startIOException
protected void encodeRecursive(com.hp.hpl.jena.rdf.model.Model model, List<com.hp.hpl.jena.rdf.model.Resource> roots, JSONWriterFacade jw)
public void encode(com.hp.hpl.jena.query.Dataset dataset, Writer writer) throws IOException
dataset
- the collection of modelswriter
- writer to output toIOException
public org.apache.jena.atlas.json.JsonObject encode(com.hp.hpl.jena.query.Dataset dataset)
dataset
- the collection of modelspublic void encode(com.hp.hpl.jena.query.Dataset dataset, Writer writer, boolean pretty) throws IOException
dataset
- the collection of modelswriter
- writer to output topretty
- set to true to pretty-print the jsonIOException
protected void encode(com.hp.hpl.jena.query.Dataset dataset, JSONWriterFacade jw) throws IOException
dataset
- the collection of modelsjw
- JSON writer to output toIOException
Copyright © 2014. All Rights Reserved.