Rural NbS Scan — Entity Relationship Diagram
Schema v0.3.0 · tracks current spec.md · all 12 entities — the T0–T7 analytical core plus the evidence & configuration registers (VONT · FAM · BIND · SRC · EV) — with key fields & joins · click to zoom
T0
NbS registry
Master record — anchor for all joins
PKnbs_idstring
nbs_namestring
clusterenum
economic_archetypeenum
establishment_period_yearsobject
evidence_qualityenum
is_activebool
T1
Data registry
Every geospatial dataset — referenced by T2, T4, T5, T7
PKdataset_idstring
dataset_namestring
descriptionstring
analytical_moduleenum
grain_typeenumgrid · admin · vector
spatial_resolution_mint?iff grid
admin_levelenum?iff admin
geographic_coveragestring[]
scenario_typeenum?iff climate
access_typeenum
gee_asset_idstring?
download_urlstring?
access_paramsobject?
license / citation / doistring
T2
Climate risk formulation
Risk variables, weights, simplified vs advanced mode flags
PKvariable_idstring
FKdataset_id → T1string
risk_componentenum
hazard_typeenum
scenario_typeenum
use_in_simplified_modebool
use_in_advanced_modebool
double_count_riskenum
weight_defaultfloat
T3
NbS × hazard × farming
Qualitative matrix — drives the M2 (livelihood) / M2b (asset) two-risk split
PKrecord_idstring
FKnbs_id → T0string
hazard_typeenum
farming_systemstring
mitigation_potentialenum
M2brisk_roleenum
asset_risk_weightfloat?
confidenceenum
timescale_of_effectenum
T4
Suitability mappings
Response functions, scenario flags, AEZ context overrides
PKmapping_idstring
FKnbs_id → T0string
FKsuitability_family_id → FAMstring
FKvariable → VONTstring
FKdataset_id → T1string
REFcontext_overrides → T7object[]
suitability_dimensionenumbiophysical · system · operational
relationship_typeenum
relationship_paramsobject
is_scenario_candidatebool
has_future_projectionbool
weight_defaultfloat
T5
Opportunity space vars
TTL-facing priority layers · grouped by theme, weighted into the hotspot MCDA
PKvariable_idstring
FKvariable → VONTstring
FKdataset_id → T1string
themeenum
directionality_of_concernenum
weight_defaultfloat
ttl_priority_labelstring
is_activebool
T6
NbS scorecard
Likert effects + economic profile per NbS per variable
PKrecord_idstring
FKnbs_id → T0string
FKvariable_id → T5string
variable_typeenum
effect_directionenum
effect_confidenceenum
economic_indicator_typeenum
economic_value_rangeobject
T7
Geographic context
AEZ / farming system / admin lookups for T4 overrides
PKcontext_idstring
FKdataset_id → T1string
context_typeenum
context_namestring
value_in_datasetstring
is_activebool
Evidence & configuration layer (upstream of T0–T7 · v0.2.1–3)
VONT
Variable ontology
Canonical variables — name · unit · resolution validity · sensitivity. Referenced by T2 / T4 / T5 / EV / BIND.
PKcanonical_variable_idstring
label · aliasesstring
canonical_unitstring
group_idstring
REFcandidate_dataset_ids → T1string[]
min_meaningful_resolution_mint
resolution_sensitivityenum
context_sensitivityenum
FAM
Subpractice / suitability-family registry
NbS decomposition — the unit T4 keys to. Grouped by dominant limiting factor.
PKsubpractice_idstring
FKnbs_id → T0string
suitability_family_idstring
dominant_limiting_factorstring
spatial_product_typeenum
grouping_rationalestring
BIND
Dataset binding registry
Context-aware variable → dataset resolution. Global default + per-AOI override; requires_upload flags better local data.
PKbinding_idstring
FKvariable → VONTstring
scope_typeenum
FKscope_id → T7string?
FKdataset_id → T1string?
bandstring?multi-band asset
preference_rankint
statusenum
SRC
Source register
One row per publication / report / tool. The only place benchmark tier is stored.
PKsource_idstring
citation · doistring
benchmark_tierenum
method_typeenum?
study_country · region · aezstring?
nbs_idsstring[]?
EV
Evidence register
One row per atomic claim (quote + page). The structured replacement for free-text justifications; T2/T3/T4/T5/T6 cite evidence_ids.
PKevidence_idstring
FKsource_id → SRCstring
FKnbs_id → T0string
FKsuitability_family_id → FAMstring
FKvariable → VONTstring
use_role · evidence_typeenum
claim_basis · claim_scopeenum
LITquote · pagestring · int
Relationships — core schema (T0–T7)
T0||——o{T3on nbs_id · one NbS has many hazard mitigation rows
T0||——o{T4on nbs_id · one NbS has many suitability variable rows
T0||——o{T6on nbs_id · one NbS has many scorecard entries
T1||——o{T2on dataset_id · one dataset used by many risk variable rows
T1||——o{T4on dataset_id · one dataset used by many suitability mappings
T1||——o{T5on dataset_id · one dataset backs many opp. space variables
T1||——o{T7on dataset_id · one dataset defines many geo contexts
T5||——o{T6on variable_id · scorecard entries; also modulates nbs_response priority layers per NbS
T7}o——o{T4via context_overrides[ ] · soft many-to-many, validated at load
Relationships — evidence & configuration layer
VONT||——o{T2·T4·T5on variable · canonical name/unit/sensitivity governed once
FAM||——o{T4on suitability_family_id · the unit T4 is keyed to
T7||——o{T3 · T0on farming_system / farming_systems_applicable · T7 governs the vocabulary (v0.3.0)
SRC||——o{EVon source_id · one source, many atomic claims (tier stored on SRC)
EV}o——o{T2·T3·T4·T5·T6via evidence_ids[ ] · provenance, soft, validated at load
VONT·FAM||——o{EVon variable / suitability_family_id · each claim is scoped to a variable & family
VONT||——o{BINDon variable · one variable, many context-scoped bindings
BIND}o——o|T1on dataset_id (optional — blank when requires_upload)
BIND}o——o{T7on scope_id · which AEZ/country/region the override applies to
PK Primary key
FK Hard foreign key (must exist in target table)
REF Soft reference (embedded array, validated at pipeline load)
· T3 has no FK to T1 — it is qualitative literature only, no geospatial dataset
Key structural notes: T1 (Data Registry) is the single source of truth for every geospatial dataset; T2, T4, T5 and T7 all carry a dataset_id → T1 foreign key. The cross-NbS tables (T1, T2, T5, T7) are deduplicated — one row per real-world dataset / variable / context, shared across recipes (see DEDUP_NOTES.md). T3 does not link to T1: the matrix is qualitative literature — it names hazard types but consumes no raster directly. T2 (risk to livelihoods) and T4 (suitability) are parallel arms, not connected to each other.
Two-risk split (M2 / M2b): T3.risk_role tags each hazard×NbS row as livelihood_mitigation (feeds M2) or asset_threat (feeds the M2b project disaster-risk screen, weighted by asset_risk_weight). NbS-response priority layers (T5.theme = nbs_response) are derived, not stored — the shared T5 layer is modulated per NbS by the matching T6 effect. T4.relationship_type uses the canonical membership-function set (trapezoidal · gaussian · linear↑/↓ · sigmoid · threshold · piecewise).
Evidence & configuration layer (v0.2.1–3, shown above): analytical tables reference canonical variables in VONT (name + unit + context_sensitivity live there, once), T4 keys to a suitability family in FAM, provenance rows live in SRC/EV (cited by evidence_ids), and per-context dataset choice is resolved through BIND (global default + per-AOI override / upload-flag). Value governance: closed enums are inline in spec.md; open vocabularies are FK-governed — datasets by T1, contexts & farming systems by T7, variables by VONT, families by FAM. Field-level detail in spec.md.