public class Context extends LinkedHashMap<String,Object>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
Context() |
Context(JsonLdOptions opts) |
Context(Map<String,Object> map) |
Context(Map<String,Object> map,
JsonLdOptions opts) |
Context(Object context,
JsonLdOptions opts) |
Modifier and Type | Method and Description |
---|---|
static String |
_iriCompactionStep5point4(String iri,
Object value,
String compactIRI,
String candidate,
Map<String,Object> termDefinitions)
This method is only visible for testing.
|
Context |
clone() |
Object |
compactValue(String activeProperty,
Map<String,Object> value)
Value Compaction Algorithm
http://json-ld.org/spec/latest/json-ld-api/#value-compaction
|
Object |
expandValue(String activeProperty,
Object value) |
String |
getContainer(String property)
Retrieve container mapping.
|
Object |
getContextValue(String activeProperty,
String string) |
Map<String,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.
|
Map<String,String> |
getPrefixes(boolean onlyCommonPrefixes)
Return a map of potential RDF prefixes based on the JSON-LD Term
Definitions in this context.
|
Boolean |
isReverseProperty(String property) |
Context |
parse(Object localContext) |
Context |
parse(Object localContext,
List<String> remoteContexts)
Context Processing Algorithm
http://json-ld.org/spec/latest/json-ld-api/#context-processing-algorithms
|
Map<String,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
equals, hashCode, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
public Context()
public Context(JsonLdOptions opts)
public Context(Map<String,Object> map, JsonLdOptions opts)
public Context(Object context, JsonLdOptions opts)
public Object compactValue(String activeProperty, Map<String,Object> value)
activeProperty
- The Active Propertyvalue
- The value to compactpublic Context parse(Object localContext, List<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(Object localContext) throws JsonLdError
JsonLdError
public static String _iriCompactionStep5point4(String iri, Object value, String compactIRI, String candidate, Map<String,Object> termDefinitions)
public Map<String,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 Map<String,Object> getInverse()
public String getContainer(String property)
property
- The Property to get a container mapping for.public Object expandValue(String activeProperty, Object value) throws JsonLdError
JsonLdError
public Object getContextValue(String activeProperty, String string) throws JsonLdError
JsonLdError
Copyright © 2018. All rights reserved.