App as a repository
Make the app reproducible: a git repository that installs into any instance
Every stage so far produced files — document descriptions, mapping queries, CSV data, media. Kept in a repository with a small install script, they are the application: versionable, diffable, reviewable, and replayable into any LinkedDataHub instance. This is the layout the Northwind Traders repository uses:
northwind-traders/ ├── root.ttl # one .ttl per document... ├── categories.ttl ├── categories/ # ...and a folder for the files it imports │ ├── categories.csv │ ├── categories.rq │ └── *.gif ├── admin/model/ │ ├── ns.ttl # the namespace ontology │ ├── patch-ontology.ru # resets it before re-import │ └── import-ns.sh ├── imports.csv # the CSV import manifest ├── install.sh # replays everything against a base URI ├── update-folder.sh ├── .ldhignore # files that are not documents └── Makefile
The convention
The document URL is derived from the file path: categories.ttl installs to ${base}categories/, root.ttl to ${base} itself.
update-folder.sh walks the tree applying that rule — resolving each file's relative URIs against its
document URL and PUTting the result — and skips anything
matched by .ldhignore.
Idempotency
Re-running the install converges instead of duplicating: PUT replaces each document's description outright, and the one place that appends rather
than replaces — the
namespace ontology — is first reset by patch-ontology.ru, a SPARQL update that clears the previously imported terms.
Installing
make install
prompts for the base URI, certificate and password, then runs install.sh: make public, import the ontology, replay the documents, upload the files, run the CSV imports. The entire tutorial, replayed in one command — against localhost today, against production tomorrow.
Next: Beyond low-code