A(DAI)

The commons, offline

The whole public graph of A(DAI) — practitioners, works, concepts, institutions, the relations between them and the contributions behind them — as one file you can keep, open and build on. A sandbox: break things freely, the live commons is not touched.

1. Download

Not published yet. The snapshot is built, but the nightly download has not been switched on. Check back soon — this page will carry the link.

2. Open it

It is a plain SQLite file: no server, no extension.

sqlite3 adai-latest.sqlite
sqlite> .tables
contributors  edges  meta  node_aliases  nodes  signals
sqlite> SELECT value FROM meta WHERE key = 'readme';

Python and Node have SQLite built in (import sqlite3; node:sqlite); DB Browser for SQLite or Datasette work too.

3. Read the graph from a script

Nodes are things; edges are relations between them. Edges are bi-temporal: the current graph is the edges WHERE valid_until IS NULL — ended relations stay in the file as history.

import sqlite3, json

db = sqlite3.connect("adai-latest.sqlite")
works = db.execute("""
  SELECT w.name, json_extract(w.metadata, '$.cdn_image_url')
    FROM edges e
    JOIN nodes w ON w.id = e.source_id
    JOIN nodes p ON p.id = e.target_id
   WHERE e.edge_type = 'CREATED_BY'
     AND e.valid_until IS NULL
     AND p.slug = ?
   ORDER BY w.name""", ("vera-molnar",)).fetchall()
for name, image in works:
    print(name, image or "")

Every node's page on the site has its address: /<type>/<slug>. Edge types: CREATED_BY, EXHIBITED_AT, HELD_BY, COLLABORATES_WITH, PARTICIPATED_IN, REPRESENTS, EMBODIES, … (see the contributor contract).

What is in it — and what is not

Fork the commons

The snapshot is a copy; a fork stays in step. The commons is stored as a CRDT (cr-sqlite), and its change stream is public: pull it into a database of your own, run the site on it, and pull again whenever you like — you get only what changed since.

1. Pull

git clone https://github.com/a-digital-arts-institute/adai-v1 && cd adai-v1
npm install
npm run fork:pull -- --from https://digitalartsinstitute.io --db ./fork.db

The first pull creates fork.db with the site's own schema and fetches everything; it stores where it came from (the source's site id) and how far it got in the file's settings table. Run the same command again to catch up. It refuses to pull into a database that is a fork of another source, or that already holds data of its own (--force to do it anyway), and a source whose schema differs from your code's (update the code first).

2. Run the site on it

DB_PATH=./fork.db npm run dev     # http://localhost:8080

The endpoints

What a fork gets — and when

Licence

The software is licensed Apache-2.0 (LICENSE). The knowledge graph — the snapshot and the change stream alike — is licensed CC BY-SA 4.0 (attribution, share-alike) — the full statement is in the snapshot's meta table and in LICENSE-DATA. Mirrored artwork images are not covered: copyright stays with the artists and holding institutions; a fork links to them, it does not license them.

Contributing

Changes you make to your copy stay on your machine. To add to the commons — a work, a relation, your own account — use the live site: contribute.