Class MappingJsonLdContext
java.lang.Object
cz.cvut.kbss.jsonld.serialization.context.MappingJsonLdContext
- All Implemented Interfaces:
- JsonLdContext
Represents the @context JSON-LD attribute.
 
 Note that this represents the JSON-LD 1.0 context, so no context
 scoping is supported and attempting to register a different mapping for an already existing term will result in
 an AmbiguousTermMappingException.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionReturns anObjectNoderepresenting this context.getMappedTerm(String iri) Gets the term mapped to the specified identifier (if it exists).getTermMapping(String term) Gets the mapping for the specified term (if it exists).booleanhasTermMapping(String term) Checks whether this JSON-LD context contains mapping for the specified term.booleanChecks whether this particular JSON-LD context is empty.voidregisterTermMapping(String term, ObjectNode mappedNode) Registers the specified term mapping in this context.voidregisterTermMapping(String term, String iri) Registers the specified term mapping in this context.
- 
Constructor Details- 
MappingJsonLdContextpublic MappingJsonLdContext()
- 
MappingJsonLdContext
 
- 
- 
Method Details- 
registerTermMappingDescription copied from interface:JsonLdContextRegisters the specified term mapping in this context.Typically, the termwould be Java attribute (field) name andiriwould be the IRI to which this field is mapped.- Specified by:
- registerTermMappingin interface- JsonLdContext
- Parameters:
- term- Mapped term
- iri- IRI to which the term is mapped
 
- 
registerTermMappingDescription copied from interface:JsonLdContextRegisters the specified term mapping in this context.Compared to JsonLdContext.registerTermMapping(String, String), this method allows registering more complex mapping like language containers or typed literals.- Specified by:
- registerTermMappingin interface- JsonLdContext
- Parameters:
- term- Mapped term
- mappedNode- Node to which the term is mapped
 
- 
getTermMappingDescription copied from interface:JsonLdContextGets the mapping for the specified term (if it exists).- Specified by:
- getTermMappingin interface- JsonLdContext
- Parameters:
- term- Term to get mapping for
- Returns:
- Optional mapping node
 
- 
hasTermMappingDescription copied from interface:JsonLdContextChecks whether this JSON-LD context contains mapping for the specified term.- Specified by:
- hasTermMappingin interface- JsonLdContext
- Parameters:
- term- Term to search mapping for
- Returns:
- trueif a mapping is already defined for the term,- falseotherwise
 
- 
getMappedTermDescription copied from interface:JsonLdContextGets the term mapped to the specified identifier (if it exists).This method checks term mapping in this context and finds a term that is mapped to the specified identifier. - Specified by:
- getMappedTermin interface- JsonLdContext
- Parameters:
- iri- Identifier the term is mapped to
- Returns:
- Optional mapped term, empty optional if there is no such term mapping
 
- 
isCurrentEmptypublic boolean isCurrentEmpty()Description copied from interface:JsonLdContextChecks whether this particular JSON-LD context is empty.Term mapping inherited from any parent contexts is not considered. - Specified by:
- isCurrentEmptyin interface- JsonLdContext
- Returns:
- trueif this context is empty,- falseotherwise
 
- 
getContextNodeDescription copied from interface:JsonLdContextReturns anObjectNoderepresenting this context.The result can thus be added to serialization output. - Specified by:
- getContextNodein interface- JsonLdContext
- Returns:
- JsonNodewith registered mappings
 
 
-