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 be
JsonStructure
, representing JSON-LD or JSON document,
or RdfDataset
Implemented by JsonDocument
, RdfDocument
, and provided by DocumentParser
.-
Method Summary
Modifier and TypeMethodDescriptionThe Content-Type of the loaded document, exclusive of any optional parameters.The value of the HTTP Link header when profile attribute matcheshttp://www.w3.org/ns/json-ld#context
.The finalURI
of the loaded document.default Optional
<jakarta.json.JsonStructure> Get the document content as parsedJsonStructure
.The value of anyprofile
parameter retrieved as part of the originalgetContentType()
.default Optional
<RdfDataset> Get the document content as parsedRdfDataset
.void
setContextUrl
(URI contextUrl) void
setDocumentUrl
(URI documentUrl)
-
Method Details
-
getContentType
MediaType getContentType()The Content-Type of the loaded document, exclusive of any optional parameters.- Returns:
Content-Type
of the loaded document, nevernull
-
getContextUrl
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
-
getDocumentUrl
URI getDocumentUrl()The finalURI
of the loaded document.- Returns:
URI
of the loaded document ornull
if not available
-
setDocumentUrl
-
getProfile
The value of anyprofile
parameter retrieved as part of the originalgetContentType()
.- Returns:
- document profile or
Optional.empty()
-
getJsonContent
Get the document content as parsedJsonStructure
.- Returns:
JsonStructure
orOptional.empty()
if document content is not JSON based
-
getRdfContent
Get the document content as parsedRdfDataset
.- Returns:
RdfDataset
orOptional.empty()
if document content is not inapplication/n-quads
representation
-