rdf-connect / LDES-Solid-Server

An implementation of an LDES server built within the Community Solid Server
4 stars 1 forks source link
linked-data rdf

ldes-solid-server

npm DOI

Linked data event stream components to configure a community solid server that exposes a LDES. Currently, only a MongoDB backend is supported.

What is a Linked Data Event Stream

A Linked Data Event Stream (LDES) is a collection of immutable objects (such as version objects, sensor observations or archived representation). Each object is described in RDF.

With Linked Data Event Streams, consumers can replicate and stay in sync with a stream of RDF data.

LDES uses the TREE specification, which enables API developers to define relations between HTTP resources. A collection of items is divided into interlinked fragments. A well-known example is paging, but fragments can describe what elements can be found by following the link to another page.

Setup

Local development

# Install local dependencies
npm install
# Compile TS package
npm run build
# Setup server
cd server
npm install
npm start

Use ldes-solid-server as Community Solid Server

# Install the server
npm install ldes-solid-server
# Start the server
npx @solid/community-server -c config.json -f ./data

Required Configuration

See config/default.json for an example ldes-solid-server configuration.

You will probably want to configure a urn:solid-server:default:LDESConfig and a urn:solid-server:default:LDESDBConfig yourself.

LDESConfig

{
  "@id": "urn:solid-server:default:LDESConfig",
  "@type": "LDESViews",
  "views": [
    {
      "@type": "LDESView",
      "prefix": "default",
      "streamId": "http://me#csvStream"
    },
    {
      "@type": "LDESView",
      "prefix": "mine",
      "streamId": "http://mine.org/rdfstream"
    }
  ]
}

LDESDBConfig

http://me#csvStream a https://w3id.org/sds#Stream ; ns0:wasGeneratedBy http://me#readCsv ; ns1:carries http://me#csvShape ; ns1:dataset http://me#dataset .

http://me#readCsv a ns0:Activity ; rdfs:comment "Reads csv file and converts to rdf members" ; prov:used [ a void:Dataset ; void:dataDump file:///data/input.csv ] .

http://me#csvShape a ns1:Member ; ns1:shape http://example.org/ns#PointShape .

http://example.org/ns#PointShape a http://www.w3.org/ns/shacl#NodeShape ; ns2:targetClass http://example.org/ns#Point ; ns2:property [ ns2:path http://example.org/ns#x ; ns2:datatype xsd:integer ; ns2:minCount 1 ; ns2:maxCount 1 ], [ ns2:path http://example.org/ns#y ; ns2:datatype xsd:integer ; ns2:minCount 1 ; ns2:maxCount 1 ] .

http://me#dataset a https://www.w3.org/ns/dcat#Dataset ; ns3:title "Epic dataset" ; ns3:publisher [ foaf:name "Arthur Vercruysse" ] ; ns4:timestampPath http://example.org/ns#time ; ns3:identifier http://localhost:3000/ldes .



### Specific configurations

There is the case where you want to restrict access to an LDES view. 
This can be done by modifying the LDES, which is further explained in [LDES Authorization](docs/Authorization.md)