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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@uvdsl/solid-rdf-store

v0.1.3

Published

A small library that provides an RDF store with Web fetching and reactive results.

Readme

NPM Version

Solid RDF Store

A small library that provides an RDF store with Web fetching and reactive results. We use n3 as the underlying RDF library. The store may use the Session object of this Solid-OIDC implementation to make authenticated requests to fetch RDF data from the Web.

Main idea of this small library is to provide reactive results. That is, when the data that underlies a query result changes, the query result is updated automatically. When a dataset on the Web is updated, and that updated dataset is fetched by the store (triggered manually for now), then any query result (obtained via the reactive query method) is updated automatically by the store. Thus, reactivity frameworks of Vue, React, Angular, ... can update the UI automatically. Other routines may be triggered with that as well.

The store - WebReactiveQuintStore

A QuintStore is a set of Quints (s,p,o,g,d). It thus keeps track of where datasets where retrieved from.

This is the web version (manual edition), call store.getQuintReactiveFromWeb(...) to fetch a dataset from the web if it is not already loaded into the store. That is, dataset d of the quint is fetched. Datasets are lazy loaded, and not updated automatically: Call store.updateFromWeb(...) to trigger a re-load of a dataset.

Then, whenever the data in the store is updated, all reactive query results (obtainer via store.getQuintReactiveFromWeb(...) or store.getQuintReactive(...)) are updated as well.

Add via npm

npm add --save @uvdsl/solid-rdf-store

Vue Example with Reactivity

I use Vue for my apps. If you want to see how this library is used in a Vue app, look at my Solid App Template (Vue Edition).

Here is a quick usage example. It should (TM) work the same with the other frameworks... Let me know.

Define composable useSolidRdfStore

  import { reactive } from "vue";
  import { WebReactiveQuintStore } from "@uvdsl/solid-rdf-store"
  const store = reactive(new WebReactiveQuintStore());

  export const useSolidRdfStore = () => {
    return { store };
  };

Use the store in a component ...

  import { Ref, computed } from "vue";
  import { useSolidRdfStore, Quint } from "useSolidRdfStore";
  
  const { store } = useSolidRdfStore();
  const webId = "https://uvdsl.solid.aifb.kit.edu/profile/card#me";
  
  let nameQueryResult: Ref<Quint[]> = await store.getQuintReactiveFromWeb(webId, "http://www.w3.org/2006/vcard/ns#fn", null, null, webId);
  let photoQueryResult: Ref<Quint[]> = await store.getQuintReactiveFromWeb(webId, "http://www.w3.org/2006/vcard/ns#hasPhoto", null, null, webId);

  const name = computed(() => nameQueryResult.value.map(e => e.object)[0]);
  const vcardPhoto = computed(() => photoQueryResult.value.map(e => e.object)[0]);

  // use data ...

Here, we get a reactive reference (Ref in Vue) on the query result array. This array is updated automatically by the store if updates are available. Therefore, use we also want to automatically re-compute variables; we do that in Vue using computed.

Note: Just picking elements from the array breaks reactivity, and even when keeping reactivity, the update will not go through as the array is updated by clearing and filling it. Therefore, use computed properties!

To re-fetch a dataset (to trigger an update of query results), use

  store.updateFromWeb(webId);

(Optional) Set a session in the store for Solid-based authentication

  // have a session (or not, it is optional)
  // after login re-direct in an app
  const { session, restoreSession } = useSolidSession();
  const { store } = useSolidRdfStore();
  restoreSession().then(() => store.setConfig({ session })).then(() => console.log("Logged in:", session.webId));

See the Solid-OIDC implementation for authenticating a session with your WebID!