Package com.github.jsonldjava.core
Class Context
- All Implemented Interfaces:
Serializable,Cloneable,Map<String,,Object> SequencedMap<String,Object>
A helper class which still stores all the values in a map but gives member
variables easily access certain keys
- Author:
- tristan
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionContext()Context(JsonLdOptions opts) Context(Object context, JsonLdOptions opts) Context(Map<String, Object> map, JsonLdOptions opts) -
Method Summary
Modifier and TypeMethodDescriptionstatic String_iriCompactionStep5point4(String iri, Object value, String compactIRI, String candidate, Map<String, Object> termDefinitions) clone()compactValue(String activeProperty, Map<String, Object> value) Value Compaction Algorithm http://json-ld.org/spec/latest/json-ld-api/#value-compactionexpandValue(String activeProperty, Object value) getContainer(String property) Retrieve container mapping.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.getLanguageMapping(String property) getPrefixes(boolean onlyCommonPrefixes) Return a map of potential RDF prefixes based on the JSON-LD Term Definitions in this context.getTypeMapping(String property) isReverseProperty(String property) Context Processing Algorithm http://json-ld.org/spec/latest/json-ld-api/#context-processing-algorithmsDeprecated.Methods inherited from class java.util.LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, newLinkedHashMap, putFirst, putLast, removeEldestEntry, replaceAll, reversed, sequencedEntrySet, sequencedKeySet, sequencedValues, valuesMethods inherited from class java.util.HashMap
compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeMethods inherited from class java.util.AbstractMap
equals, hashCode, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeMethods inherited from interface java.util.SequencedMap
firstEntry, lastEntry, pollFirstEntry, pollLastEntry
-
Field Details
-
inverse
-
-
Constructor Details
-
Context
public Context() -
Context
-
Context
-
Context
-
Context
-
-
Method Details
-
compactValue
Value Compaction Algorithm http://json-ld.org/spec/latest/json-ld-api/#value-compaction- Parameters:
activeProperty- The Active Propertyvalue- The value to compact- Returns:
- The compacted value
-
parse
Context Processing Algorithm http://json-ld.org/spec/latest/json-ld-api/#context-processing-algorithms- Parameters:
localContext- The Local Context object.remoteContexts- The list of Strings denoting the remote Context URLs.- Returns:
- The parsed and merged Context.
- Throws:
JsonLdError- If there is an error parsing the contexts.
-
parse
- Throws:
JsonLdError
-
_iriCompactionStep5point4
-
getPrefixes
Return a map of potential RDF prefixes based on the JSON-LD Term Definitions in this context.No guarantees of the prefixes are given, beyond that it will not contain ":".
- Parameters:
onlyCommonPrefixes- Iftrue, the result will not include "not so useful" prefixes, such as "term1": "http://example.com/term1", e.g. all IRIs will end with "/" or "#". Iffalse, all potential prefixes are returned.- Returns:
- A map from prefix string to IRI string
-
clone
-
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.- Returns:
- the inverse context.
-
getContainer
Retrieve container mapping.- Parameters:
property- The Property to get a container mapping for.- Returns:
- The container mapping if any, else null
-
isReverseProperty
-
getTypeMapping
-
getLanguageMapping
-
expandValue
- Throws:
JsonLdError
-
serialize
Deprecated.
-