GSS-Cogs / chart-builder

The Chart Builder is a proof-of-concept app to understand the feasibility of using a CSV file (or SPARQL query) to generate and customise a chart or data visualisation
https://chart-builder-no4vxskx7a-nw.a.run.app
2 stars 0 forks source link

Consider existing RDF libraries for data and metadata #78

Closed nosnickid closed 1 year ago

nosnickid commented 2 years ago

Lots of existing functionality here https://rdf.js.org/

How can we use these libraries to provider data and metadata to the chart builder?

ajtucker commented 2 years ago

These JavaScript RDF libraries have lots of possibilities and I'd like to look at how we can use them with linked data, and specifically RDF Data Cubes published on the web, as RDF serializations including CSV-W and also cubes that sit behind SPARQL endpoints.

One library that is particularly interesting is LDflex. There's a tutorial on using it in React.

The idea is that given a starting URI (e.g. a dataset) along with some namespace declarations (many are built in, but may need to add e.g. qb: for http://purl.org/linked-data/cube#) and can then use path expressions in JS/React like [${dataset_url}][dct:title] to get at a dataset's title, or [${dataset_url}][dcat:distribution][qb:structure][qb:component] to get at the list of components (dimensions, attributes and measures) from the data cubes that are "distributions" of this dataset.

Behind the scenes, this path expression DSL corresponds to looking up the linked data on the web by whatever means we want, from loading CSV-W or other RDF serializations, to turning the DSL into SPARQL queries and running them on provided endpoints, potentially with authentication.

By the looks of things, LDflex is built on top of the other JS RDF libraries and can use the excellent Comunica framework for adding backend "engines" to supply the data from multiple sources.

In terms of the architecture, I'd normally expect much of this to be done server side, but with React and isomorphic web apps, that distinction gets a bit blurry.

charlesons commented 2 years ago

Created a wiki page to document the work https://github.com/GSS-Cogs/dd-cms/wiki/Data-flows-within-DD-CMS