offdataai
Supply Chain & Logistics · data model template

Public Transit EDW data model

Data Vault 2.0 raw vault for public transit: hubs (rider/route/stop/vehicle/trip), links (rider-trip fare tap, trip-route, route-stop, trip-vehicle), and satellites (rider, route, stop, vehicle details + trip-status effectivity + fare transactions). Hash keys and load metadata are generated by the DDL layer.

Public transit enterprise data warehouse modeled as a Data Vault 2.0 raw vault: rider, route, stop, vehicle, and trip hubs; a non-historized rider fare-tap link plus trip, route, and vehicle operational links; and descriptive, effectivity, and fare-transaction satellites — built for integrating automated fare collection, vehicle location, and scheduling systems with full historization and the rider-data lineage (GDPR) a transit authority must retain. It is a Data Vault 2.0 raw vault: hubs for business keys, links for relationships and satellites for descriptive history, with hash keys and hash diffs generated in the DDL.

Data Vault 2.0Supply Chain & LogisticsGDPRPII
16
tables
99
columns
15
relationships
6
PII columns

Opening the template creates a project with the ERD, platform-native DDL, a dbt project and documentation already generated (recommended platform: BigQuery). Edit it in plain English or on the canvas, then ship it to any supported warehouse.

Subject areas

hubslinkssatellitesreference

Design decisions

  • Non-historized fare-tap link

    Fare taps are immutable point-in-time events linking a rider, trip, and stop; the link is insert-only and carries the fare measure directly — the canonical Data Vault transactional link for high-volume AFC data.

  • Effectivity satellite on the trip

    A trip moves through scheduled, in-progress, completed, and detoured states; an effectivity satellite records the valid period of each status for as-of schedule-adherence reporting.

  • Fare transactions split into their own satellite

    Stored-value account movements change far more frequently than rider profile attributes; a separate high-rate-of-change satellite keeps history compact and reconciliation efficient.

  • GDPR-driven rider PII handling

    National-id full-masking, email hashing, and per-attribute classification satisfy GDPR on rider records, while load_date + record_source provide the lineage to honour access and erasure requests.

Tables in the Public Transit EDW model

Every table with its grain, columns, types and keys. PK marks a primary key, BK a business key and PII a column classified as personal data, which gets a masking strategy by default.

Hubs (5)

hub_rider

Grain: one row per unique hub_rider business key

ColumnTypeKeys
rider_idvarcharBK
load_datetimestamp
record_sourcevarchar

hub_route

Grain: one row per unique hub_route business key

ColumnTypeKeys
route_idvarcharBK
load_datetimestamp
record_sourcevarchar

hub_stop

Grain: one row per unique hub_stop business key

ColumnTypeKeys
stop_idvarcharBK
load_datetimestamp
record_sourcevarchar

hub_vehicle

Grain: one row per unique hub_vehicle business key

ColumnTypeKeys
vehicle_idvarcharBK
load_datetimestamp
record_sourcevarchar

hub_trip

Grain: one row per unique hub_trip business key

ColumnTypeKeys
trip_idvarcharBK
load_datetimestamp
record_sourcevarchar

Links (4)

lnk_rider_trip_tap

Grain: one row per rider fare tap (non-historized link)

Transactional (non-historized) link — insert-only fare tap events.

ColumnTypeKeys
rider_hkbinary
trip_hkbinary
stop_hkbinary
tap_event_idvarcharBK
tap_tstimestamp
tap_typevarchar
fare_productvarchar
fare_amountdecimal
payment_mediavarchar
load_datetimestamp
record_sourcevarchar

lnk_trip_route

Grain: one row per lnk_trip_route relationship

Which route a trip runs along.

ColumnTypeKeys
trip_hkbinary
route_hkbinary
load_datetimestamp
record_sourcevarchar

lnk_route_stop

Grain: one row per lnk_route_stop relationship

Which stops a route serves.

ColumnTypeKeys
route_hkbinary
stop_hkbinary
load_datetimestamp
record_sourcevarchar

lnk_trip_vehicle

Grain: one row per lnk_trip_vehicle relationship

Which vehicle operates a trip.

ColumnTypeKeys
trip_hkbinary
vehicle_hkbinary
load_datetimestamp
record_sourcevarchar

Satellites (6)

sat_rider_details

Grain: one row per rider_hk per change

Rider descriptive history (PII).

ColumnTypeKeys
rider_hkbinaryPK
load_datetimestampPK
first_namevarcharPII
last_namevarcharPII
date_of_birthdatePII
national_idvarcharPII
emailvarcharPII
phonevarcharPII
rider_categoryvarchar
concession_statusvarchar
load_end_datetimestamp
record_sourcevarchar

sat_route_details

Grain: one row per route_hk per change

Route descriptive history.

ColumnTypeKeys
route_hkbinaryPK
load_datetimestampPK
route_namevarchar
route_typevarchar
route_colorvarchar
operating_agencyvarchar
is_expressboolean
load_end_datetimestamp
record_sourcevarchar

sat_stop_details

Grain: one row per stop_hk per change

Stop descriptive history.

ColumnTypeKeys
stop_hkbinaryPK
load_datetimestampPK
stop_namevarchar
latitudedecimal
longitudedecimal
zone_idvarchar
wheelchair_accessibleboolean
load_end_datetimestamp
record_sourcevarchar

sat_vehicle_details

Grain: one row per vehicle_hk per change

Vehicle descriptive history.

ColumnTypeKeys
vehicle_hkbinaryPK
load_datetimestampPK
vehicle_typevarchar
capacityinteger
fuel_typevarchar
year_builtsmallint
wheelchair_accessibleboolean
load_end_datetimestamp
record_sourcevarchar

sat_trip_status

Grain: one row per trip status per effectivity change

Effectivity satellite tracking trip operation status over time.

ColumnTypeKeys
trip_hkbinaryPK
load_datetimestampPK
status_codevarchar
effective_fromtimestamp
effective_totimestamp
is_activeboolean
schedule_adherence_secondsinteger
load_end_datetimestamp
record_sourcevarchar

sat_fare_transaction

Grain: one row per rider account fare transaction (high-rate-of-change satellite)

Fare-transaction satellite — rider stored-value account movements.

ColumnTypeKeys
rider_hkbinaryPK
load_datetimestampPK
transaction_refvarchar
transaction_tstimestamp
transaction_typevarchar
amountdecimal
balance_afterdecimal
settlement_statusvarchar
load_end_datetimestamp
record_sourcevarchar

Lookup tables (1)

ref_fare_product

Grain: one row per fare product

ColumnTypeKeys
fare_product_codevarcharBK
fare_product_namevarchar
rider_categoryvarchar

Relationships

Each relationship is a foreign key on the first table referencing the second.

  • lnk_rider_trip_tap.rider_hk → hub_rider (many-to-one)
  • lnk_rider_trip_tap.trip_hk → hub_trip (many-to-one)
  • lnk_rider_trip_tap.stop_hk → hub_stop (many-to-one)
  • lnk_trip_route.trip_hk → hub_trip (many-to-one)
  • lnk_trip_route.route_hk → hub_route (many-to-one)
  • lnk_route_stop.route_hk → hub_route (many-to-one)
  • lnk_route_stop.stop_hk → hub_stop (many-to-one)
  • lnk_trip_vehicle.trip_hk → hub_trip (many-to-one)
  • lnk_trip_vehicle.vehicle_hk → hub_vehicle (many-to-one)
  • sat_rider_details.rider_hk → hub_rider (many-to-one)
  • sat_route_details.route_hk → hub_route (many-to-one)
  • sat_stop_details.stop_hk → hub_stop (many-to-one)
  • sat_vehicle_details.vehicle_hk → hub_vehicle (many-to-one)
  • sat_trip_status.trip_hk → hub_trip (many-to-one)
  • sat_fare_transaction.rider_hk → hub_rider (many-to-one)

Related templates

All templates →
Start for $1

From requirements to AI-ready context, in one platform.

Describe your business in a conversation, start from a template or connect your own database. Your first model is ready in minutes.

Get startedBook a demo

Plans from $1/month · cancel any time