Package no.hasmac.jsonld
Class JsonLd
- java.lang.Object
-
- no.hasmac.jsonld.JsonLd
-
public final class JsonLd extends java.lang.Object
TheJsonLd
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 Summary
Fields Modifier and Type Field Description private static java.lang.String
CONTEXT_PARAM_NAME
private static java.lang.String
DOCUMENT_LOCATION_PARAM_NAME
private static java.lang.String
DOCUMENT_PARAM_NAME
private static java.lang.String
DOCUMENT_URI_PARAM_NAME
private static java.lang.String
FRAME_LOCATION_PARAM_NAME
private static java.lang.String
FRAME_PARAM_NAME
private static java.lang.String
FRAME_URI_PARAM_NAME
-
Constructor Summary
Constructors Modifier Constructor Description private
JsonLd()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static void
assertJsonDocument(Document document, java.lang.String param)
private static java.net.URI
assertLocation(java.lang.String location, java.lang.String param)
private static void
assertNotNull(java.lang.Object value, java.lang.String param)
private static void
assertRdfDocument(Document document, java.lang.String param)
private static void
assertUri(java.net.URI uri, java.lang.String param)
static CompactionApi
compact(java.lang.String documentLocation, java.lang.String contextLocation)
Compacts the referenced document using the context.static CompactionApi
compact(java.lang.String documentLocation, java.net.URI contextUri)
CompactsDocument
document using the context.static CompactionApi
compact(java.lang.String documentLocation, Document context)
Compacts the referenced document using the context.static CompactionApi
compact(java.net.URI documentUri, java.lang.String contextLocation)
CompactsDocument
document using the context.static CompactionApi
compact(java.net.URI documentUri, java.net.URI contextUri)
Compacts the referenced document using the context.static CompactionApi
compact(java.net.URI documentUri, Document context)
Compacts the referenced document using the context.static CompactionApi
compact(Document document, java.lang.String contextLocation)
CompactsDocument
document using the context.static CompactionApi
compact(Document document, java.net.URI contextUri)
CompactsDocument
document using the context.static CompactionApi
compact(Document document, Document context)
CompactsDocument
document using the context.static ExpansionApi
expand(java.lang.String documentLocation)
Expands the referenced document.static ExpansionApi
expand(java.net.URI documentUri)
Expands the referenced document.static ExpansionApi
expand(Document document)
Expands the provided remote document.static FlatteningApi
flatten(java.lang.String documentLocation)
Flattens the given input and optionally compacts it using context.static FlatteningApi
flatten(java.net.URI documentUri)
Flattens the given input and optionally compacts it using context.static FlatteningApi
flatten(Document document)
Flattens the remote input and optionally compacts it using context.static FramingApi
frame(java.lang.String documentLocation, java.lang.String frameLocation)
Frames the given remote input using remote frame.static FramingApi
frame(java.lang.String documentLocation, java.net.URI frameUri)
Frames the remote input using given remote frame.static FramingApi
frame(java.lang.String documentLocation, Document frame)
Frames the remote input using given local frame.static FramingApi
frame(java.net.URI documentUri, java.lang.String frameLocation)
Frames the remote input using given remote frame.static FramingApi
frame(java.net.URI documentUri, java.net.URI frameUri)
Frames the given remote input using remote frame.static FramingApi
frame(java.net.URI documentUri, Document frame)
Frames the remote input using given local frame.static FramingApi
frame(Document document, java.lang.String frameLocation)
Frames the local document using given remote frame.static FramingApi
frame(Document document, java.net.URI frameUri)
Frames the local document using given remote frame.static FramingApi
frame(Document document, Document frame)
Frames the local document using given local frame.static FromRdfApi
fromRdf(java.lang.String documentLocation)
Transforms the referenced N-Quads document into a JSON-LD document in expanded form.static FromRdfApi
fromRdf(java.net.URI documentUri)
Transforms the referenced N-Quads document into a JSON-LD document in expanded form.static FromRdfApi
fromRdf(Document document)
TransformsDocument
into a JSON-LD document in expanded form.static ToRdfApi
toRdf(java.lang.String documentLocation)
Transforms the given input intoRdfDataset
.static ToRdfApi
toRdf(java.net.URI documentUri)
Transforms the given input intoRdfDataset
.static ToRdfApi
toRdf(Document document)
TransformsDocument
intoRdfDataset
.
-
-
-
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
-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 compactcontextLocation
-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 compactcontextUri
-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 compactcontext
-Document
representing the context orJsonArray
consisting ofJsonObject
andJsonString
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 compactcontext
-Document
representing the context orJsonArray
consisting of one or manyJsonObject
andJsonString
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)
CompactsDocument
document using the context.- Parameters:
document
- to compactcontext
- JSON-LD document- Returns:
CompactionApi
allowing to set additional parameters
-
compact
public static CompactionApi compact(Document document, java.lang.String contextLocation)
CompactsDocument
document using the context.- Parameters:
document
- to compactcontextLocation
-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)
CompactsDocument
document using the context.- Parameters:
document
- to compactcontextUri
-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)
CompactsDocument
document using the context.- Parameters:
documentLocation
-IRI
referencing JSON-LD document to compactcontextUri
-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)
CompactsDocument
document using the context.- Parameters:
documentUri
-URI
referencing JSON-LD document to compactcontextLocation
-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 frameframeUri
-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 frameframeLocation
-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 frameframe
- 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 frameframeLocation
-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 frameframeUri
-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 frameframe
- 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 frameframeUri
-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 frameframe
- 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 frameframeLocation
-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 intoRdfDataset
.- 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 intoRdfDataset
.- Parameters:
documentUri
-URI
referencing JSON-LD document to transform- Returns:
ToRdfApi
allowing to set additional parameters
-
toRdf
public static ToRdfApi toRdf(Document document)
TransformsDocument
intoRdfDataset
.- Parameters:
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)
TransformsDocument
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)
-
-