Package no.hasmac.jsonld.document
Interface Document
-
- All Known Implementing Classes:
JsonDocument
,RdfDocument
public interface Document
A document that can be processed by the processor. This can either beJsonStructure
, representing JSON-LD or JSON document, orRdfDataset
Implemented byJsonDocument
,RdfDocument
, and provided byDocumentParser
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description MediaType
getContentType()
The Content-Type of the loaded document, exclusive of any optional parameters.java.net.URI
getContextUrl()
The value of the HTTP Link header when profile attribute matcheshttp://www.w3.org/ns/json-ld#context
.java.net.URI
getDocumentUrl()
The finalURI
of the loaded document.default java.util.Optional<jakarta.json.JsonStructure>
getJsonContent()
Get the document content as parsedJsonStructure
.java.util.Optional<java.lang.String>
getProfile()
The value of anyprofile
parameter retrieved as part of the originalgetContentType()
.default java.util.Optional<RdfDataset>
getRdfContent()
Get the document content as parsedRdfDataset
.void
setContextUrl(java.net.URI contextUrl)
void
setDocumentUrl(java.net.URI documentUrl)
-
-
-
Method Detail
-
getContentType
MediaType getContentType()
The Content-Type of the loaded document, exclusive of any optional parameters.- Returns:
Content-Type
of the loaded document, nevernull
-
getContextUrl
java.net.URI getContextUrl()
The value of the HTTP Link header when profile attribute matcheshttp://www.w3.org/ns/json-ld#context
.- Returns:
- attached
URI
referencing document context ornull
if not available
-
setContextUrl
void setContextUrl(java.net.URI contextUrl)
-
getDocumentUrl
java.net.URI getDocumentUrl()
The finalURI
of the loaded document.- Returns:
URI
of the loaded document ornull
if not available
-
setDocumentUrl
void setDocumentUrl(java.net.URI documentUrl)
-
getProfile
java.util.Optional<java.lang.String> getProfile()
The value of anyprofile
parameter retrieved as part of the originalgetContentType()
.- Returns:
- document profile or
Optional.empty()
-
getJsonContent
default java.util.Optional<jakarta.json.JsonStructure> getJsonContent()
Get the document content as parsedJsonStructure
.- Returns:
JsonStructure
orOptional.empty()
if document content is not JSON based
-
getRdfContent
default java.util.Optional<RdfDataset> getRdfContent()
Get the document content as parsedRdfDataset
.- Returns:
RdfDataset
orOptional.empty()
if document content is not inapplication/n-quads
representation
-
-