0% found this document useful (0 votes)
54 views9 pages

Solid Project

Solid is a decentralized approach to the web that allows users to control their own data by storing it on personal pods. Solid defines protocols for authentication, authorization, content representation, and social web applications. Pods are personal web servers that store linked data in RDF format, accessible through unique URLs. The Solid client library provides an abstraction layer to access data stored on pods using RDF principles. Structured data is stored as things within solid datasets on pods and the URL structure is used to navigate containers and things.

Uploaded by

Himanshu Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views9 pages

Solid Project

Solid is a decentralized approach to the web that allows users to control their own data by storing it on personal pods. Solid defines protocols for authentication, authorization, content representation, and social web applications. Pods are personal web servers that store linked data in RDF format, accessible through unique URLs. The Solid client library provides an abstraction layer to access data stored on pods using RDF principles. Structured data is stored as things within solid datasets on pods and the URL structure is used to navigate containers and things.

Uploaded by

Himanshu Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Solid Project 1/9

_____________________________________________________________________________________________________

17-Nov-2022
What is Solid?
Solid means SOcial LInked Data
Solid is an attempt to re-decentralize the web.
Solid is a tech stack, a group of related protocols and
implementations,
Provides neat separation of app and data thus allowing users
to control and migrate data independent of Apps.
Solid defines
1. Authentication
2. Authorization (and access control)
3. Content representation
4. Identity
5. Profiles
6. Resource (reading and writing) API
7. Social Web App Protocols for Notifications, Friends
Lists, Followers, Following etc

What is Pod?
Pods are secure personal web servers for data allowing users
to control data thus allowing the same data to be used by
different Apps as per permissions.
stores linked data
Users store data wherever they want. Your personal data likely
resides on your pod. Each data-set residing on Pod is
accessible through a unique URL, controlled using
Authorization.
Solid Project 2/9
_____________________________________________________________________________________________________

What is SOLID CLIENT


Solid-client is a library used for accessing data stored in
Solid Pods. It provides an abstraction layer on top of both
Solid and Resource Description Framework (RDF) principles and
is compatible with the RDF/JS specification.
1. https://github.com/solid-contrib/solid-node-client
2. https://docs.inrupt.com/developer-tools/javascript/client
-libraries/reference/solid-client/
3. https://solidproject.org/developers/tools/

What is RDF (Resource Description Framework)


A standard designed as a data model for metadata, used for
description and exchange of graph data. RDF provides a variety
of syntax notations and data serialisation formats.
RDF is a directed graph composed of SUBJECT, OBJECT and
CONNECTING ARC, each of the three parts of the statement can
Solid Project 3/9
_____________________________________________________________________________________________________

be identified by a URI. RDF statements express relationships


between resources, such as documents and data objects.

OIDC (OpenID Connect)


Used by resource servers to verify the identity of relying
parties and end users based on the authentication performed by
an OpenID provider.

Resource Server (RS)


A server hosting resources, possibly protected by access
control policies.

WEBID
It is a resource Identifier used to identify Agents i.e.
people and organisations as well as to manage their access
rights though Web Access Control.
Solid Project 4/9
_____________________________________________________________________________________________________

Authentication Example
We are using "@inrupt/solid-client-authn-browser" Library

//On button click for example


//– Create Session
const session = new Session();
//If user not already logged in , initiate login process
//using SOLID_IDENTITY_PROVIDER such as https://solidcommunity.net/
//and clientName (Unique Name of Your App)
if (!session.info.isLoggedIn) {
await session.login({
oidcIssuer: SOLID_IDENTITY_PROVIDER,
clientName: "MyUniqueAppName",
redirectUrl: window.location.href
});
}
//Once Auth succeeds get WebID
async function handleRedirectAfterLogin() {
await session.handleIncomingRedirect(window.location.href);
if (session.info.isLoggedIn) {
var webId=session.info.webId;
}
}

Reading Structured Data from Pod


Structured data is data structured as Things in SolidDatasets.
Thing : is what we want to save
SolidDataset : A Set of Things. Things are NOT stored
independently, always part of SolidDataSet.
Example : Course is a SolidDataset and books,Videos etc are
Things of that SolidDataset.
Solid Project 5/9
_____________________________________________________________________________________________________

How to read data


1. Authenticate
2. Pass fetch function of Session to make read request
What is the fetch() function ?
– A function associated with Session of logged-in user, used
to identify logged-in user at Server
//We want to interact with User's profile and hence getting
//URL associated with WebID
const profileDocumentUrl = new URL(webID);

//Get DataSet
const myDataset = await getSolidDataset(
profileDocumentUrl,
{ fetch: session.fetch }
);

//Get a Thing and Use


const profile = getThing(myDataset, webID);

How to write data


let myProfileDataset = await getSolidDataset(profileDocumentUrl, {
fetch: session.fetch,
});

// The profile data is a "Thing" in the profile dataset.


let profile = getThing(myProfileDataset, webID);

//make changes to profile


profile. …..

// Write back the profile to the dataset.


myProfileDataset = setThing(myProfileDataset, profile);

// Write back the dataset to your Pod.


Solid Project 6/9
_____________________________________________________________________________________________________

await saveSolidDatasetAt(profileDocumentUrl, myProfileDataset, {


fetch: session.fetch,
});

Containers
A container is an organiser for SolidDatasets.
A Container can contain SolidDatasets and other Resources,
including other Containers. Containers are analogous to
folders in a directory structure.

URLS
URL OF POD
https://storage.inrupt.com/<Pod Identifier>

URL OF CONTAINER INSIDE POD


https://storage.inrupt.com/<Pod Identifier>/group

URL OF CONTAINER INSIDE CONTAINER INSIDE POD


https://storage.inrupt.com/<Pod Identifier>/group/person1

URL OF THING INSIDE CONTAINER INSIDE CONTAINER INSIDE POD


https://storage.inrupt.com/<Pod Identifier>/group/person1/birthdate

Read Write example from Repo

async function getOrCreateMessageList(fetch) {


const indexUrl = POD_URL + "messages/message.txt";
try {
const messageList = await getSolidDataset(indexUrl, { fetch });
return messageList;
} catch (error) {
if (error.statusCode === 404) {
const messageList = await saveSolidDatasetAt(
indexUrl,
createSolidDataset(),
{
fetch,
}
Solid Project 7/9
_____________________________________________________________________________________________________

);
return messageList;
}
}
}

async function saveMessage(text) {


const indexUrl = getSourceUrl(messageList);
const messageWithText = addStringNoLocale(createThing(),
TEXT_PREDICATE, text);
const messageWithDate = addDatetime(messageWithText,
CREATED_PREDICATE, new Date());
const updatedmessageList = setThing(messageList, messageWithDate);
const updatedDataset = await saveSolidDatasetAt(indexUrl,
updatedmessageList, {
fetch: session.fetch,
});
console.log('-------After update');
console.log(JSON.stringify(updatedDataset));
}

RDF Schema
Schema.org vocabularies are developed by an open community
process.
A shared vocabulary makes it easier for webmasters and
developers to decide on a schema and get the maximum benefit
for their efforts. It is in this spirit that the founders,
together with the larger community have come together - to
provide a shared collection of schemas.
Organization of Schemas
The schemas are a set of 'types', each associated with a set
of properties. The types are arranged in a hierarchy.
Solid Project 8/9
_____________________________________________________________________________________________________

The vocabulary currently consists of 797 Types, 1457


Properties 14 Datatypes, 86 Enumerations and 462 Enumeration
members.

Example Structured Document in POD

@prefix : <#>.
@prefix cal: <http://www.w3.org/2002/12/cal/ical#>.
@prefix schema: <http://schema.org/>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.

:166868977026629556281389725747
schema:text "Test"; cal:created
"2022-11-17T12:56:10.266Z"^^xsd:dateTime.
:16686898353003048445806857345
schema:text "Another Message";
cal:created "2022-11-17T12:57:15.301Z"^^xsd:dateTime.
:166869010453531686706272966414
schema:text "Test2"; cal:created
"2022-11-17T13:01:44.535Z"^^xsd:dateTime.

IRI
The Internationalized Resource Identifier (IRI) is an
extension of URI that may additionally contain most characters
from the Universal Character Set (Unicode/ISO 10646).

Vocabularies
Used to make data independent from applications, so that one
can be in control of his/her own data and share it with the
apps of his/her choice. Thus universal data format is
required. This allows Apps to understand and validate
structured data in a seamless manner.
Creating vocabulary is a step by step process. More details:
https://solidproject.org/developers/vocabularies/create/quickstart
Solid Project 9/9
_____________________________________________________________________________________________________

JSON-LD (JSON for Linking Data)


JSON-LD is a lightweight Linked Data format. It is easy for
humans to read and write. It is based on the already
successful JSON format and provides a way to help JSON data
interoperate at Web-scale. JSON-LD is an ideal data format for
programming environments, REST Web services etc.
In SOLID, most libraries exchange RDF data in JSON-LD format.
Example:
https://jsonld.com/person/
—------------------ To be continued —-------------------------------
Repo :
https://bitbucket.org/consciousmission/solid-pod/src/master/

You might also like