System Diagram

The GIS Tenancy & Spatial 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.


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, 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, overlap area); SpatialRule defines which layer-pair relationships matter and at what severity.

Events & triggers

TriggerDefinition watches for relationship/event changes; a match raises a SpatialEvent (linked to its rule, relationship, features and run), delivered via EventDelivery.

Disclosure & reconciliation

DisclosureProfile sets what geometry/properties may be disclosed; DataTransfer carries it; AuditEvent records every disclosure/action; ReconciliationCheck verifies cross-tenant consistency.

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 spatial