Skip to content

Sources for rule packs

Rule packs turn official vocabularies into rules, so that columns named after a standard's terms get the standard's titles, definitions, units and code lists. The candidate sources, by domain (ecology, land use and land cover, economy, transport, energy, water and climate, time, India, units), are listed in one place: builtin/sources.yaml.

How a source becomes a pack

  1. Proposed. Listed with its URL and format. Its licence is marked unverified.
  2. Verified. The licence has been read on the source's own website, and the date and page are recorded in licence_checked. Packs are CC BY 4.0 unless the source's licence requires otherwise; a pack from a share-alike source keeps that licence (the owners decided this for SDMX on 2026-10-22). Sources with no-changes terms wait for the owners' decision.
  3. Imported. An importer (knowtation_core.packs.<name>) downloads the official machine-readable file and builds a pack. Run it with knowtation packs import <name>, which needs knowtation-core[packs] for RDF sources. The pack records the URL, the date and the file's SHA-256. The same file never makes a second version; a changed file makes a new version (named after the date) and never overwrites an old one.

Every rule in a shipped pack has tests (an element it should match and one it should not), and the import refuses a pack whose tests fail.

The first packs

Pack Source Rules Notes
darwin-core Darwin Core, CC BY 4.0, TDWG One per term: title, definition, and role or unit where clear (…ID → identifier, decimalLatitude → space, degree) Proposals are declared: the standard defines the term. Used when at least three columns are terms (decimalLatitude or decimal_latitude)
qudt-units QUDT units, CC BY 4.0, QUDT.org One per SI unit whose symbol is an unambiguous name ending (energy_kwh → kWh, flow_m3s → m3/s), numbers only Endings shared by two units (mW and MW) are left out, as are endings that are usually words (_min)
sdmx-code-lists SDMX code lists, CC BY-SA 4.0 Code-list rules (CL_SEX, CL_FREQ): a column named sex whose values are SDMX codes gets the code list Share-alike: the pack is CC BY-SA 4.0, like its source

Packs saved from datasets

A reviewer can turn a dataset's accepted code lists into a pack: Save as rule pack on the Data dictionary (or POST /datasets/{id}/rule-pack). Each accepted code list becomes a rule that matches columns named like the original whose values are mostly those codes, and proposes the codes with their meanings, descriptions and attributes. A licence is required (the codes' source licence, for example CC BY 4.0 for World Bank data); the pack records it with the source URL, the attribution and the reviewed version's date (so saving the same version again, on any day, gives the same pack), its proposals are declared (a person checked them), and it must pass its own generated tests. Links to other files are not saved: they only make sense within one dataset.

Code lists

A rule can propose a code list, which says what each code in the values means. It uses the condition values_in (every example value is one of the codes) and the field code_list (code → meaning). Land-cover classes and Indian place codes need the same mechanism.