From 9940dfad42498bfe2de8095dc287e0e04a836aee Mon Sep 17 00:00:00 2001 From: Christopher Yamas Date: Sun, 28 Dec 2025 16:19:00 -0500 Subject: [PATCH 1/7] Add vehicle_crew table for multi-operator trip support --- spec/vehicle_crew.schema.json | 99 +++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 spec/vehicle_crew.schema.json diff --git a/spec/vehicle_crew.schema.json b/spec/vehicle_crew.schema.json new file mode 100644 index 00000000..fee7821c --- /dev/null +++ b/spec/vehicle_crew.schema.json @@ -0,0 +1,99 @@ +{ + "primaryKey": [ + "service_date", + "trip_id_performed", + "crew_id", + "start_time" + ], + "missingValues": [ + "NA", + "NaN", + "" + ], + "fields": [ + { + "name": "service_date", + "type": "date", + "description": "Service date. References GTFS", + "constraints": { + "required": true + } + }, + { + "name": "trip_id_performed", + "type": "string", + "title": "ID referencing trips_performed.trip_id_performed", + "description": "Identifies the trip performed. Optional if crew assignment is at vehicle level only." + }, + { + "name": "vehicle_id", + "type": "string", + "title": "ID referencing vehicles.vehicle_id", + "description": "Identifies the vehicle.", + "constraints": { + "required": true + } + }, + { + "name": "crew_id", + "type": "string", + "title": "ID referencing operators.operator_id", + "description": "Identifies the crew member. References operators table.", + "constraints": { + "required": true + } + }, + { + "name": "crew_role", + "type": "string", + "description": "Role of the crew member on the vehicle.", + "constraints": { + "enum": [ + "operator", + "conductor", + "fare_inspector", + "other" + ] + } + }, + { + "name": "start_time", + "type": "datetime", + "description": "Timestamp when the crew member's assignment began.", + "constraints": { + "required": true + } + }, + { + "name": "end_time", + "type": "datetime", + "description": "Timestamp when the crew member's assignment ended. Null if assignment is ongoing." + } + ], + "foreignReferences": [ + { + "fields": ["service_date", "trip_id_performed"], + "reference": { + "resource": "trips_performed", + "fields": ["service_date", "trip_id_performed"] + } + }, + { + "fields": "vehicle_id", + "reference": { + "resource": "vehicles", + "fields": "vehicle_id" + } + }, + { + "fields": "crew_id", + "reference": { + "resource": "operators", + "fields": "operator_id" + } + } + ], + "name": "vehicle_crew.schema.json", + "description": "Crew member assignments to vehicles and trips, supporting multiple crew members and mid-trip reliefs.", + "_table_type": "Supporting" +} From 1024a7f17640b289e8b5fc59a3715cbed02b2c1b Mon Sep 17 00:00:00 2001 From: Christopher Yamas Date: Sun, 28 Dec 2025 16:20:21 -0500 Subject: [PATCH 2/7] Add vehicle_crew template file --- samples/template/TIDES/vehicle_crew.csv | 1 + 1 file changed, 1 insertion(+) create mode 100644 samples/template/TIDES/vehicle_crew.csv diff --git a/samples/template/TIDES/vehicle_crew.csv b/samples/template/TIDES/vehicle_crew.csv new file mode 100644 index 00000000..59d2084b --- /dev/null +++ b/samples/template/TIDES/vehicle_crew.csv @@ -0,0 +1 @@ +service_date,trip_id_performed,vehicle_id,crew_id,crew_role,start_time,end_time From cee11127589de4a85ac8b7ec6494f206c28fc928 Mon Sep 17 00:00:00 2001 From: Christopher Yamas Date: Sun, 28 Dec 2025 16:22:22 -0500 Subject: [PATCH 3/7] Update trips_performed.schema.json operator_id description --- spec/trips_performed.schema.json | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/spec/trips_performed.schema.json b/spec/trips_performed.schema.json index 8c4c4b35..68438416 100644 --- a/spec/trips_performed.schema.json +++ b/spec/trips_performed.schema.json @@ -35,10 +35,10 @@ } }, { - "name": "trip_id_scheduled", + "name": "operator_id", "type": "string", - "title": "ID referencing GTFS trips.trip_id", - "description": "Identifies the scheduled trip associated with the trip performed. One scheduled trip may be associated with multiple operated trips, or an operated trip may not be associated with a scheduled trip. References GTFS. If this trip was published in GTFS Schedule, this value should be consistent with the GTFS `trip_id`. If this trip was not scheduled, the value should be Null." + "title": "ID referencing operators.operator_id", + "description": "Identifies the vehicle's operator. Optional; for trips with multiple operators, use the first operator or reference the vehicle_crew table for complete crew assignments." }, { "name": "route_id", @@ -202,12 +202,6 @@ ] } }, - { - "name": "operator_id", - "type": "string", - "title": "ID referencing operators.operator_id", - "description": "Identifies the vehicle’s operator." - }, { "name": "block_id", "type": "string", From 6e22f04f914d16e2f2025ffe6a0eddaa9be51990 Mon Sep 17 00:00:00 2001 From: Christopher Yamas Date: Sun, 28 Dec 2025 16:27:14 -0500 Subject: [PATCH 4/7] Add vehicle_crew to tides-datapackage-profile.json enum --- spec/tides-datapackage-profile.json | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/tides-datapackage-profile.json b/spec/tides-datapackage-profile.json index aa25313b..9a284fd6 100644 --- a/spec/tides-datapackage-profile.json +++ b/spec/tides-datapackage-profile.json @@ -301,6 +301,7 @@ "stop_visits", "train_cars", "trips_performed", + "vehicle_crew", "vehicle_locations", "vehicle_train_cars", "vehicles" From 02cd18d71fb249c6c88014fccdd509b9d88d6737 Mon Sep 17 00:00:00 2001 From: Christopher Yamas Date: Mon, 29 Dec 2025 10:49:17 -0500 Subject: [PATCH 5/7] Add vehicle_crew resource in template datapackage.json --- samples/template/TIDES/datapackage.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/samples/template/TIDES/datapackage.json b/samples/template/TIDES/datapackage.json index 399cb82a..5bf53f32 100644 --- a/samples/template/TIDES/datapackage.json +++ b/samples/template/TIDES/datapackage.json @@ -150,6 +150,20 @@ } ] }, + { + "name": "vehicle_crew", + "profile": "tabular-data-resource", + "path": "vehicle_crew.csv", + "schema": "https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/vehicle_crew.schema.json", + "sources": [ + { + "title": "Where did data come from?", + "component": "Type of technology component, i.e. `CAD/AVL`", + "product": "Product used.", + "vendor": "Vendor selling product." + } + ] + }, { "name": "station_activities", "profile": "tabular-data-resource", From 20cd560d02403d01ad15362190a05ae6c7d4b955 Mon Sep 17 00:00:00 2001 From: Christopher Yamas Date: Mon, 29 Dec 2025 10:50:40 -0500 Subject: [PATCH 6/7] Update CHANGELOG with unreleased vehicle_crew addition --- CHANGELOG.md | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 610b96b5..6c541609 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- `vehicle_crew` table for multiple crew members per trip, including mid-trip reliefs ([#220](https://github.com/TIDES-transit/TIDES/issues/220)) + +### Changed + +- `trips_performed.operator_id` description clarified to reference vehicle_crew table for multi-operator trips ([#220](https://github.com/TIDES-transit/TIDES/issues/220)) + ## [1.0] - 2025-12-23 ### Changed @@ -23,17 +31,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Initial pre-release of the TIDES data specification - **Core Tables:** - - `vehicle_locations` - Timestamped vehicle locations and speeds. - - `passenger_events` - Timestamped passenger-related events, including boardings and alightings. - - `fare_transactions` - Timestamped fare transaction, associated with devices. - - `stop_visits` - Summarized boarding, alighting, arrival, departure, and other events (kneel engaged, ramp deployed, etc.) by trip and stop for each service date. - - `trips_performed` - Trips performed for each service date. - - `station_activities` - Summarized transactions, entries, and exits by stop or station and time period for each service date (for events not associated with a trip). - - `devices` - Measurement devices, such as AVL, APC, and AFC devices, associated with vehicles or stops or stations. - - `train_cars` - Assets that comprise vehicles, such as train cars, with descriptive information. - - `vehicle_train_cars` - Relationships between assets and vehicles. - - `vehicles` - Vehicles, including buses and train consists, with descriptive information. - - `operators` - Personnel who operate vehicles. +- `vehicle_locations` - Timestamped vehicle locations and speeds. +- `passenger_events` - Timestamped passenger-related events, including boardings and alightings. +- `fare_transactions` - Timestamped fare transaction, associated with devices. +- `stop_visits` - Summarized boarding, alighting, arrival, departure, and other events (kneel engaged, ramp deployed, etc.) by trip and stop for each service date. +- `trips_performed` - Trips performed for each service date. +- `station_activities` - Summarized transactions, entries, and exits by stop or station and time period for each service date (for events not associated with a trip). +- `devices` - Measurement devices, such as AVL, APC, and AFC devices, associated with vehicles or stops or stations. +- `train_cars` - Assets that comprise vehicles, such as train cars, with descriptive information. +- `vehicle_train_cars` - Relationships between assets and vehicles. +- `vehicles` - Vehicles, including buses and train consists, with descriptive information. +- `operators` - Personnel who operate vehicles. - TIDES Data Package Profile for data packaging - Sample template data package structure - Validation tools and test scripts From 9ea76dc96c42ef413a4838d7547b83ddb16493f1 Mon Sep 17 00:00:00 2001 From: Christopher Yamas Date: Mon, 29 Dec 2025 11:19:39 -0500 Subject: [PATCH 7/7] Fix indentation in Core Tables list to nest bullets --- CHANGELOG.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c541609..68a44282 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,17 +31,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Initial pre-release of the TIDES data specification - **Core Tables:** -- `vehicle_locations` - Timestamped vehicle locations and speeds. -- `passenger_events` - Timestamped passenger-related events, including boardings and alightings. -- `fare_transactions` - Timestamped fare transaction, associated with devices. -- `stop_visits` - Summarized boarding, alighting, arrival, departure, and other events (kneel engaged, ramp deployed, etc.) by trip and stop for each service date. -- `trips_performed` - Trips performed for each service date. -- `station_activities` - Summarized transactions, entries, and exits by stop or station and time period for each service date (for events not associated with a trip). -- `devices` - Measurement devices, such as AVL, APC, and AFC devices, associated with vehicles or stops or stations. -- `train_cars` - Assets that comprise vehicles, such as train cars, with descriptive information. -- `vehicle_train_cars` - Relationships between assets and vehicles. -- `vehicles` - Vehicles, including buses and train consists, with descriptive information. -- `operators` - Personnel who operate vehicles. + - `vehicle_locations` - Timestamped vehicle locations and speeds. + - `passenger_events` - Timestamped passenger-related events, including boardings and alightings. + - `fare_transactions` - Timestamped fare transaction, associated with devices. + - `stop_visits` - Summarized boarding, alighting, arrival, departure, and other events (kneel engaged, ramp deployed, etc.) by trip and stop for each service date. + - `trips_performed` - Trips performed for each service date. + - `station_activities` - Summarized transactions, entries, and exits by stop or station and time period for each service date (for events not associated with a trip). + - `devices` - Measurement devices, such as AVL, APC, and AFC devices, associated with vehicles or stops or stations. + - `train_cars` - Assets that comprise vehicles, such as train cars, with descriptive information. + - `vehicle_train_cars` - Relationships between assets and vehicles. + - `vehicles` - Vehicles, including buses and train consists, with descriptive information. + - `operators` - Personnel who operate vehicles. - TIDES Data Package Profile for data packaging - Sample template data package structure - Validation tools and test scripts