data-catalog-sparql-playground

Data Catalog SPARQL playground

A tiny, self-contained playground for browsing and querying RDF data in the browser:

Everything runs in your browser; there’s no SPARQL endpoint. Comunica queries the RDF files directly.

🚀 Live demo 🚀

Repository layout

Prerequisites

Installation

macOS (Homebrew):

brew install mkcert
brew install nss        # if you use Firefox
mkcert -install         # installs a local CA into your trust stores

Linux (Debian/Ubuntu):

sudo apt-get update
sudo apt-get install -y mkcert libnss3-tools
mkcert -install

Notes

Generate a local HTTPS cert

Replace USER.github.io with the hostname you want to mimic (e.g., your GitHub Pages domain). Include localhost and loopback IPs as SANs.

mkcert -key-file cert-key.pem -cert-file cert.pem "USER.github.io" localhost 127.0.0.1 ::1

This produces cert.pem and cert-key.pem in the repo root. Keep cert-key.pem private.

Create your catalog.json

1) Install the Python dependency:

python3 -m venv .venv
. .venv/bin/activate
pip install defopt

2) Put RDF data under data/ and example queries under queries/.

3) Generate catalog.json (adjust base URL, name, license as needed):

python make_catalog.py data/* \
  --base-url https://USER.github.io/ \
  --name "My data catalog" \
  --queries queries/* \
  --out catalog.json

Notes

Run locally over HTTPS on port 443

Map your chosen hostname to localhost (toggle on/off):

./toggle-hosts.sh USER.github.io

Start the HTTPS server (binds to 443; will prompt for sudo):

./run-server.sh

Open in your browser:

https://USER.github.io/query.html

Why mimic a Pages-like hostname?

Using the playground

Updating data and queries

Architecture and maintenance notes

If you are working on the playground internals rather than just using the demo pages, start with:

Troubleshooting

Deploying to GitHub Pages

Release readiness

Test and debug harness (red/green TDD)