Package no.hasmac.jsonld.document
Interface Document
-
- All Known Implementing Classes:
JsonDocument,RdfDocument
public interface DocumentA document that can be processed by the processor. This can either beJsonStructure, representing JSON-LD or JSON document, orRdfDatasetImplemented byJsonDocument,RdfDocument, and provided byDocumentParser.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description MediaTypegetContentType()The Content-Type of the loaded document, exclusive of any optional parameters.java.net.URIgetContextUrl()The value of the HTTP Link header when profile attribute matcheshttp://www.w3.org/ns/json-ld#context.java.net.URIgetDocumentUrl()The finalURIof 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 anyprofileparameter retrieved as part of the originalgetContentType().default java.util.Optional<RdfDataset>getRdfContent()Get the document content as parsedRdfDataset.voidsetContextUrl(java.net.URI contextUrl)voidsetDocumentUrl(java.net.URI documentUrl)
-
-
-
Method Detail
-
getContentType
MediaType getContentType()
The Content-Type of the loaded document, exclusive of any optional parameters.- Returns:
Content-Typeof 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
URIreferencing document context ornullif not available
-
setContextUrl
void setContextUrl(java.net.URI contextUrl)
-
getDocumentUrl
java.net.URI getDocumentUrl()
The finalURIof the loaded document.- Returns:
URIof the loaded document ornullif not available
-
setDocumentUrl
void setDocumentUrl(java.net.URI documentUrl)
-
getProfile
java.util.Optional<java.lang.String> getProfile()
The value of anyprofileparameter 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:
JsonStructureorOptional.empty()if document content is not JSON based
-
getRdfContent
default java.util.Optional<RdfDataset> getRdfContent()
Get the document content as parsedRdfDataset.- Returns:
RdfDatasetorOptional.empty()if document content is not inapplication/n-quadsrepresentation
-
-