Package no.hasmac.jsonld.api
Class ToRdfApi
- java.lang.Object
-
- no.hasmac.jsonld.api.ToRdfApi
-
-
Field Summary
Fields Modifier and Type Field Description private Documentdocumentprivate java.net.URIdocumentUriprivate JsonLdOptionsoptions
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ToRdfApibase(java.net.URI baseUri)Set the baseIRI.ToRdfApicontext(jakarta.json.JsonStructure context)A context that is used to initialize the active context.ToRdfApicontext(java.lang.String contextLocation)A context that is used to initialize the active context.ToRdfApicontext(java.net.URI contextUri)A context that is used to initialize the active context.ToRdfApicontext(Document context)A context that is used to initialize the active context.RdfDatasetget()Transform providedJSON-LDdocument intoRdfDataset.<Triple,Quad,Iri extends Resource,Bnode extends Resource,Resource extends Value,Literal extends Value,Value>
voidget(RdfConsumer<Triple,Quad> rdfConsumer, RdfValueFactory<Triple,Quad,Iri,Bnode,Resource,Literal,Value> rdfValueFactory)Transform providedJSON-LDdocument intoRdfDataset.ToRdfApiloader(DocumentLoader loader)Set the loader to be used to retrieve remote documents and contexts, implementing theDocumentLoader.ToRdfApimode(JsonLdVersion processingMode)SetJSON-LDprocessing mode.ToRdfApinumericId()Experimental: Accept numeric @id.ToRdfApioptions(JsonLdOptions options)Override an existing settings withJsonLdOptions.ToRdfApiordered(boolean enable)If set totrue, certain algorithm processing steps are ordered lexicographically.ToRdfApiproduceGeneralizedRdf()The JSON-LD processor may emit blank nodes for triple predicates.ToRdfApiproduceGeneralizedRdf(boolean enable)If set to true, the JSON-LD processor may emit blank nodes for triple predicates, otherwise they will be omitted.ToRdfApirdfDirection(JsonLdOptions.RdfDirection direction)Determines how value objects containing a base direction are transformed to and from RDF.
-
-
-
Field Detail
-
document
private final Document document
-
documentUri
private final java.net.URI documentUri
-
options
private JsonLdOptions options
-
-
Constructor Detail
-
ToRdfApi
public ToRdfApi(java.net.URI documentUri)
-
ToRdfApi
public ToRdfApi(Document document)
-
-
Method Detail
-
options
public ToRdfApi options(JsonLdOptions options)
Description copied from interface:CommonApiOverride an existing settings withJsonLdOptions.- Specified by:
optionsin interfaceCommonApi<ToRdfApi>- Parameters:
options-JsonLdOptions- Returns:
- builder instance
-
context
public ToRdfApi context(java.net.URI contextUri)
Description copied from interface:ContextApiA context that is used to initialize the active context.- Specified by:
contextin interfaceContextApi<ToRdfApi>- Parameters:
contextUri-URIreferring to a context- Returns:
- builder instance
-
context
public ToRdfApi context(java.lang.String contextLocation)
Description copied from interface:ContextApiA context that is used to initialize the active context.- Specified by:
contextin interfaceContextApi<ToRdfApi>- Parameters:
contextLocation-IRIreferring to a context- Returns:
- builder instance
-
context
public ToRdfApi context(jakarta.json.JsonStructure context)
Description copied from interface:ContextApiA context that is used to initialize the active context.- Specified by:
contextin interfaceContextApi<ToRdfApi>- Parameters:
context-JsonObject, a sequence ofJsonObject, or aJsonStringrepresenting anIRI- Returns:
- builder instance
-
context
public ToRdfApi context(Document context)
Description copied from interface:ContextApiA context that is used to initialize the active context.- Specified by:
contextin interfaceContextApi<ToRdfApi>- Parameters:
context-Documentrepresenting a context- Returns:
- builder instance
-
produceGeneralizedRdf
public ToRdfApi produceGeneralizedRdf(boolean enable)
If set to true, the JSON-LD processor may emit blank nodes for triple predicates, otherwise they will be omitted.- Parameters:
enable-- Returns:
- builder instance
-
produceGeneralizedRdf
public ToRdfApi produceGeneralizedRdf()
The JSON-LD processor may emit blank nodes for triple predicates.- Returns:
- builder instance
-
rdfDirection
public ToRdfApi rdfDirection(JsonLdOptions.RdfDirection direction)
Determines how value objects containing a base direction are transformed to and from RDF.- Parameters:
direction-- Returns:
- builder instance
-
mode
public ToRdfApi mode(JsonLdVersion processingMode)
Description copied from interface:CommonApiSetJSON-LDprocessing mode. JSON-LD 1.1 is set by default.
-
base
public ToRdfApi base(java.net.URI baseUri)
Description copied from interface:CommonApiSet the baseIRI. If set, this overrides the input document's IRI.
-
loader
public ToRdfApi loader(DocumentLoader 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.
-
ordered
public ToRdfApi ordered(boolean enable)
Description copied from interface:CommonApiIf set totrue, certain algorithm processing steps are ordered lexicographically. Iffalse, order is not considered in processing.
-
get
public RdfDataset get() throws JsonLdError
Transform providedJSON-LDdocument intoRdfDataset.- Returns:
RdfDatasetrepresenting providedJSON-LDdocument- Throws:
JsonLdError
-
get
public <Triple,Quad,Iri extends Resource,Bnode extends Resource,Resource extends Value,Literal extends Value,Value> void get(RdfConsumer<Triple,Quad> rdfConsumer, RdfValueFactory<Triple,Quad,Iri,Bnode,Resource,Literal,Value> rdfValueFactory) throws JsonLdError
Transform providedJSON-LDdocument intoRdfDataset.- Throws:
JsonLdError
-
numericId
public ToRdfApi numericId()
Experimental: Accept numeric @id. Disabled by default.- Returns:
- builder instance
-
-