- Documentation
- /
- Gist
- /
- System Diagram
System Diagram
The GIS Tenancy Portal data model, mapped — 21 models
🔍 Open the Interactive Diagram Viewer — pan, mouse-wheel zoom, fit-to-screen, full-screen, per-area tabs, the full ERD, and a focus mode that draws one model and its neighbours at a chosen depth. Tenant, SpatialFeature and Organisation are hub tables, so their links can be hidden to declutter the overview.
Entity-relationship diagram (all 21 models)
erDiagram
ORGANISATION ||--o{ TENANT : owns
TENANT ||--o{ TENANT_DOMAIN : has
TENANT ||--o{ USER : contains
TENANT ||--o{ ROLE : defines
TENANT ||--o{ GIS_LAYER : exposes
USER ||--o{ USER_ROLE : assigned
ROLE ||--o{ USER_ROLE : includes
ROLE ||--o{ PERMISSION : grants
TENANT ||--o{ LAYER_SHARE : source
TENANT ||--o{ LAYER_SHARE : target
GIS_LAYER ||--o{ LAYER_SHARE : shares
GIS_LAYER ||--o{ SPATIAL_FEATURE : contains
SPATIAL_FEATURE ||--o{ FEATURE_RESPONSIBILITY : has
ORGANISATION ||--o{ FEATURE_RESPONSIBILITY : assigned
SPATIAL_FEATURE ||--o{ SPATIAL_EVALUATION_RUN : source
SPATIAL_EVALUATION_RUN ||--o{ SPATIAL_RELATIONSHIP : produces
SPATIAL_FEATURE ||--o{ SPATIAL_RELATIONSHIP : source
SPATIAL_FEATURE ||--o{ SPATIAL_RELATIONSHIP : target
SPATIAL_RULE ||--o{ SPATIAL_EVENT : generates
SPATIAL_RELATIONSHIP ||--o{ SPATIAL_EVENT : evidences
TENANT ||--o{ SPATIAL_EVENT : owns
TRIGGER_DEFINITION ||--o{ SPATIAL_EVENT : raises
SPATIAL_EVENT ||--o{ EVENT_DELIVERY : delivered_by
DISCLOSURE_PROFILE ||--o{ SPATIAL_EVENT : governs
TENANT ||--o{ DATA_TRANSFER : carries
TENANT ||--o{ AUDIT_EVENT : records
SPATIAL_RELATIONSHIP ||--o{ RECONCILIATION_CHECK : verifies
SPATIAL_EVENT ||--o{ RECONCILIATION_CHECK : verifies
Architecture overview
Everything is scoped by tenant. A tenant's layers hold features; the spatial engine turns features into relationships, a rule judges them, and a trigger raises an event that flows out through delivery (to the Orchestrator), disclosure, transfer, audit and reconciliation — with layer shares and disclosure profiles governing what crosses a tenant boundary.
flowchart LR
subgraph TEN["🏢 Tenancy & access"]
Organisation
Tenant
User
Role
LayerShare
end
subgraph DATA["🗺️ Spatial data"]
GISLayer
SpatialFeature
FeatureResponsibility
end
subgraph EVAL["📐 Evaluation"]
SpatialEvaluationRun
SpatialRelationship
SpatialRule
end
subgraph EVT["⚡ Events & triggers"]
TriggerDefinition
SpatialEvent
EventDelivery
end
subgraph DISC["🔒 Disclosure & reconciliation"]
DisclosureProfile
DataTransfer
AuditEvent
ReconciliationCheck
end
Organisation --> Tenant
Tenant --> User
Tenant --> Role
Tenant --> GISLayer
Tenant --> LayerShare
LayerShare --> GISLayer
GISLayer --> SpatialFeature
SpatialFeature --> FeatureResponsibility
SpatialFeature --> SpatialEvaluationRun
SpatialEvaluationRun --> SpatialRelationship
SpatialFeature --> SpatialRelationship
SpatialRule --> SpatialEvent
SpatialRelationship --> SpatialEvent
SpatialFeature --> SpatialEvent
SpatialEvaluationRun --> SpatialEvent
Tenant --> SpatialEvent
SpatialEvent --> EventDelivery
Tenant --> DataTransfer
Tenant --> AuditEvent
User --> AuditEvent
SpatialRelationship --> ReconciliationCheck
SpatialEvent --> ReconciliationCheck
Tenancy & access
Organisation → Tenant → (User, Role, GISLayer); UserRole and Permission grant access;
LayerShare grants another tenant a level of access (metadata / geometry / read / export) to a
layer — the only sanctioned way data crosses a tenant boundary.
Spatial data
GISLayer → SpatialFeature holds the geometry (+ properties, centroid, bbox, hash);
FeatureResponsibility records the owning/regulating organisation per feature.
Evaluation
SpatialEvaluationRun compares features and records SpatialRelationships (source ↔ target
feature, type, distance / overlap area) — with a full lifecycle (detected → active → changed →
ceased/resolved). SpatialRule defines which layer-pair relationships matter and at what severity.
Events & triggers
TriggerDefinition watches for feature/geometry/relationship changes; a match raises a
SpatialEvent (linked to its rule, relationship, features and run), delivered via EventDelivery
to the Orchestrator with idempotency and retry.
Disclosure & reconciliation
DisclosureProfile sets what geometry/properties may be disclosed; DataTransfer carries it;
AuditEvent records every disclosure/action; ReconciliationCheck verifies cross-tenant
consistency (and flags an exception_code when a shared relationship drifts).
Regenerating this diagram
The interactive viewer is generated — after any DSL, menu_config.yaml or
schema/diagram_config.yaml change, re-run:
python scripts/build_diagram_viewer.py gist