Skip to content

Instantly share code, notes, and snippets.

View FlorentCollin's full-sized avatar
:octocat:
Learning as much as possible

FlorentCollin

:octocat:
Learning as much as possible
View GitHub Profile

How to define expenses in RDF

The schema.org define two schemas interesting for our use case, https://schema.org/Person and https://schema.org/BuyAction. The BuyAction schema will be use to store a specific expense (see for example form G103 3.1 "auditory and oral messages").

This schema contains 4 properties that we are going to use to store the expenses linked to the form:

  • price
  • priceCurrency
  • description
  • identifier
import auth from 'solid-auth-client';
import * as $rdf from 'rdflib';
const { fetch } = auth;
// This simple file illustrate how we can use solid and rdflib to fetch data from a public resource on a Solid Pod
// Links to learn more on how this works:
// - https://github.com/solid/solid-auth-client
// - https://linkeddata.github.io/rdflib.js/Documentation/webapp-intro.html
//