Class RdfDocument
java.lang.Object
no.hasmac.jsonld.document.RdfDocument
- All Implemented Interfaces:
Document
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MediaTypeprivate URIprivate final RdfDatasetprivate URIprivate final String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateRdfDocument(MediaType type, String profile, RdfDataset dataset) -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanprivate static voidassertContentType(MediaType contentType) The 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 finalURIof the loaded document.The value of anyprofileparameter retrieved as part of the originalDocument.getContentType().Get the document content as parsedRdfDataset.static RdfDocumentof(InputStream is) Create a new document from content provided byInputStream.static DocumentCreate a new document from content provided byReader.static RdfDocumentof(MediaType type, InputStream is) static Documentstatic Documentof(MediaType contentType, RdfDataset dataset) Create a new document fromRdfDataset.static Documentof(RdfDataset dataset) Create a new document fromRdfDataset.voidsetContextUrl(URI contextUrl) voidsetDocumentUrl(URI documentUrl) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Document
getJsonContent
-
Field Details
-
contentType
-
dataset
-
profile
-
documentUrl
-
contentUrl
-
-
Constructor Details
-
RdfDocument
-
-
Method Details
-
of
Create a new document fromRdfDataset. SetsMediaType.N_QUADSas the content type.- Parameters:
dataset- representing parsed RDF content- Returns:
Documentrepresenting RDF document
-
of
Create a new document fromRdfDataset.- Parameters:
contentType- reflecting the providedRdfDataset, onlyMediaType.N_QUADSis supporteddataset- representing parsed RDF content- Returns:
Documentrepresenting RDF document
-
of
Create a new document from content provided byInputStream. SetsMediaType.N_QUADSas the content type.- Parameters:
is- representing parsed RDF content- Returns:
Documentrepresenting RDF document- Throws:
JsonLdError
-
of
- Throws:
JsonLdError
-
of
Create a new document from content provided byReader. SetsMediaType.N_QUADSas the content type.- Parameters:
reader- providing RDF content- Returns:
Documentrepresenting RDF document- Throws:
JsonLdError
-
of
- Throws:
JsonLdError
-
accepts
-
assertContentType
-
getContentType
Description copied from interface:DocumentThe Content-Type of the loaded document, exclusive of any optional parameters.- Specified by:
getContentTypein interfaceDocument- Returns:
Content-Typeof the loaded document, nevernull
-
getContextUrl
Description copied from interface:DocumentThe value of the HTTP Link header when profile attribute matcheshttp://www.w3.org/ns/json-ld#context.- Specified by:
getContextUrlin interfaceDocument- Returns:
- attached
URIreferencing document context ornullif not available
-
setContextUrl
- Specified by:
setContextUrlin interfaceDocument
-
getDocumentUrl
-
setDocumentUrl
- Specified by:
setDocumentUrlin interfaceDocument
-
getProfile
Description copied from interface:DocumentThe value of anyprofileparameter retrieved as part of the originalDocument.getContentType().- Specified by:
getProfilein interfaceDocument- Returns:
- document profile or
Optional.empty()
-
getRdfContent
Description copied from interface:DocumentGet the document content as parsedRdfDataset.- Specified by:
getRdfContentin interfaceDocument- Returns:
RdfDatasetorOptional.empty()if document content is not inapplication/n-quadsrepresentation
-