public class EncoderDefault extends Object implements EncoderPlugin
Modifier and Type | Field and Description |
---|---|
static String |
Format
name of format
|
static String |
PNbase
property name for the base entry in mapping table
|
static String |
PNContent
property name for the content/results property
|
static String |
PNFormat
property name for the format name property
|
static String |
PNgraphs
property name for the named graphs property
|
static String |
PNMapping
property name for the name/URI mapping table within the context
|
static String |
PNOneResult
property name for the single-valued content/results property
|
static String |
PNrange
property name for the range value in the mapping table
|
static String |
PNuri
property name for the uri entry in mapping table
|
static String |
PNVersion
property name for the format version property
|
static String |
Version
version number of format
|
Constructor and Description |
---|
EncoderDefault() |
Modifier and Type | Method and Description |
---|---|
String |
decodeResourceURI(String code,
Context context)
Decode a resource URI
|
com.hp.hpl.jena.rdf.model.RDFNode |
decodeValue(Object jsonValue,
Decoder decoder,
String type)
Decode an RDF value (object of a statement)
|
String |
encodebNodeId(int id)
Encode a reference to a bNode via a mapped identifier number
|
void |
encodeLiteral(JSONWriterFacade jw,
boolean isStructured,
com.hp.hpl.jena.rdf.model.Literal lit,
ReadContext c)
Encode a literal as a JSON compatible object
|
String |
encodeResourceURI(String uri)
Encode a resource URI
|
String |
encodeResourceURI(String uri,
ReadContext context,
boolean shorten)
Encode a resource URI, shortening it if possible
|
void |
endResults(JSONWriterFacade jw,
boolean oneResult)
end of results
|
void |
finishNamedGraph(JSONWriterFacade jw)
Finish a specific named graph
|
void |
finishNamedGraphs(JSONWriterFacade jw)
Finish the entire second of named graphs, assumes last graph has been closed
|
String |
getGraphName(org.apache.jena.atlas.json.JsonObject graph,
Context context)
Return the name of a named graph
|
org.apache.jena.atlas.json.JsonArray |
getNamedGraphs(org.apache.jena.atlas.json.JsonObject jobj)
Return the array of encoded graphs from a top level JSON results set, or null if there is none
|
String |
getPNResourceID()
String used as the property name for identifying resources
|
org.apache.jena.atlas.json.JsonArray |
getResults(org.apache.jena.atlas.json.JsonObject jobj)
Extract the results part of a deserialized JSON object
|
void |
startNamedGraph(JSONWriterFacade jw,
String name)
Start a specific named graph
|
void |
startNamedGraphs(JSONWriterFacade jw)
Start a sub-section for outputing named graphs
|
void |
startResults(JSONWriterFacade jw,
boolean oneResult)
Writer header for a results/model array object
|
static String |
unescapeString(String s)
Decode a string to reverse escapement of meta characters
|
void |
writeHeader(JSONWriterFacade jw)
Write the outer result wrapper.
|
public static final String Format
public static final String Version
public static final String PNFormat
public static final String PNVersion
public static final String PNMapping
public static final String PNbase
public static final String PNuri
public static final String PNrange
public static final String PNContent
public static final String PNOneResult
public static final String PNgraphs
public String getPNResourceID()
getPNResourceID
in interface EncoderPlugin
public String encodeResourceURI(String uri)
encodeResourceURI
in interface EncoderPlugin
public String encodeResourceURI(String uri, ReadContext context, boolean shorten)
encodeResourceURI
in interface EncoderPlugin
public String decodeResourceURI(String code, Context context)
decodeResourceURI
in interface EncoderPlugin
public String encodebNodeId(int id)
encodebNodeId
in interface EncoderPlugin
public void encodeLiteral(JSONWriterFacade jw, boolean isStructured, com.hp.hpl.jena.rdf.model.Literal lit, ReadContext c)
encodeLiteral
in interface EncoderPlugin
public static String unescapeString(String s)
public void writeHeader(JSONWriterFacade jw)
writeHeader
in interface EncoderPlugin
public void startResults(JSONWriterFacade jw, boolean oneResult)
startResults
in interface EncoderPlugin
public void endResults(JSONWriterFacade jw, boolean oneResult)
EncoderPlugin
endResults
in interface EncoderPlugin
public void startNamedGraphs(JSONWriterFacade jw)
startNamedGraphs
in interface EncoderPlugin
public void startNamedGraph(JSONWriterFacade jw, String name)
startNamedGraph
in interface EncoderPlugin
public void finishNamedGraph(JSONWriterFacade jw)
finishNamedGraph
in interface EncoderPlugin
public void finishNamedGraphs(JSONWriterFacade jw)
finishNamedGraphs
in interface EncoderPlugin
public org.apache.jena.atlas.json.JsonArray getNamedGraphs(org.apache.jena.atlas.json.JsonObject jobj) throws org.apache.jena.atlas.json.JsonException
getNamedGraphs
in interface EncoderPlugin
org.apache.jena.atlas.json.JsonException
public String getGraphName(org.apache.jena.atlas.json.JsonObject graph, Context context) throws org.apache.jena.atlas.json.JsonException
getGraphName
in interface EncoderPlugin
org.apache.jena.atlas.json.JsonException
public org.apache.jena.atlas.json.JsonArray getResults(org.apache.jena.atlas.json.JsonObject jobj) throws org.apache.jena.atlas.json.JsonException
getResults
in interface EncoderPlugin
org.apache.jena.atlas.json.JsonException
public com.hp.hpl.jena.rdf.model.RDFNode decodeValue(Object jsonValue, Decoder decoder, String type)
decodeValue
in interface EncoderPlugin
Copyright © 2014. All Rights Reserved.