public class JsonLdApi extends Object
Constructor and Description |
---|
JsonLdApi()
Constructs an empty JsonLdApi object using the default JsonLdOptions, and
without initialization.
|
JsonLdApi(JsonLdOptions opts)
Constructs an empty JsonLdApi object using the given JsonLdOptions, and
without initialization.
|
JsonLdApi(Object input,
JsonLdOptions opts)
Constructs a JsonLdApi object using the given object as the initial
JSON-LD object, and the given JsonLdOptions.
|
JsonLdApi(Object input,
Object context,
JsonLdOptions opts)
Constructs a JsonLdApi object using the given object as the initial
JSON-LD object, the given context, and the given JsonLdOptions.
|
Modifier and Type | Method and Description |
---|---|
Object |
compact(Context activeCtx,
String activeProperty,
Object element)
Compaction Algorithm
http://json-ld.org/spec/latest/json-ld-api/#compaction-algorithm
|
Object |
compact(Context activeCtx,
String activeProperty,
Object element,
boolean compactArrays)
Compaction Algorithm
http://json-ld.org/spec/latest/json-ld-api/#compaction-algorithm
|
Object |
expand(Context activeCtx,
Object element)
Expansion Algorithm
http://json-ld.org/spec/latest/json-ld-api/#expansion-algorithm
|
Object |
expand(Context activeCtx,
String activeProperty,
Object element)
Expansion Algorithm
http://json-ld.org/spec/latest/json-ld-api/#expansion-algorithm
|
List<Object> |
frame(Object input,
List<Object> frame)
Performs JSON-LD framing.
|
List<Object> |
fromRDF(RDFDataset dataset)
Converts RDF statements into JSON-LD.
|
Object |
normalize(Map<String,Object> dataset)
Performs RDF normalization on the given JSON-LD input.
|
RDFDataset |
toRDF()
Adds RDF triples for each graph in the current node map to an RDF
dataset.
|
public JsonLdApi()
public JsonLdApi(Object input, JsonLdOptions opts) throws JsonLdError
input
- The initial JSON-LD object.opts
- The JsonLdOptions to use.JsonLdError
- If there is an error initializing using the object and
options.public JsonLdApi(Object input, Object context, JsonLdOptions opts) throws JsonLdError
input
- The initial JSON-LD object.context
- The initial context.opts
- The JsonLdOptions to use.JsonLdError
- If there is an error initializing using the object and
options.public JsonLdApi(JsonLdOptions opts)
opts
- The JsonLdOptions to use.public Object compact(Context activeCtx, String activeProperty, Object element, boolean compactArrays) throws JsonLdError
activeCtx
- The Active ContextactiveProperty
- The Active Propertyelement
- The current elementcompactArrays
- True to compact arrays.JsonLdError
- If there was an error during compaction.public Object compact(Context activeCtx, String activeProperty, Object element) throws JsonLdError
activeCtx
- The Active ContextactiveProperty
- The Active Propertyelement
- The current elementJsonLdError
- If there was an error during compaction.public Object expand(Context activeCtx, String activeProperty, Object element) throws JsonLdError
activeCtx
- The Active ContextactiveProperty
- The Active Propertyelement
- The current elementJsonLdError
- If there was an error during expansion.public Object expand(Context activeCtx, Object element) throws JsonLdError
activeCtx
- The Active Contextelement
- The current elementJsonLdError
- If there was an error during expansion.public List<Object> frame(Object input, List<Object> frame) throws JsonLdError
input
- the expanded JSON-LD to frame.frame
- the expanded JSON-LD frame to use.JsonLdError
- If the framing was not successful.public List<Object> fromRDF(RDFDataset dataset) throws JsonLdError
dataset
- the RDF statements.JsonLdError
- If there was an error during conversion from RDF to JSON-LD.public RDFDataset toRDF() throws JsonLdError
JsonLdError
- If there was an error converting from JSON-LD to RDF.public Object normalize(Map<String,Object> dataset) throws JsonLdError
dataset
- the expanded JSON-LD object to normalize.JsonLdError
- If there was an error while normalizing.Copyright © 2016. All rights reserved.