npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ldes-solid-server

v0.1.7

Published

[![npm](https://img.shields.io/npm/v/ldes-solid-server)](https://www.npmjs.com/package/ldes-solid-server) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7702103.svg)](https://doi.org/10.5281/zenodo.7702103)

Downloads

220

Readme

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

  • views takes multiple view configurations. It is expected that information about each view can be found in the database. Specify the prefix and the stream identifier.
{
  "@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

  • optional: dbUrl specifies the mongodb location, defaults to "mongodb://localhost:27017/ldes".
  • dataCollection specifies the data collection, this collection contains the entire LDES dataset. JSON objects with the following fields:
    • id of the member
    • data raw turtle representing the datat
    • optional timestamp specified by the LDES
  • indexCollection specifies the index collection, this collection contains information about all fragments and links between fragments. JSON objects with the following fields:
    • streamId is the identifier of the consumed stream.
    • id of the fragment (can be empty)
    • count specifies the number of members already present in this fragment
    • members is an array of all contained members
    • relations is an array with all relations starting from this fragment. JSON objects with the following fields:
      • type of the relation
      • value of the relation
      • bucket is the target fragment id
      • path of the relation
  • metaCollection specifies the metadata collection, this collection contains information about each ingested stream. JSON objects with following fields:
    • id the id of the ingested stream.
    • type specifies the metadata type. Often "https://w3id.org/sds#Stream".
    • value the actual metadata, example below:
@prefix ns0: <http://purl.org/net/p-plan#> .
@prefix ns1: <https://w3id.org/sds#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix void: <http://rdfs.org/ns/void#> .
@prefix ns2: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix ns3: <https://www.w3.org/ns/dcat#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix ns4: <https://w3id.org/ldes#> .

<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