Class CompactionApi
java.lang.Object
no.hasmac.jsonld.api.CompactionApi
- All Implemented Interfaces:
CommonApi<CompactionApi>, LoaderApi<CompactionApi>
public final class CompactionApi
extends Object
implements CommonApi<CompactionApi>, LoaderApi<CompactionApi>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Documentprivate final URIprivate final Documentprivate final URIprivate JsonLdOptions -
Constructor Summary
ConstructorsConstructorDescriptionCompactionApi(URI documentUri, URI contextUri) CompactionApi(URI documentUri, Document context) CompactionApi(Document document, URI contextUri) CompactionApi(Document document, Document context) -
Method Summary
Modifier and TypeMethodDescriptionSet the baseIRI.The processor replaces arrays with just one element.compactArrays(boolean enable) If set totrue, the processor replaces arrays with just one element If set to false, all arrays will remain arrays even if they have just one element.IRIs are compacted relative to thebase(URI)or document location.compactToRelative(boolean enable) Determines if IRIs are compacted relative to thebase(URI)or document location .jakarta.json.JsonObjectget()Get the result of compaction.loader(DocumentLoader loader) Set the loader to be used to retrieve remote documents and contexts, implementing theDocumentLoader.mode(JsonLdVersion processingMode) SetJSON-LDprocessing mode.options(JsonLdOptions options) Override an existing settings withJsonLdOptions.ordered(boolean enable) If set totrue, certain algorithm processing steps are ordered lexicographically.rdfStar()Experimental: Enables JSON-LD-STAR extension.
-
Field Details
-
document
-
documentUri
-
context
-
contextUri
-
options
-
-
Constructor Details
-
CompactionApi
-
CompactionApi
-
CompactionApi
-
CompactionApi
-
-
Method Details
-
options
Description copied from interface:CommonApiOverride an existing settings withJsonLdOptions.- Specified by:
optionsin interfaceCommonApi<CompactionApi>- Parameters:
options-JsonLdOptions- Returns:
- builder instance
-
mode
Description copied from interface:CommonApiSetJSON-LDprocessing mode. JSON-LD 1.1 is set by default.- Specified by:
modein interfaceCommonApi<CompactionApi>- Parameters:
processingMode- to set- Returns:
- builder instance
-
base
Description copied from interface:CommonApiSet the baseIRI. If set, this overrides the input document's IRI.- Specified by:
basein interfaceCommonApi<CompactionApi>- Parameters:
baseUri-- Returns:
- builder instance
-
compactArrays
If set totrue, the processor replaces arrays with just one element If set to false, all arrays will remain arrays even if they have just one element.trueby default.- Parameters:
enable-- Returns:
- builder instance
-
compactArrays
The processor replaces arrays with just one element.- Returns:
CompactionApiinstance
-
compactToRelative
Determines if IRIs are compacted relative to thebase(URI)or document location .trueby default.- Parameters:
enable-- Returns:
- builder instance
-
compactToRelative
IRIs are compacted relative to thebase(URI)or document location.- Returns:
- builder instance
-
loader
Description copied from interface:LoaderApiSet the loader to be used to retrieve remote documents and contexts, implementing theDocumentLoader. If specified, it is used to retrieve remote documents and contexts; otherwise, if not specified, the processor's built-in loader is used.- Specified by:
loaderin interfaceLoaderApi<CompactionApi>- Parameters:
loader-- Returns:
- builder instance
-
ordered
Description copied from interface:CommonApiIf set totrue, certain algorithm processing steps are ordered lexicographically. Iffalse, order is not considered in processing.- Specified by:
orderedin interfaceCommonApi<CompactionApi>- Parameters:
enable-- Returns:
- builder instance
-
rdfStar
Experimental: Enables JSON-LD-STAR extension. Disabled by default.- Returns:
- builder instance
- See Also:
-
get
Get the result of compaction.- Returns:
JsonObjectrepresenting compacted document- Throws:
JsonLdError
-