Package no.hasmac.jsonld
Class JsonLd
- java.lang.Object
-
- no.hasmac.jsonld.JsonLd
-
public final class JsonLd extends java.lang.ObjectTheJsonLdinterface 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 Summary
Fields Modifier and Type Field Description private static java.lang.StringCONTEXT_PARAM_NAMEprivate static java.lang.StringDOCUMENT_LOCATION_PARAM_NAMEprivate static java.lang.StringDOCUMENT_PARAM_NAMEprivate static java.lang.StringDOCUMENT_URI_PARAM_NAMEprivate static java.lang.StringFRAME_LOCATION_PARAM_NAMEprivate static java.lang.StringFRAME_PARAM_NAMEprivate static java.lang.StringFRAME_URI_PARAM_NAME
-
Constructor Summary
Constructors Modifier Constructor Description privateJsonLd()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static voidassertJsonDocument(Document document, java.lang.String param)private static java.net.URIassertLocation(java.lang.String location, java.lang.String param)private static voidassertNotNull(java.lang.Object value, java.lang.String param)private static voidassertRdfDocument(Document document, java.lang.String param)private static voidassertUri(java.net.URI uri, java.lang.String param)static CompactionApicompact(java.lang.String documentLocation, java.lang.String contextLocation)Compacts the referenced document using the context.static CompactionApicompact(java.lang.String documentLocation, java.net.URI contextUri)CompactsDocumentdocument using the context.static CompactionApicompact(java.lang.String documentLocation, Document context)Compacts the referenced document using the context.static CompactionApicompact(java.net.URI documentUri, java.lang.String contextLocation)CompactsDocumentdocument using the context.static CompactionApicompact(java.net.URI documentUri, java.net.URI contextUri)Compacts the referenced document using the context.static CompactionApicompact(java.net.URI documentUri, Document context)Compacts the referenced document using the context.static CompactionApicompact(Document document, java.lang.String contextLocation)CompactsDocumentdocument using the context.static CompactionApicompact(Document document, java.net.URI contextUri)CompactsDocumentdocument using the context.static CompactionApicompact(Document document, Document context)CompactsDocumentdocument using the context.static ExpansionApiexpand(java.lang.String documentLocation)Expands the referenced document.static ExpansionApiexpand(java.net.URI documentUri)Expands the referenced document.static ExpansionApiexpand(Document document)Expands the provided remote document.static FlatteningApiflatten(java.lang.String documentLocation)Flattens the given input and optionally compacts it using context.static FlatteningApiflatten(java.net.URI documentUri)Flattens the given input and optionally compacts it using context.static FlatteningApiflatten(Document document)Flattens the remote input and optionally compacts it using context.static FramingApiframe(java.lang.String documentLocation, java.lang.String frameLocation)Frames the given remote input using remote frame.static FramingApiframe(java.lang.String documentLocation, java.net.URI frameUri)Frames the remote input using given remote frame.static FramingApiframe(java.lang.String documentLocation, Document frame)Frames the remote input using given local frame.static FramingApiframe(java.net.URI documentUri, java.lang.String frameLocation)Frames the remote input using given remote frame.static FramingApiframe(java.net.URI documentUri, java.net.URI frameUri)Frames the given remote input using remote frame.static FramingApiframe(java.net.URI documentUri, Document frame)Frames the remote input using given local frame.static FramingApiframe(Document document, java.lang.String frameLocation)Frames the local document using given remote frame.static FramingApiframe(Document document, java.net.URI frameUri)Frames the local document using given remote frame.static FramingApiframe(Document document, Document frame)Frames the local document using given local frame.static FromRdfApifromRdf(java.lang.String documentLocation)Transforms the referenced N-Quads document into a JSON-LD document in expanded form.static FromRdfApifromRdf(java.net.URI documentUri)Transforms the referenced N-Quads document into a JSON-LD document in expanded form.static FromRdfApifromRdf(Document document)TransformsDocumentinto a JSON-LD document in expanded form.static ToRdfApitoRdf(java.lang.String documentLocation)Transforms the given input intoRdfDataset.static ToRdfApitoRdf(java.net.URI documentUri)Transforms the given input intoRdfDataset.static ToRdfApitoRdf(Document document)TransformsDocumentintoRdfDataset.
-
-
-
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
-
-
Method Detail
-
expand
public static ExpansionApi expand(java.lang.String documentLocation)
Expands the referenced document.- Parameters:
documentLocation-IRIreferencing JSON-LD document to expand- Returns:
ExpansionApiallowing to set additional parameters
-
expand
public static ExpansionApi expand(java.net.URI documentUri)
Expands the referenced document.- Parameters:
documentUri-URIreferencing JSON-LD document to expand- Returns:
ExpansionApiallowing to set additional parameters
-
expand
public static ExpansionApi expand(Document document)
Expands the provided remote document.- Parameters:
document- to expand- Returns:
ExpansionApiallowing 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-IRIreferencing JSON-LD document to compactcontextLocation-IRIreferencing the context to use when compacting the document- Returns:
CompactionApiallowing 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-URIreferencing JSON-LD document to compactcontextUri-URIreferencing the context to use when compacting the document- Returns:
CompactionApiallowing to set additional parameters
-
compact
public static CompactionApi compact(java.lang.String documentLocation, Document context)
Compacts the referenced document using the context.- Parameters:
documentLocation-IRIreferencing JSON-LD document to compactcontext-Documentrepresenting the context orJsonArrayconsisting ofJsonObjectandJsonStringreferencing the context to use when compacting the document- Returns:
CompactionApiallowing to set additional parameters
-
compact
public static CompactionApi compact(java.net.URI documentUri, Document context)
Compacts the referenced document using the context.- Parameters:
documentUri-URIreferencing JSON-LD document to compactcontext-Documentrepresenting the context orJsonArrayconsisting of one or manyJsonObjectandJsonStringreferencing the context to use when compacting the document- Returns:
CompactionApiallowing to set additional parameters
-
compact
public static CompactionApi compact(Document document, Document context)
CompactsDocumentdocument using the context.- Parameters:
document- to compactcontext- JSON-LD document- Returns:
CompactionApiallowing to set additional parameters
-
compact
public static CompactionApi compact(Document document, java.lang.String contextLocation)
CompactsDocumentdocument using the context.- Parameters:
document- to compactcontextLocation-IRIreferencing the context to use when compacting the document- Returns:
CompactionApiallowing to set additional parameters
-
compact
public static CompactionApi compact(Document document, java.net.URI contextUri)
CompactsDocumentdocument using the context.- Parameters:
document- to compactcontextUri-URIreferencing the context to use when compacting the document- Returns:
CompactionApiallowing to set additional parameters
-
compact
public static CompactionApi compact(java.lang.String documentLocation, java.net.URI contextUri)
CompactsDocumentdocument using the context.- Parameters:
documentLocation-IRIreferencing JSON-LD document to compactcontextUri-URIreferencing the context to use when compacting the document- Returns:
CompactionApiallowing to set additional parameters
-
compact
public static CompactionApi compact(java.net.URI documentUri, java.lang.String contextLocation)
CompactsDocumentdocument using the context.- Parameters:
documentUri-URIreferencing JSON-LD document to compactcontextLocation-IRIreferencing the context to use when compacting the document- Returns:
CompactionApiallowing 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-IRIreferencing JSON-LD document to flatten- Returns:
FlatteningApiallowing 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-URIreferencing JSON-LD document to flatten- Returns:
FlatteningApiallowing 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:
FlatteningApiallowing 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-URIreferencing JSON-LD document to frameframeUri-URIreferencing JSON-LD frame- Returns:
FramingApiallowing 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-IRIreferencing JSON-LD document to frameframeLocation-IRIreferencing JSON-LD frame- Returns:
FramingApiallowing to set additional parameters
-
frame
public static FramingApi frame(Document document, Document frame)
Frames the local document using given local frame.- Parameters:
document- to frameframe- JSON-LD definition- Returns:
FramingApiallowing 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 frameframeLocation-IRIreferencing JSON-LD frame- Returns:
FramingApiallowing 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 frameframeUri-URIreferencing JSON-LD frame- Returns:
FramingApiallowing 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-IRIreferencing JSON-LD document to frameframe- JSON-LD definition- Returns:
FramingApiallowing 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-IRIreferencing JSON-LD document to frameframeUri-URIreferencing JSON-LD frame- Returns:
FramingApiallowing 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-URIreferencing JSON-LD document to frameframe- JSON-LD definition- Returns:
FramingApiallowing 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-URIreferencing JSON-LD document to frameframeLocation-IRIreferencing JSON-LD frame- Returns:
FramingApiallowing to set additional parameters
-
toRdf
public static ToRdfApi toRdf(java.lang.String documentLocation)
Transforms the given input intoRdfDataset.- Parameters:
documentLocation-IRIreferencing JSON-LD document to transform- Returns:
ToRdfApiallowing to set additional parameters
-
toRdf
public static ToRdfApi toRdf(java.net.URI documentUri)
Transforms the given input intoRdfDataset.- Parameters:
documentUri-URIreferencing JSON-LD document to transform- Returns:
ToRdfApiallowing to set additional parameters
-
toRdf
public static ToRdfApi toRdf(Document document)
TransformsDocumentintoRdfDataset.- Parameters:
document- to transform- Returns:
ToRdfApiallowing 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-URIreferencing N-Quads document to expand- Returns:
FromRdfApiallowing 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-URIreferencing N-Quads document to expand- Returns:
FromRdfApiallowing to set additional parameters
-
fromRdf
public static FromRdfApi fromRdf(Document document)
TransformsDocumentinto a JSON-LD document in expanded form.- Parameters:
document- to transform- Returns:
FromRdfApiallowing 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)
-
-