diff --git a/CHANGELOG.md b/CHANGELOG.md index 610b96b5..68a44282 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 @@ -26,9 +34,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `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. + - `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). + - `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. 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", 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 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" 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", 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" +}