CRUD (RDF Data)
SolidRDFSource
SolidRDFSource
The SolidRDFSource class maps to an RDF resource stored or to be stored in a Solid Pod.
A summary of parameters to the SolidRDFSource class constructors are as follows:
dataset
The RDF dataset (i.e., the set(s) of triples) contained in the resource.
To instantiate, specify the identifier (i.e., the URI) for the resource:
// Locally instantiate a new resource
SolidRDFSource newResource = new SolidRDFSource(
URI.create("https://pod.example.com/resource/path")); // identifier
Optionally, you can also initialize the resource data during instantiation by including an RDF dataset:
// Locally instantiate a new resource with initial RDF Dataset
SolidRDFSource newResourcePopulated = new SolidRDFSource(
URI.create("https://pod.example.com/resource/path"), // identifier
initialDataset); // dataset
You can extended the SolidRDFSource class to model a POJO (Plain Old Java Object) class as an RDF resources. See Modeling an RDF Resource for information on modeling POJOs as RDF resources.
Class Methods
You can:
Use the SolidRDFSource class methods to directly interact with local SolidRDFSource object’s dataset or
Or, if you have extended the class to model a POJO (Plain Old Java Object) class as an RDF resources, use that class methods/members.
public class Expense extends SolidRDFSource { // ... }
Read/Write to Pod
To read RDF resources from your Pod or write RDF resources to your Pod (i.e., CRUD operations), the library provides SolidSyncClient and SolidClient classes. See CRUD Module for details.
For the CRUD operation response headers, you can use SolidRDFSource.getHeaders(). See Headers.
Container
A Container is an RDF resource that can contain other RDF (including other Containers) and non-RDF resources. A Container is analogous to a folder in a file system.
Container URIs always end with a slash /
.
SolidContainer
SolidContainer
The SolidContainer class maps to a Container stored or to be stored in a Solid Pod. [1] The SolidContainer class extends SolidRDFSource.
To instantiate, specify the destination URI for the Container. Container URIs always end with a slash /
.
// Locally instantiate a new Container.
// Container URIs ends with a slash "/"
SolidContainer newResource = new SolidContainer(
URI.create("https://pod.example.com/container/path/"));
Class Methods
You can use SolidContainer class methods to interact with a Container directly. For example, to retrieve all contained resources within a Container, you can use getResources.
Read/Write to Pod
To read Containers from your Pod or write Containers to your Pod (i.e., CRUD operations), the library provides SolidSyncClient and SolidClient classes.
For the CRUD operation response headers, you can use SolidContainer.getHeaders(). See Headers.
Non-RDF Resource
A non-RDF Resource is any non-RDF binary or text file, such as .pdf
, .jpeg
, etc.
SolidNonRDFSource
SolidNonRDFSource
The SolidNonRDFSource class maps to a non-RDF resources stored or to be stored in a Solid Pod.
A summary of parameters to the SolidNonRDFSource class constructors are as follows:
To instantiate, specify the identifier (i.e., the URI), the content type (i.e., MIME type), and the input stream for the resource. For example, the following instantiates a SolidNonRDFSource for a .jpg
file:
MultipartFile file = //... Some .jpg file
// Locally instantiate a new SolidNonRDFSource.
SolidNonRDFSource newNonRDFSource = new SolidNonRDFSource(
URI.create("https://pod.example.com/container1/somePic.jpg"), // identifier
file.getContentType(), // MIME type
file.getInputStream()); // InputStream
Read/Write to Pod
To read non-RDF resources from your Pod or write non-RDF resources to your Pod (i.e., CRUD operations), the library provides SolidSyncClient and SolidClient classes. See CRUD Module for details.
For the CRUD operation response headers, you can use SolidNonRDFSource.getHeaders(). See Headers.
Last updated