Linked Data API#
The project publishes per-entity JSON-LD documents under the namespace
https://w3id.org/mlca/. The files are generated at deploy time by
process/generate_jsonld.py and served from docs/api/. (w3id.org redirects to the
files on GitHub Pages, which are named .json rather than .jsonld so that Pages
serves them as application/json.)
Namespaces#
Defined in docs/api/context.json:
Prefix |
Expansion |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
What’s emitted#
generate_jsonld.py produces:
One document per lading under
docs/api/{lading_id}.json, with its cargos as nodes inside itPer-glossary-entry documents under
docs/api/glossary/{term}.jsonA single
context.json(the only JSON-LD file that is committed)
Glossary entries carry:
Commodity-type identifiers (AAT or Wikidata) as SKOS mapping relations:
skos:exactMatch,skos:closeMatch(match: "close") andskos:broadMatch(broader: true). Entries that HECTOR has already minted also get anexactMatchto their HECTOR record. Identifiers markeduncertainorsuggestedare withheld: JSON-LD cannot say “probably” without reifying the statement, and a machine’s unconfirmed proposal should not be published as an assertion. A run logs how many it withheld.Subject groupings under
groups(mlca:grouping)Materials as AAT URIs under
schema:materialGeographic provenance under
provenancewith identifier and labelcompoundOfas glossary URIs underhector:compoundOfrelatedas glossary URIs underskos:related; concepts fromrelatedConcepts(related but not a kind of the commodity) are published in the sameskos:relatedsetQualifier semantic types and specific AAT concepts as AAT URIs
To run it locally: python -m process.generate_jsonld (everything), --ladings,
--glossary, --volume STEM (repeatable; implies --ladings) or --dry-run.
Build behaviour#
The .github/workflows/deploy-pages.yml workflow runs generate_jsonld.py
incrementally:
Caches
docs/api/between runs so unchanged entities are not regenerated.Detects which source files changed and regenerates only the affected subset (per-volume ladings, glossary, or neither).
Falls back to full regeneration when
generate_jsonld.pyitself changes, or on manual dispatch / first run (no cache).
JSON-LD files in docs/api/ are generated at deploy time and never
committed (except context.json).