← Demonstrator artefacts

Data Schema — T0–T7

World Bank D591 · Alliance Bioversity International & CIAT

The analytical backbone. The pipeline reads every analytical rule, dataset, response function and weight from these eight tables — nothing is hardcoded. Schema v0.3.0 · draft-0 examples: Agroforestry · Water Harvesting & Conservation.

Entity-Relationship Diagram (v0.3.0)

All eight tables, their key fields, and the foreign-key joins that bind them. Click through to zoom.

v0.3.0diagramon this site

Field-level schema spec ↗

Every field, type, enum and foreign key for all eight tables plus the evidence/config registers, the relationship-type reference and implementation notes. Markdown, rendered on GitHub.

v0.3.0 · structure frozenspecschema/spec.md

Draft-0 worked examples: Agroforestry · Water Harvesting ↗

The first populated tables — CSV + JSON for all of T0–T7, sourced from the NbS stocktake. The template every subsequent NbS recipe follows. Per-NbS tables under recipes/<nbs_id>/; cross-NbS tables (T1, T2, T5, T7) merged at the schema root. Structure-conformant; row content in progress.

draft 02 NbSCSV + JSONstructure-conformant

Frozen structure — column manifest + validator ↗

The column set of every table is locked at v0.3.0-structure-frozen: required/optional/conditional/derived status and foreign keys, captured machine-readably in structure/columns.json. A stdlib validator (src/nbs_ruralscan/schema_tools/structure.py) checks any data file against it — column conformance + FK shape always, content completeness under --strict. The team populates rows without the columns shifting underneath.

structure frozenmanifestvalidator

How the tables are generated — T4 method ↗

Evidence-first, defensible generation of suitability mappings from literature: discovery → vectorless ingestion → Source/Evidence registers → synthesis. Covers suitability families & spatial_product_type, species-vs-technology, and publication-bias handling. Adds an evidence & configuration layer upstream of T0–T7 so every value traces to source · tier · page · quote.

v0.1methodologyprovenance-first

The eight tables

TablePurposeKey fieldOwnerLocation
T0 NbS RegistryMaster record per NbS; economic archetype; evidence qualitynbs_idPete (oversight) · Namita (content)recipes/<nbs_id>/
T1 Data RegistryDataset catalog — access routes, citations, limitationsdataset_idBrayden · Namita · Bensonschema root
T2 Climate Risk FormulationRisk variables, hazard/exposure formula, double-count guardvariable_id · dataset_id→T1Brayden · Namita (lit)schema root
T3 NbS × Hazard × FarmingQualitative mitigation-potential matrixrecord_id · nbs_id→T0Brayden · Namita (lit)recipes/<nbs_id>/
T4 Suitability MappingsResponse functions, scenario flags, context overridesmapping_id · nbs_id→T0, dataset_id→T1Pete · Namita (Task H)recipes/<nbs_id>/
T5 Opportunity Space VarsTTL-facing priority layersvariable_id · dataset_id→T1Pete · Bensonschema root
T6 NbS ScorecardLikert effects + economic profile per NbSrecord_id · nbs_id→T0, variable_id→T5Namita · MFLrecipes/<nbs_id>/
T7 Geographic ContextAEZ / farming-system / admin context definitionscontext_id · dataset_id→T1Benson · Braydenschema root

green = primary key · brown = foreign key · tables carrying an nbs_id live in the recipe folder; cross-NbS tables live at the schema root. Adding an NbS = a new recipe folder + appended rows. No schema or code changes required.

v0.2 adds an evidence & configuration layer upstream of T0–T7 — Source Register · Evidence Register · Variable Ontology · Subpractice/Suitability-Family registry, now materialised under schema/registers/ — feeding T2/T3/T4/T5/T6 with full provenance via evidence_ids. v0.2.1 adds the BIND registry: context-aware variable→dataset resolution (a global default, overridable per country/AEZ; a requires_upload status flags better local data for the user to supply) — so a global recipe is refined for an AOI without forking it. T4 keys to suitability_family_id; canonical variable names + units live once in the Variable Ontology. v0.3.0 (June 2026): T5 ratified — mcda_role (priority | descriptor), 16 rows (12 priorities + 4 descriptors) across 5 themes (climate_hazard · nbs_response · people_production · equity_inclusion · context), including iplc_lands bound to LandMark via BIND; T7 farming_system swapped to 6 EO-derived classes (Dixon as crosswalk); T6 generalised with cost-effectiveness denominators; M2b two-stream (asset hazard + operational levers). The agroforestry F1 chain has 18 of 23 papers swept (81 EV rows, 18 SRC rows). See the field-level spec.

How they connect

All joins run on three keys — nbs_id (T0), dataset_id (T1), variable_id (T5) — with the evidence layer adding variable→Ontology, suitability_family_id→Family registry and evidence_ids→Evidence Register. The validator checks every foreign key on load and fails loudly on a broken link rather than producing a silent gap. T2 (risk to livelihoods) and T4 (suitability) are parallel arms; the double_count_risk flag in T2 prevents a variable being counted in both the risk index and the opportunity space. With two recipes merged and deduplicated, the shared root tables hold 21 datasets (T1), 11 risk variables (T2), 14 opportunity-space variables (T5) and 15 geographic contexts (T7) — one source of truth across NbS.