share-nodesCRUD (RDF Data)

SolidRDFSource

The SolidRDFSourcearrow-up-right class maps to an RDF resource stored or to be stored in a Solid Pod.

A summary of parameters to the SolidRDFSourcearrow-up-right class constructors are as follows:

Field
Type
Description

identifier

The URI (Uniform Resource Identifier) of the resource.

dataset

The RDF datasetarrow-up-right (i.e., the set(s) of triples) contained in the resource.

headers

Collection of HTTP headers.

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 datasetarrow-up-right:

// 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 SolidRDFSourcearrow-up-right 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:

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 SolidSyncClientarrow-up-right and SolidClientarrow-up-right classes. See CRUD Module for details.

circle-info

When saving a new resource to a Pod (e.g., https://pod.example.com/container1/container2/resource), if any Container in the resource path does not exist (e.g., container1/ and container2/), the SolidSyncClient.create()arrow-up-right and SolidClient.create()arrow-up-right methods creates the missing containers as well.

For the CRUD operation response headers, you can use SolidRDFSource.getHeaders()arrow-up-right. 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.

circle-exclamation

SolidContainer

The SolidContainerarrow-up-right class maps to a Container stored or to be stored in a Solid Pod. [1] The SolidContainerarrow-up-right class extends SolidRDFSourcearrow-up-right.

To instantiate, specify the destination URI for the Container. Container URIs always end with a slash /.

Class Methods

You can use SolidContainerarrow-up-right class methodsarrow-up-right to interact with a Container directly. For example, to retrieve all contained resources within a Container, you can use getResourcesarrow-up-right.

Read/Write to Pod

To read Containers from your Pod or write Containers to your Pod (i.e., CRUD operations), the library provides SolidSyncClientarrow-up-right and SolidClientarrow-up-right classes.

circle-info

Tip

For the CRUD operation response headers, you can use SolidContainer.getHeaders()arrow-up-right. See Headers.

Non-RDF Resource

A non-RDF Resource is any non-RDF binary or text file, such as .pdf, .jpeg, etc.

SolidNonRDFSource

The SolidNonRDFSourcearrow-up-right class maps to a non-RDF resources stored or to be stored in a Solid Pod.

A summary of parameters to the SolidNonRDFSourcearrow-up-right class constructors are as follows:

Field
Type
Description

identifier

The URI (Uniform Resource Identifier) of the resource.

contentType

The MIME type for the file.

entity

Input stream of the file content.

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:

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 SolidSyncClientarrow-up-right and SolidClientarrow-up-right classes. See CRUD Module for details.

circle-info

Tip

When saving a new resource to a Pod (e.g., https://pod.example.com/container1/container2/somePic.jpg), if any Container in the resource path does not exist (e.g., container1/ and container2/), the SolidSyncClient.create()arrow-up-right and SolidClient.create()arrow-up-right methods creates the missing containers as well.

For the CRUD operation response headers, you can use SolidNonRDFSource.getHeaders()arrow-up-right. See Headers.

Last updated