Class CompactionApi

    • Field Detail

      • document

        private final Document document
      • documentUri

        private final java.net.URI documentUri
      • context

        private final Document context
      • contextUri

        private final java.net.URI contextUri
    • Constructor Detail

      • CompactionApi

        public CompactionApi​(java.net.URI documentUri,
                             Document context)
      • CompactionApi

        public CompactionApi​(java.net.URI documentUri,
                             java.net.URI contextUri)
      • CompactionApi

        public CompactionApi​(Document document,
                             java.net.URI contextUri)
    • Method Detail

      • base

        public CompactionApi base​(java.net.URI baseUri)
        Description copied from interface: CommonApi
        Set the base IRI. If set, this overrides the input document's IRI.
        Specified by:
        base in interface CommonApi<CompactionApi>
        Returns:
        builder instance
      • compactArrays

        public CompactionApi compactArrays​(boolean enable)
        If set to true, the processor replaces arrays with just one element If set to false, all arrays will remain arrays even if they have just one element. true by default.
        Parameters:
        enable -
        Returns:
        builder instance
      • compactArrays

        public CompactionApi compactArrays()
        The processor replaces arrays with just one element.
        Returns:
        CompactionApi instance
      • compactToRelative

        public CompactionApi compactToRelative​(boolean enable)
        Determines if IRIs are compacted relative to the base(URI) or document location . true by default.
        Parameters:
        enable -
        Returns:
        builder instance
      • compactToRelative

        public CompactionApi compactToRelative()
        IRIs are compacted relative to the base(URI) or document location.
        Returns:
        builder instance
      • loader

        public CompactionApi loader​(DocumentLoader loader)
        Description copied from interface: LoaderApi
        Set the loader to be used to retrieve remote documents and contexts, implementing the DocumentLoader. 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:
        loader in interface LoaderApi<CompactionApi>
        Returns:
        builder instance
      • ordered

        public CompactionApi ordered​(boolean enable)
        Description copied from interface: CommonApi
        If set to true, certain algorithm processing steps are ordered lexicographically. If false, order is not considered in processing.
        Specified by:
        ordered in interface CommonApi<CompactionApi>
        Returns:
        builder instance
      • rdfStar

        public CompactionApi rdfStar()
        Experimental: Enables JSON-LD-STAR extension. Disabled by default.
        Returns:
        builder instance
        See Also:
        JSON-LD-STAR Draft
      • get

        public jakarta.json.JsonObject get()
                                    throws JsonLdError
        Get the result of compaction.
        Returns:
        JsonObject representing compacted document
        Throws:
        JsonLdError