public class Context
extends java.util.LinkedHashMap<java.lang.String,java.lang.Object>
Modifier and Type | Field and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Object> |
inverse |
Constructor and Description |
---|
Context() |
Context(JsonLdOptions opts) |
Context(java.util.Map<java.lang.String,java.lang.Object> map) |
Context(java.util.Map<java.lang.String,java.lang.Object> map,
JsonLdOptions opts) |
Context(java.lang.Object context,
JsonLdOptions opts) |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
_iriCompactionStep5point4(java.lang.String iri,
java.lang.Object value,
java.lang.String compactIRI,
java.lang.String candidate,
java.util.Map<java.lang.String,java.lang.Object> termDefinitions)
This method is only visible for testing.
|
Context |
clone() |
java.lang.Object |
compactValue(java.lang.String activeProperty,
java.util.Map<java.lang.String,java.lang.Object> value)
Value Compaction Algorithm
http://json-ld.org/spec/latest/json-ld-api/#value-compaction
|
java.lang.Object |
expandValue(java.lang.String activeProperty,
java.lang.Object value) |
java.lang.String |
getContainer(java.lang.String property)
Retrieve container mapping.
|
java.util.Map<java.lang.String,java.lang.Object> |
getInverse()
Inverse Context Creation
http://json-ld.org/spec/latest/json-ld-api/#inverse-context-creation
Generates an inverse context for use in the compaction algorithm, if not
already generated for the given active context.
|
java.util.Map<java.lang.String,java.lang.String> |
getPrefixes(boolean onlyCommonPrefixes)
Return a map of potential RDF prefixes based on the JSON-LD Term
Definitions in this context.
|
java.lang.Boolean |
isReverseProperty(java.lang.String property) |
Context |
parse(java.lang.Object localContext) |
Context |
parse(java.lang.Object localContext,
java.util.List<java.lang.String> remoteContexts)
Context Processing Algorithm
http://json-ld.org/spec/latest/json-ld-api/#context-processing-algorithms
|
java.util.Map<java.lang.String,java.lang.Object> |
serialize() |
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, values
compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
public Context()
public Context(JsonLdOptions opts)
public Context(java.util.Map<java.lang.String,java.lang.Object> map, JsonLdOptions opts)
public Context(java.util.Map<java.lang.String,java.lang.Object> map)
public Context(java.lang.Object context, JsonLdOptions opts)
public java.lang.Object compactValue(java.lang.String activeProperty, java.util.Map<java.lang.String,java.lang.Object> value)
activeProperty
- The Active Propertyvalue
- The value to compactpublic Context parse(java.lang.Object localContext, java.util.List<java.lang.String> remoteContexts) throws JsonLdError
localContext
- The Local Context object.remoteContexts
- The list of Strings denoting the remote Context URLs.JsonLdError
- If there is an error parsing the contexts.public Context parse(java.lang.Object localContext) throws JsonLdError
JsonLdError
public static java.lang.String _iriCompactionStep5point4(java.lang.String iri, java.lang.Object value, java.lang.String compactIRI, java.lang.String candidate, java.util.Map<java.lang.String,java.lang.Object> termDefinitions)
public java.util.Map<java.lang.String,java.lang.String> getPrefixes(boolean onlyCommonPrefixes)
No guarantees of the prefixes are given, beyond that it will not contain ":".
onlyCommonPrefixes
- If true
, the result will not include
"not so useful" prefixes, such as "term1":
"http://example.com/term1", e.g. all IRIs will end with "/" or
"#". If false
, all potential prefixes are
returned.public Context clone()
clone
in class java.util.HashMap<java.lang.String,java.lang.Object>
public java.util.Map<java.lang.String,java.lang.Object> getInverse()
public java.lang.String getContainer(java.lang.String property)
property
- The Property to get a container mapping for.public java.lang.Boolean isReverseProperty(java.lang.String property)
public java.lang.Object expandValue(java.lang.String activeProperty, java.lang.Object value) throws JsonLdError
JsonLdError
public java.util.Map<java.lang.String,java.lang.Object> serialize()