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 Details

    • getContentType

      MediaType getContentType()
      The Content-Type of the loaded document, exclusive of any optional parameters.
      Returns:
      Content-Type of the loaded document, never null
    • getContextUrl

      URI getContextUrl()
      The value of the HTTP Link header when profile attribute matches http://www.w3.org/ns/json-ld#context.
      Returns:
      attached URI referencing document context or null if not available
    • setContextUrl

      void setContextUrl(URI contextUrl)
    • getDocumentUrl

      URI getDocumentUrl()
      The final URI of the loaded document.
      Returns:
      URI of the loaded document or null if not available
    • setDocumentUrl

      void setDocumentUrl(URI documentUrl)
    • getProfile

      Optional<String> getProfile()
      The value of any profile parameter retrieved as part of the original getContentType().
      Returns:
      document profile or Optional.empty()
    • getJsonContent

      default Optional<jakarta.json.JsonStructure> getJsonContent()
      Get the document content as parsed JsonStructure.
      Returns:
      JsonStructure or Optional.empty() if document content is not JSON based
    • getRdfContent

      default Optional<RdfDataset> getRdfContent()
      Get the document content as parsed RdfDataset.
      Returns:
      RdfDataset or Optional.empty() if document content is not in application/n-quads representation