Data Model#
Interchange formats#
JSON is the primary interchange format between Python and the browser.
Pipeline outputs go to
docs/data/; browser editors read and write the same files via the GitHub API.Parquet is used only for embedding caches.
IndexedDB (via Dexie) is used for browser-editor persistence.
Repository layout#
process/ Python pipeline scripts (run individually via python -m process.<script>)
process/helpers/ Shared utilities: phonetic.py, commodities.py, utils.py, encoding.py
process/symphonym/ Bundled BiLSTM phonetic embedding model (Symphonym v7 checkpoint, 128-dim)
process/commodity_parser/ Glossary-derived span parser used by annotate.py
docs/ GitHub Pages site: HTML editors, JS, CSS, visualisations
docs/api/ JSON-LD entity files (generated at deploy time, never committed except context.json)
docs/data/ Pipeline outputs and curated datasets (JSON, TSV, Parquet, joblib)
docs/data/ladings/ Per-volume ladings with annotations (tracked .json.gz; the .json intermediates are untracked)
docs/data/records/ Per-volume cargo records (tracked .json.gz sidecars, fetched on demand)
docs/data/discarded/ Paragraphs that are not cargos, per volume
docs/symphonym/ Symphonym v8 ONNX model, as loaded by the browser (and by the name pipeline)
docs/js/ JavaScript for browser editors and visualisations
data/ Source inputs: Word files, Book of Rates, customs officials spreadsheets
data/forename_seeds.json Manual forename seed data supplementing DMNES
.github/workflows/ deploy-pages.yml: incremental JSON-LD generation + GitHub Pages deployment
documentation/ Sphinx source for this documentation site
tools/ Audits and test harnesses (e.g. tools/ladings/audit_losses.py, tools/pages/shot.py)
Glossary entries#
The commodity glossary is docs/data/glossary_data.json. Its entries object is keyed by
concept key (singular, lower case: wine, cloth); each entry has these fields (field
frequencies are from the file on 17 November 2026, which holds 2,474 entries):
Field |
Type |
Description |
|---|---|---|
|
|
Forms: |
|
|
Description |
|
|
Subject groupings derived from the AAT ancestry (see Commodity Groupings). These replaced the legacy |
|
|
Commodity-type identifiers: Getty AAT ids, or Wikidata Q-ids with |
|
|
AAT material concepts |
|
|
Entry-level geographic provenance (World Historical Gazetteer) |
|
|
Qualifiers: a reference to a canonical in |
|
|
Keys of the entries that compose a compound term ( |
|
|
Keys of related entries ( |
|
|
Concepts in an external vocabulary the commodity is related to but is not a kind of (for example the animal a food comes from). Kept out of |
|
|
Cross-reference keys |
|
|
Curation flags ( |
|
|
Free-text internal note |
The shared qualifier vocabulary is docs/data/qualifiers.json: one canonical per qualifier
lemma, with its label, attested forms, gloss and, where appropriate, an aat concept or a
geo identifier. See Rationalising the Qualifiers.
Cargo records#
Every cargo has a record in docs/data/records/<volume>.json.gz (built by
process/cargo_records.py): one row per commodity, giving its span in the cargo text, the
concept (key, label, AAT and materials, groupings), the quantity and measure, and the qualifiers,
plus the merchant / master / ship frame (with pids). Concepts and identifiers are inherited
from glossary_data.json when the records are built, so re-run cargo_records --write after any
glossary change.
Person identifiers#
Every forename, surname and master annotation in a lading carries a pid, the id of a person
group; see Name Matching.
Browser editors#
File |
Purpose |
JS |
|---|---|---|
|
Live concept, qualifier and leftover review (documented here) |
|
|
Retired: a static notice page; the v1 editor (history) cannot write. |
— |
|
Review queue for near-miss spellings |
|
|
Annotation and review tools for the cargo parser |
|
|
Books of Rates: goods and qualifiers |
|
|
Draw the project’s own coordinates for gazetteer rows whose position currently comes from a share-alike source |
|
|
Customs officials dataset (public view: |
|
|
Forename group merge/split |
|
|
Surname alias review |
|
|
Full person-identity matching |
|
|
Manual surname alias management |
(inline) |
|
D3 network visualisation of name clusters |
|
|
Public glossary with Chart.js visualisations |
|
|
PID-based entity viewer (ladings, commodities, groupings) |
(inline) |
|
Particular Customs Accounts explorer |
|
External dependencies#
LibreOffice + Pandoc (doc → html), pdfplumber, epitran + panphon,
faiss-cpu, PyTorch (separate install), BeautifulSoup, scikit-learn + joblib,
Chart.js, D3.js, Cytoscape.js, MapLibre GL JS.
CDN dependencies have been replaced with local bundles in docs/js/libs/
and docs/css/libs/.