Package com.apicatalog.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.URIgetContextUrl()The value of the HTTP Link header when profile attribute matcheshttp://www.w3.org/ns/json-ld#context.URIgetDocumentUrl()The finalURIof the loaded document.default Optional<jakarta.json.JsonStructure>getJsonContent()Get the document content as parsedJsonStructure.Optional<String>getProfile()The value of anyprofileparameter retrieved as part of the originalgetContentType().default Optional<RdfDataset>getRdfContent()Get the document content as parsedRdfDataset.voidsetContextUrl(URI contextUrl)voidsetDocumentUrl(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
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(URI contextUrl)
-
getDocumentUrl
URI getDocumentUrl()
The finalURIof the loaded document.- Returns:
URIof the loaded document ornullif not available
-
setDocumentUrl
void setDocumentUrl(URI documentUrl)
-
getProfile
Optional<String> getProfile()
The value of anyprofileparameter retrieved as part of the originalgetContentType().- Returns:
- document profile or
Optional.empty()
-
getJsonContent
default Optional<jakarta.json.JsonStructure> getJsonContent()
Get the document content as parsedJsonStructure.- Returns:
JsonStructureorOptional.empty()if document content is not JSON based
-
getRdfContent
default Optional<RdfDataset> getRdfContent()
Get the document content as parsedRdfDataset.- Returns:
RdfDatasetorOptional.empty()if document content is not inapplication/n-quadsrepresentation
-
-