@ldo/solid is a client that implements the Solid specification with the use of Linked Data Objects.
The `@ldo/connected-nextgraph` library allows you to integrate [NextGraph](https://nextgraph.org) with the [LDO](https://ldo.js.org) ecosystem. It provides a `ConnectedLdoDataset` that manages RDF data across decentralized NextGraph resources with real-time synchronization and read/write capabilities.
## Installation
Navigate into your project's root folder and run the following command:
```
cd my_project/
npx run @ldo/cli init
First, install the required libraries:
```bash
npm install nextgraph @ldo/connected-nextgraph
```
Now install the @ldo/solid library
## Usage:
### 1. Setup: Create a ConnectedLdoDataset
```ts
import { createNextGraphLdoDataset } from "@ldo/connected-nextgraph";
// Create the dataset
const ldoDataset = createNextGraphLdoDataset();
```
npm i @ldo/solid
### 2. Connect to a NextGraph Wallet Session
Before you can create or access resources, you need an active session:
Below is a simple example of @ldo/solid. Assume that a ShapeType was previously generated and placed at `./.ldo/foafProfile.shapeTypes`. Also assume we have a shape type for social media at `./.ldo/socialMediaPost.shapeTypes`
```typescript
import { changeData, commitData, createSolidLdoDataset } from "@ldo/solid";
import { fetch, getDefaultSession } from "@inrupt/solid-client-authn-browser";
import { FoafProfileShapeType } from "./.ldo/foafProfile.shapeTypes";
import { SocialMediaPostShapeType } from "./.ldo/socialMediaPost.shapeTypes";
@ldo/solid is a client that implements the Solid specification with the use of Linked Data Objects.
@ldo/connected provides tools for LDO to connect to a remote datasource. It requires plugins for that datasource.
## Installation
@ -13,7 +13,13 @@ npx run @ldo/cli init
Now install the @ldo/solid library
```
npm i @ldo/solid
npm i @ldo/connected
```
You may also install a connected plugin, for example `@ldo/connected-solid` and `@ldo/connected-nextgraph`.
```
npm i @ldo/connected-nextgraph
```
<details>
@ -33,53 +39,84 @@ npm i @ldo/ldo @ldo/solid
Below is a simple example of @ldo/solid. Assume that a ShapeType was previously generated and placed at `./.ldo/foafProfile.shapeTypes`. Also assume we have a shape type for social media at `./.ldo/socialMediaPost.shapeTypes`
```typescript
import { changeData, commitData, createSolidLdoDataset } from "@ldo/solid";
import { fetch, getDefaultSession } from "@inrupt/solid-client-authn-browser";
import {
changeData,
commitData,
createConnectedLdoDataset
} from "@ldo/connected";
import { solidConnectedPlugin } from "@ldo/connected-solid";
import { nextGraphConnectedPlugin } from "@ldo/connected-nextgraph";
// Shape Types
import { FoafProfileShapeType } from "./.ldo/foafProfile.shapeTypes";
import { SocialMediaPostShapeType } from "./.ldo/socialMediaPost.shapeTypes";
// These are tools for Solid and NextGraph outside of the LDO ecosystem
import { fetch, getDefaultSession } from "@inrupt/solid-client-authn-browser";
This project was made possible by a grant from NGI Zero Entrust via nlnet. Learn more on the [NLnet project page](https://nlnet.nl/project/SolidUsableApps/).