Package com.inrupt.client
Class RDFSource
java.lang.Object
com.inrupt.rdf.wrapping.commons.WrapperDataset
com.inrupt.client.RDFSource
- All Implemented Interfaces:
Resource,AutoCloseable,Dataset,GraphLike<Quad>
- Direct Known Subclasses:
SolidRDFSource,WebIdProfile
A base class for RDF-based resource mapping.
This class can be used as a basis for object mapping with higher-level client applications.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreate a new RDF-bearing resource.protectedCreate a new RDF-bearing resource.protectedCreate a new RDF-bearing resource.protectedCreate a new RDF-bearing resource. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()The content type of the resource.The resource entity.The resource headers.The resource identifier.voidserialize(RDFSyntax syntax, OutputStream out) Serialize this object with a defined RDF syntax.validate()Validate the dataset for this object.Methods inherited from class com.inrupt.rdf.wrapping.commons.WrapperDataset
add, add, clear, contains, contains, getGraph, getGraph, getGraphNames, remove, remove, size, stream, stream
-
Field Details
-
rdf
The RDF Factory instance.
-
-
Constructor Details
-
RDFSource
Create a new RDF-bearing resource.Subclasses should have the same constructor signature to work with the provided object mapping mechanism.
- Parameters:
identifier- the resource identifierdataset- the dataset corresponding to this resource, may benull
-
RDFSource
Create a new RDF-bearing resource.Subclasses should have the same constructor signature to work with the provided object mapping mechanism.
- Parameters:
identifier- the resource identifierdataset- the dataset corresponding to this resource, may benullheaders- header values associated with the resource, may benull
-
RDFSource
Create a new RDF-bearing resource.Subclasses should have the same constructor signature to work with the provided object mapping mechanism.
- Parameters:
identifier- the resource identifiersyntax- the original RDF syntax in usedataset- the dataset corresponding to this resource, may benull
-
RDFSource
Create a new RDF-bearing resource.Subclasses should have the same constructor signature to work with the provided object mapping mechanism.
- Parameters:
identifier- the resource identifiersyntax- the original RDF syntax in usedataset- the dataset corresponding to this resource, may benullheaders- header values associated with the resource, may benull
-
-
Method Details
-
getIdentifier
Description copied from interface:ResourceThe resource identifier.- Specified by:
getIdentifierin interfaceResource- Returns:
- the identifier
-
getContentType
Description copied from interface:ResourceThe content type of the resource.- Specified by:
getContentTypein interfaceResource- Returns:
- the content type
-
getHeaders
Description copied from interface:ResourceThe resource headers.- Specified by:
getHeadersin interfaceResource- Returns:
- the resource headers
-
getEntity
Description copied from interface:ResourceThe resource entity.- Specified by:
getEntityin interfaceResource- Returns:
- the resource entity
- Throws:
IOException- in the case of an error when generating the entity
-
serialize
Serialize this object with a defined RDF syntax.- Parameters:
syntax- the RDF syntaxout- the output stream- Throws:
IOException- in the case of an I/O error
-
validate
Validate the dataset for this object.Subclasses may override this method to perform validation on the provided dataset. By default, this method is a no-op.
- Returns:
- the validation result
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceDataset
-