Class JsonLd


  • public final class JsonLd
    extends java.lang.Object
    The JsonLd interface is the high-level programming structure that developers use to access the JSON-LD transformation methods. This class provides methods to process JSON-LD. All the methods in this class are thread-safe.
    • Field Detail

      • DOCUMENT_LOCATION_PARAM_NAME

        private static final java.lang.String DOCUMENT_LOCATION_PARAM_NAME
        See Also:
        Constant Field Values
      • DOCUMENT_URI_PARAM_NAME

        private static final java.lang.String DOCUMENT_URI_PARAM_NAME
        See Also:
        Constant Field Values
      • DOCUMENT_PARAM_NAME

        private static final java.lang.String DOCUMENT_PARAM_NAME
        See Also:
        Constant Field Values
      • CONTEXT_PARAM_NAME

        private static final java.lang.String CONTEXT_PARAM_NAME
        See Also:
        Constant Field Values
      • FRAME_LOCATION_PARAM_NAME

        private static final java.lang.String FRAME_LOCATION_PARAM_NAME
        See Also:
        Constant Field Values
      • FRAME_URI_PARAM_NAME

        private static final java.lang.String FRAME_URI_PARAM_NAME
        See Also:
        Constant Field Values
      • FRAME_PARAM_NAME

        private static final java.lang.String FRAME_PARAM_NAME
        See Also:
        Constant Field Values
    • Constructor Detail

      • JsonLd

        private JsonLd()
    • Method Detail

      • expand

        public static ExpansionApi expand​(java.lang.String documentLocation)
        Expands the referenced document.
        Parameters:
        documentLocation - IRI referencing JSON-LD document to expand
        Returns:
        ExpansionApi allowing to set additional parameters
      • expand

        public static ExpansionApi expand​(java.net.URI documentUri)
        Expands the referenced document.
        Parameters:
        documentUri - URI referencing JSON-LD document to expand
        Returns:
        ExpansionApi allowing to set additional parameters
      • expand

        public static ExpansionApi expand​(Document document)
        Expands the provided remote document.
        Parameters:
        document - to expand
        Returns:
        ExpansionApi allowing to set additional parameters
      • compact

        public static CompactionApi compact​(java.lang.String documentLocation,
                                            java.lang.String contextLocation)
        Compacts the referenced document using the context.
        Parameters:
        documentLocation - IRI referencing JSON-LD document to compact
        contextLocation - IRI referencing the context to use when compacting the document
        Returns:
        CompactionApi allowing to set additional parameters
      • compact

        public static CompactionApi compact​(java.net.URI documentUri,
                                            java.net.URI contextUri)
        Compacts the referenced document using the context.
        Parameters:
        documentUri - URI referencing JSON-LD document to compact
        contextUri - URI referencing the context to use when compacting the document
        Returns:
        CompactionApi allowing to set additional parameters
      • compact

        public static CompactionApi compact​(java.lang.String documentLocation,
                                            Document context)
        Compacts the referenced document using the context.
        Parameters:
        documentLocation - IRI referencing JSON-LD document to compact
        context - Document representing the context or JsonArray consisting of JsonObject and JsonString referencing the context to use when compacting the document
        Returns:
        CompactionApi allowing to set additional parameters
      • compact

        public static CompactionApi compact​(java.net.URI documentUri,
                                            Document context)
        Compacts the referenced document using the context.
        Parameters:
        documentUri - URI referencing JSON-LD document to compact
        context - Document representing the context or JsonArray consisting of one or many JsonObject and JsonString referencing the context to use when compacting the document
        Returns:
        CompactionApi allowing to set additional parameters
      • compact

        public static CompactionApi compact​(Document document,
                                            Document context)
        Compacts Document document using the context.
        Parameters:
        document - to compact
        context - JSON-LD document
        Returns:
        CompactionApi allowing to set additional parameters
      • compact

        public static CompactionApi compact​(Document document,
                                            java.lang.String contextLocation)
        Compacts Document document using the context.
        Parameters:
        document - to compact
        contextLocation - IRI referencing the context to use when compacting the document
        Returns:
        CompactionApi allowing to set additional parameters
      • compact

        public static CompactionApi compact​(Document document,
                                            java.net.URI contextUri)
        Compacts Document document using the context.
        Parameters:
        document - to compact
        contextUri - URI referencing the context to use when compacting the document
        Returns:
        CompactionApi allowing to set additional parameters
      • compact

        public static CompactionApi compact​(java.lang.String documentLocation,
                                            java.net.URI contextUri)
        Compacts Document document using the context.
        Parameters:
        documentLocation - IRI referencing JSON-LD document to compact
        contextUri - URI referencing the context to use when compacting the document
        Returns:
        CompactionApi allowing to set additional parameters
      • compact

        public static CompactionApi compact​(java.net.URI documentUri,
                                            java.lang.String contextLocation)
        Compacts Document document using the context.
        Parameters:
        documentUri - URI referencing JSON-LD document to compact
        contextLocation - IRI referencing the context to use when compacting the document
        Returns:
        CompactionApi allowing to set additional parameters
      • flatten

        public static FlatteningApi flatten​(java.lang.String documentLocation)
        Flattens the given input and optionally compacts it using context.
        Parameters:
        documentLocation - IRI referencing JSON-LD document to flatten
        Returns:
        FlatteningApi allowing to set additional parameters
      • flatten

        public static FlatteningApi flatten​(java.net.URI documentUri)
        Flattens the given input and optionally compacts it using context.
        Parameters:
        documentUri - URI referencing JSON-LD document to flatten
        Returns:
        FlatteningApi allowing to set additional parameters
      • flatten

        public static FlatteningApi flatten​(Document document)
        Flattens the remote input and optionally compacts it using context.
        Parameters:
        document - to flatten
        Returns:
        FlatteningApi allowing to set additional parameters
      • frame

        public static FramingApi frame​(java.net.URI documentUri,
                                       java.net.URI frameUri)
        Frames the given remote input using remote frame.
        Parameters:
        documentUri - URI referencing JSON-LD document to frame
        frameUri - URI referencing JSON-LD frame
        Returns:
        FramingApi allowing to set additional parameters
      • frame

        public static FramingApi frame​(java.lang.String documentLocation,
                                       java.lang.String frameLocation)
        Frames the given remote input using remote frame.
        Parameters:
        documentLocation - IRI referencing JSON-LD document to frame
        frameLocation - IRI referencing JSON-LD frame
        Returns:
        FramingApi allowing to set additional parameters
      • frame

        public static FramingApi frame​(Document document,
                                       Document frame)
        Frames the local document using given local frame.
        Parameters:
        document - to frame
        frame - JSON-LD definition
        Returns:
        FramingApi allowing to set additional parameters
      • frame

        public static FramingApi frame​(Document document,
                                       java.lang.String frameLocation)
        Frames the local document using given remote frame.
        Parameters:
        document - to frame
        frameLocation - IRI referencing JSON-LD frame
        Returns:
        FramingApi allowing to set additional parameters
      • frame

        public static FramingApi frame​(Document document,
                                       java.net.URI frameUri)
        Frames the local document using given remote frame.
        Parameters:
        document - to frame
        frameUri - URI referencing JSON-LD frame
        Returns:
        FramingApi allowing to set additional parameters
      • frame

        public static FramingApi frame​(java.lang.String documentLocation,
                                       Document frame)
        Frames the remote input using given local frame.
        Parameters:
        documentLocation - IRI referencing JSON-LD document to frame
        frame - JSON-LD definition
        Returns:
        FramingApi allowing to set additional parameters
      • frame

        public static FramingApi frame​(java.lang.String documentLocation,
                                       java.net.URI frameUri)
        Frames the remote input using given remote frame.
        Parameters:
        documentLocation - IRI referencing JSON-LD document to frame
        frameUri - URI referencing JSON-LD frame
        Returns:
        FramingApi allowing to set additional parameters
      • frame

        public static FramingApi frame​(java.net.URI documentUri,
                                       Document frame)
        Frames the remote input using given local frame.
        Parameters:
        documentUri - URI referencing JSON-LD document to frame
        frame - JSON-LD definition
        Returns:
        FramingApi allowing to set additional parameters
      • frame

        public static FramingApi frame​(java.net.URI documentUri,
                                       java.lang.String frameLocation)
        Frames the remote input using given remote frame.
        Parameters:
        documentUri - URI referencing JSON-LD document to frame
        frameLocation - IRI referencing JSON-LD frame
        Returns:
        FramingApi allowing to set additional parameters
      • toRdf

        public static ToRdfApi toRdf​(java.lang.String documentLocation)
        Transforms the given input into RdfDataset.
        Parameters:
        documentLocation - IRI referencing JSON-LD document to transform
        Returns:
        ToRdfApi allowing to set additional parameters
      • toRdf

        public static ToRdfApi toRdf​(java.net.URI documentUri)
        Transforms the given input into RdfDataset.
        Parameters:
        documentUri - URI referencing JSON-LD document to transform
        Returns:
        ToRdfApi allowing to set additional parameters
      • fromRdf

        public static FromRdfApi fromRdf​(java.lang.String documentLocation)
        Transforms the referenced N-Quads document into a JSON-LD document in expanded form.
        Parameters:
        documentLocation - URI referencing N-Quads document to expand
        Returns:
        FromRdfApi allowing to set additional parameters
      • fromRdf

        public static FromRdfApi fromRdf​(java.net.URI documentUri)
        Transforms the referenced N-Quads document into a JSON-LD document in expanded form.
        Parameters:
        documentUri - URI referencing N-Quads document to expand
        Returns:
        FromRdfApi allowing to set additional parameters
      • fromRdf

        public static FromRdfApi fromRdf​(Document document)
        Transforms Document into a JSON-LD document in expanded form.
        Parameters:
        document - to transform
        Returns:
        FromRdfApi allowing to set additional parameters
      • assertLocation

        private static java.net.URI assertLocation​(java.lang.String location,
                                                   java.lang.String param)
      • assertUri

        private static void assertUri​(java.net.URI uri,
                                      java.lang.String param)
      • assertJsonDocument

        private static void assertJsonDocument​(Document document,
                                               java.lang.String param)
      • assertRdfDocument

        private static void assertRdfDocument​(Document document,
                                              java.lang.String param)
      • assertNotNull

        private static void assertNotNull​(java.lang.Object value,
                                          java.lang.String param)