diff --git a/CHANGELOG.md b/CHANGELOG.md index 610b96b5..ccf02435 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- **BREAKING:** `vehicle_groups` table normalizing shared vehicle attributes (capacities, and additional attributes to be defined) ([#269](https://github.com/TIDES-transit/TIDES/issues/269), [#272](https://github.com/TIDES-transit/TIDES/pull/272)) +- `vehicle_assignments` table representing vehicles and consists in operation, to which operational data and devices may be associated ([#269](https://github.com/TIDES-transit/TIDES/issues/269)) +- `consist_vehicles` table documenting the cars of each consist with order and orientation ([#269](https://github.com/TIDES-transit/TIDES/issues/269)) +- `vehicle_direction` field on `vehicle_locations`, `passenger_events`, `fare_transactions`, `stop_visits`, and `trips_performed` ([#269](https://github.com/TIDES-transit/TIDES/issues/269)) + +### Changed + +- **BREAKING:** `vehicles` table repurposed as the registry of physical vehicles (buses and individual train cars); attribute fields moved to `vehicle_groups`, and `vehicle_label`, `license_plate`, `start_date`, `end_date`, and `vehicle_group_id` fields added ([#269](https://github.com/TIDES-transit/TIDES/issues/269)) + +### Removed + +- **BREAKING:** `train_cars` and `vehicle_train_cars` tables, superseded by `vehicles`, `vehicle_assignments`, and `consist_vehicles` ([#269](https://github.com/TIDES-transit/TIDES/issues/269)) + ## [1.0] - 2025-12-23 ### Changed diff --git a/samples/template/TIDES/consist_vehicles.csv b/samples/template/TIDES/consist_vehicles.csv new file mode 100644 index 00000000..5edae9be --- /dev/null +++ b/samples/template/TIDES/consist_vehicles.csv @@ -0,0 +1 @@ +consist_id,car_vehicle_id,car_order,car_orientation diff --git a/samples/template/TIDES/datapackage.json b/samples/template/TIDES/datapackage.json index 399cb82a..00877f98 100644 --- a/samples/template/TIDES/datapackage.json +++ b/samples/template/TIDES/datapackage.json @@ -67,10 +67,10 @@ ] }, { - "name": "train_cars", + "name": "operators", "profile": "tabular-data-resource", - "path": "train_cars.csv", - "schema": "https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/train_cars.schema.json", + "path": "operators.csv", + "schema": "https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/operators.schema.json", "sources": [ { "title": "Where did data come from?", @@ -81,10 +81,10 @@ ] }, { - "name": "operators", + "name": "stop_visits", "profile": "tabular-data-resource", - "path": "operators.csv", - "schema": "https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/operators.schema.json", + "path": "stop_visits.csv", + "schema": "https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/stop_visits.schema.json", "sources": [ { "title": "Where did data come from?", @@ -95,10 +95,10 @@ ] }, { - "name": "stop_visits", + "name": "vehicles", "profile": "tabular-data-resource", - "path": "stop_visits.csv", - "schema": "https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/stop_visits.schema.json", + "path": "vehicles.csv", + "schema": "https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/vehicles.schema.json", "sources": [ { "title": "Where did data come from?", @@ -109,10 +109,10 @@ ] }, { - "name": "vehicle_train_cars", + "name": "vehicle_groups", "profile": "tabular-data-resource", - "path": "vehicle_train_cars.csv", - "schema": "https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/vehicle_train_cars.schema.json", + "path": "vehicle_groups.csv", + "schema": "https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/vehicle_groups.schema.json", "sources": [ { "title": "Where did data come from?", @@ -123,10 +123,24 @@ ] }, { - "name": "vehicles", + "name": "vehicle_assignments", "profile": "tabular-data-resource", - "path": "vehicles.csv", - "schema": "https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/vehicles.schema.json", + "path": "vehicle_assignments.csv", + "schema": "https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/vehicle_assignments.schema.json", + "sources": [ + { + "title": "Where did data come from?", + "component": "Type of technology component, i.e. `AVL`", + "product": "Product used.", + "vendor": "Vendor selling product." + } + ] + }, + { + "name": "consist_vehicles", + "profile": "tabular-data-resource", + "path": "consist_vehicles.csv", + "schema": "https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/consist_vehicles.schema.json", "sources": [ { "title": "Where did data come from?", @@ -136,6 +150,7 @@ } ] }, + { "name": "trips_performed", "profile": "tabular-data-resource", diff --git a/samples/template/TIDES/fare_transactions.csv b/samples/template/TIDES/fare_transactions.csv index 530c18b9..3a850b6f 100644 --- a/samples/template/TIDES/fare_transactions.csv +++ b/samples/template/TIDES/fare_transactions.csv @@ -1 +1 @@ -transaction_id,date,timestamp,location_ping_id,amount,currency_type,fare_action,trip_id_performed,stop_sequence,vehicle_id,device_id,fare_id,stop_id,group_size,media_type,rider_category,fare_product,fare_period,fare_capped,fare_media_id,fare_media_id_purchased,balance,service_date,event_timestamp +transaction_id,date,timestamp,location_ping_id,amount,currency_type,fare_action,trip_id_performed,stop_sequence,vehicle_id,vehicle_direction,device_id,fare_id,stop_id,group_size,media_type,rider_category,fare_product,fare_period,fare_capped,fare_media_id,fare_media_id_purchased,balance,service_date,event_timestamp diff --git a/samples/template/TIDES/passenger_events.csv b/samples/template/TIDES/passenger_events.csv index 09ac509f..a6d00723 100644 --- a/samples/template/TIDES/passenger_events.csv +++ b/samples/template/TIDES/passenger_events.csv @@ -1 +1 @@ -passenger_event_id,service_date,event_timestamp,location_ping_id,trip_id_performed,trip_id_scheduled,trip_stop_sequence,scheduled_stop_sequence,event_type,vehicle_id,device_id,train_car_id,stop_id,pattern_id,event_count +passenger_event_id,service_date,event_timestamp,location_ping_id,trip_id_performed,trip_id_scheduled,trip_stop_sequence,scheduled_stop_sequence,event_type,vehicle_id,vehicle_direction,device_id,train_car_id,stop_id,pattern_id,event_count diff --git a/samples/template/TIDES/stop_visits.csv b/samples/template/TIDES/stop_visits.csv index d617b8a4..f82ef493 100644 --- a/samples/template/TIDES/stop_visits.csv +++ b/samples/template/TIDES/stop_visits.csv @@ -1 +1 @@ -service_date,trip_id_performed,trip_stop_sequence,scheduled_stop_sequence,pattern_id,vehicle_id,dwell,stop_id,timepoint,schedule_arrival_time,schedule_departure_time,actual_arrival_time,actual_departure_time,distance,boarding_1,alighting_1,boarding_2,alighting_2,departure_load,door_open,door_close,door_status,ramp_deployed_time,ramp_failure,kneel_deployed_time,lift_deployed_time,bike_rack_deployed,bike_load,revenue,number_of_transactions,schedule_relationship +service_date,trip_id_performed,trip_stop_sequence,scheduled_stop_sequence,pattern_id,vehicle_id,vehicle_direction,dwell,stop_id,timepoint,schedule_arrival_time,schedule_departure_time,actual_arrival_time,actual_departure_time,distance,boarding_1,alighting_1,boarding_2,alighting_2,departure_load,door_open,door_close,door_status,ramp_deployed_time,ramp_failure,kneel_deployed_time,lift_deployed_time,bike_rack_deployed,bike_load,revenue,number_of_transactions,schedule_relationship diff --git a/samples/template/TIDES/train_cars.csv b/samples/template/TIDES/train_cars.csv deleted file mode 100644 index 56056710..00000000 --- a/samples/template/TIDES/train_cars.csv +++ /dev/null @@ -1 +0,0 @@ -train_car_id,model_name,facility_name,capacity_seated,capacity_wheelchair,capacity_bike,bike_rack,capacity_standing,train_car_type diff --git a/samples/template/TIDES/trips_performed.csv b/samples/template/TIDES/trips_performed.csv index 74af104f..d83008e2 100644 --- a/samples/template/TIDES/trips_performed.csv +++ b/samples/template/TIDES/trips_performed.csv @@ -1 +1 @@ -date,trip_id_performed,vehicle_id,trip_id_scheduled,route_id,route_type,shape_id,direction_id,operator_id,block_id,trip_start_stop_id,trip_end_stop_id,schedule_trip_start,schedule_trip_end,actual_trip_start,actual_trip_end,trip_type,schedule_relationship,service_date +date,trip_id_performed,vehicle_id,vehicle_direction,trip_id_scheduled,route_id,route_type,shape_id,direction_id,operator_id,block_id,trip_start_stop_id,trip_end_stop_id,schedule_trip_start,schedule_trip_end,actual_trip_start,actual_trip_end,trip_type,schedule_relationship,service_date diff --git a/samples/template/TIDES/vehicle_assignments.csv b/samples/template/TIDES/vehicle_assignments.csv new file mode 100644 index 00000000..43147e60 --- /dev/null +++ b/samples/template/TIDES/vehicle_assignments.csv @@ -0,0 +1 @@ +vehicle_assignment_id,service_date,type,vehicle_id,vehicle_group_id,assignment_start_time,assignment_end_time,operational_status diff --git a/samples/template/TIDES/vehicle_groups.csv b/samples/template/TIDES/vehicle_groups.csv new file mode 100644 index 00000000..ff702670 --- /dev/null +++ b/samples/template/TIDES/vehicle_groups.csv @@ -0,0 +1 @@ +vehicle_group_id,capacity_seated,capacity_full,capacity_wheelchair,capacity_bike diff --git a/samples/template/TIDES/vehicle_locations.csv b/samples/template/TIDES/vehicle_locations.csv index bb4971df..c139e18e 100644 --- a/samples/template/TIDES/vehicle_locations.csv +++ b/samples/template/TIDES/vehicle_locations.csv @@ -1 +1 @@ -location_ping_id,date,timestamp,trip_id_performed,stop_sequence,vehicle_id,device_id,stop_id,current_status,latitude,longitude,gps_quality,heading,speed,odometer,schedule_deviation,headway_deviation,trip_type,schedule_relationship,event_timestamp +location_ping_id,date,timestamp,trip_id_performed,stop_sequence,vehicle_id,vehicle_direction,device_id,stop_id,current_status,latitude,longitude,gps_quality,heading,speed,odometer,schedule_deviation,headway_deviation,trip_type,schedule_relationship,event_timestamp diff --git a/samples/template/TIDES/vehicle_train_cars.csv b/samples/template/TIDES/vehicle_train_cars.csv deleted file mode 100644 index 9044359c..00000000 --- a/samples/template/TIDES/vehicle_train_cars.csv +++ /dev/null @@ -1 +0,0 @@ -vehicle_id,train_car_id,order,operator_id diff --git a/samples/template/TIDES/vehicles.csv b/samples/template/TIDES/vehicles.csv index 69d4735b..2933c71a 100644 --- a/samples/template/TIDES/vehicles.csv +++ b/samples/template/TIDES/vehicles.csv @@ -1 +1 @@ -vehicle_id,vehicle_start,vehicle_end,model_name,facility_name,capacity_seated,capacity_wheelchair,capacity_bike,bike_rack,capacity_standing +vehicle_id,start_date,end_date,vehicle_group_id,vehicle_label,license_plate diff --git a/spec/consist_vehicles.schema.json b/spec/consist_vehicles.schema.json new file mode 100644 index 00000000..cf385c8b --- /dev/null +++ b/spec/consist_vehicles.schema.json @@ -0,0 +1,69 @@ +{ + "primaryKey": [ + "consist_id", + "car_vehicle_id" + ], + "missingValues": [ + "NA", + "NaN", + "" + ], + "fields": [ + { + "name": "consist_id", + "type": "string", + "title": "ID referencing vehicle_assignments.vehicle_assignment_id", + "description": "Identifies the vehicle assignment record for the consist.", + "constraints": { + "required": true + } + }, + { + "name": "car_vehicle_id", + "type": "string", + "title": "ID referencing vehicles.vehicle_id", + "description": "Identifies the train car vehicle record in the vehicles table.", + "constraints": { + "required": true + } + }, + { + "name": "car_order", + "type": "integer", + "description": "The assigned order of the car within the consist.", + "constraints": { + "minimum": 1 + } + }, + { + "name": "car_orientation", + "type": "string", + "description": "Indicates the orientation of the car within the consist.", + "constraints": { + "enum": [ + "forward", + "backward" + ] + } + } + ], + "foreignReferences": [ + { + "fields": "consist_id", + "reference": { + "resource": "vehicle_assignments", + "fields": "vehicle_assignment_id" + } + }, + { + "fields": "car_vehicle_id", + "reference": { + "resource": "vehicles", + "fields": "vehicle_id" + } + } + ], + "name": "consist_vehicles.schema.json", + "description": "Assignment of vehicles/cars into consists.", + "_table_type": "Supporting" +} diff --git a/spec/devices.schema.json b/spec/devices.schema.json index 64384d14..504c04d0 100644 --- a/spec/devices.schema.json +++ b/spec/devices.schema.json @@ -27,12 +27,6 @@ "type": "string", "description": "Identifies the vehicle on which the device is located. May be null if the device is at a stop or station." }, - { - "name": "train_car_id", - "title": "ID referencing train_cars.train_car_id", - "type": "string", - "description": "Identifies the train car or asset on which the device is located. May be null if the device is at a stop or station or if the Train_cars file is not used." - }, { "name": "device_type", "type": "string", @@ -78,13 +72,6 @@ "resource": "vehicles", "fields": "vehicle_id" } - }, - { - "fields": "train_car_id", - "reference": { - "resource": "train_car", - "fields": "train_car_id" - } } ], "name": "devices.schema.json", diff --git a/spec/fare_transactions.schema.json b/spec/fare_transactions.schema.json index b9de76b7..b963b52e 100644 --- a/spec/fare_transactions.schema.json +++ b/spec/fare_transactions.schema.json @@ -118,6 +118,17 @@ "title": "ID referencing vehicles.vehicle_id", "description": "Identifies the vehicle. May be null if collection device is NOT located on a vehicle. May be null if on a vehicle but vehicle data is unavailable, in which case the data would be associated with a trip and/or stop." }, + { + "name": "vehicle_direction", + "type": "string", + "description": "Indicates the direction of travel of the vehicle for this event.", + "constraints": { + "enum": [ + "forward", + "backward" + ] + } + }, { "name": "device_id", "type": "string", diff --git a/spec/passenger_events.schema.json b/spec/passenger_events.schema.json index 0e91a7e3..1cbfbefc 100644 --- a/spec/passenger_events.schema.json +++ b/spec/passenger_events.schema.json @@ -105,16 +105,21 @@ } }, { - "name": "device_id", + "name": "vehicle_direction", "type": "string", - "title": "ID referencing devices.device_id", - "description": "Identifies the device that recorded the event. May be null if only a single device is reporting passenger events on a vehicle/ train car and the device_id is not distinct from vehicle_id/train_car_id." + "description": "Indicates the direction of travel of the vehicle for this event.", + "constraints": { + "enum": [ + "forward", + "backward" + ] + } }, { - "name": "train_car_id", + "name": "device_id", "type": "string", - "title": "ID referencing train_cars.train_car_id", - "description": "Identifies the train car." + "title": "ID referencing devices.device_id", + "description": "Identifies the device that recorded the event. May be null if only a single device is reporting passenger events on a vehicle and the device_id is not distinct from vehicle_id." }, { "name": "stop_id", @@ -174,13 +179,6 @@ "fields": "device_id" } }, - { - "fields": "train_car_id", - "reference": { - "resource": "train_cars", - "fields": "train_car_id" - } - }, { "fields": "stop_id", "reference": { diff --git a/spec/stop_visits.schema.json b/spec/stop_visits.schema.json index 104473fd..58c41891 100644 --- a/spec/stop_visits.schema.json +++ b/spec/stop_visits.schema.json @@ -57,6 +57,17 @@ "title": "ID referencing vehicles.vehicle_id", "description": "Identifies the vehicle." }, + { + "name": "vehicle_direction", + "type": "string", + "description": "Indicates the direction of travel of the vehicle for this event.", + "constraints": { + "enum": [ + "forward", + "backward" + ] + } + }, { "name": "dwell", "type": "integer", diff --git a/spec/tides-datapackage-profile.json b/spec/tides-datapackage-profile.json index aa25313b..3ab2d161 100644 --- a/spec/tides-datapackage-profile.json +++ b/spec/tides-datapackage-profile.json @@ -293,23 +293,24 @@ }, "tides-table": { "enum": [ + "consist_vehicles", "devices", "fare_transactions", "operators", "station_activities", "passenger_events", "stop_visits", - "train_cars", "trips_performed", + "vehicle_assignments", + "vehicle_groups", "vehicle_locations", - "vehicle_train_cars", "vehicles" ], "description": "An identifier string corresponding to the name of one of the table specs in the TIDES data package", "type": "string", "examples": [ "fare_transactions", - "train_cars" + "vehicles" ] }, "schema": { diff --git a/spec/tides.spec.json b/spec/tides.spec.json index e5f17d88..f395224c 100644 --- a/spec/tides.spec.json +++ b/spec/tides.spec.json @@ -10,6 +10,7 @@ "description": "Timestamped vehicle locations and speeds.", "path": "vehicle_locations.csv", "schema": "vehicle_locations.schema.json", + "profile": "tabular-data-resource", "required": false }, { @@ -18,6 +19,7 @@ "description": "Timestamped passenger-related events, including boardings and alightings.", "path": "passenger_events.csv", "schema": "passenger_events.schema.json", + "profile": "tabular-data-resource", "required": false }, { @@ -26,6 +28,7 @@ "description": "Timestamped fare transaction, associated with devices.", "path": "fare_transactions.csv", "schema": "fare_transactions.schema.json", + "profile": "tabular-data-resource", "required": false }, { @@ -34,6 +37,7 @@ "description": "Summarized boarding, alighting, arrival, departure, and other events (kneel engaged, ramp deployed, etc.) by trip and stop for each service date.", "path": "Stop_visits.csv", "schema": "stop_visits.schema.json", + "profile": "tabular-data-resource", "required": false }, { @@ -42,6 +46,7 @@ "description": "Trips performed for each service date.", "path": "trips_performed.csv", "schema": "trips_performed.schema.json", + "profile": "tabular-data-resource", "required": false }, { @@ -50,6 +55,7 @@ "description": "Summarized transactions, entries, and exits by stop or station and time period for each service date (for events not associated with a trip).", "path": "station_activities.csv", "schema": "station_activities.schema.json", + "profile": "tabular-data-resource", "required": false }, { @@ -58,30 +64,43 @@ "description": "Measurement devices, such as AVL, APC, and AFC devices, associated with vehicles or stops or stations.", "path": "devices.csv", "schema": "devices.schema.json", + "profile": "tabular-data-resource", "required": false }, { - "title": "Train Cars", - "name": "train_cars", - "description": "Assets that comprise vehicles, such as train cars, with descriptive information.", - "path": "train_cars.csv", - "schema": "train_cars.schema.json", + "title": "Vehicle Groups", + "name": "vehicle_groups", + "description": "Logical groupings of vehicles with similar attributes.", + "path": "vehicle_groups.csv", + "schema": "vehicle_groups.schema.json", + "profile": "tabular-data-resource", "required": false }, { - "title": "Vehicle Train Cars", - "name": "vehicle_train_cars", - "description": "Relationships between assets and vehicles.", - "path": "vehicle_train_cars.csv", - "schema": "vehicle_train_cars.schema.json", + "title": "Vehicle Assignments", + "name": "vehicle_assignments", + "description": "Daily assignments of vehicles and consists to service operations.", + "path": "vehicle_assignments.csv", + "schema": "vehicle_assignments.schema.json", + "profile": "tabular-data-resource", + "required": false + }, + { + "title": "Consist Vehicles", + "name": "consist_vehicles", + "description": "Assignment of train cars into ordered consists.", + "path": "consist_vehicles.csv", + "schema": "consist_vehicles.schema.json", + "profile": "tabular-data-resource", "required": false }, { "title": "Vehicles", "name": "vehicles", - "description": "Vehicles, including buses and train consists, with descriptive information.", + "description": "Vehicles, including buses and train cars, with descriptive information.", "path": "vehicles.csv", "schema": "vehicles.schema.json", + "profile": "tabular-data-resource", "required": false }, { @@ -90,6 +109,7 @@ "description": "Personnel who operate vehicles.", "path": "operators.csv", "schema": "operators.schema.json", + "profile": "tabular-data-resource", "required": false } ] diff --git a/spec/train_cars.schema.json b/spec/train_cars.schema.json deleted file mode 100644 index 67dd4bec..00000000 --- a/spec/train_cars.schema.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "primaryKey": "train_car_id", - "missingValues": [ - "NA", - "NaN", - "" - ], - "fields": [ - { - "name": "train_car_id", - "type": "string", - "description": "Identifies a train car or asset. If possible, this should match other internal agency asset IDs.", - "constraints": { - "required": true, - "unique": true - } - }, - { - "name": "model_name", - "type": "string", - "description": "Describes the train car or asset's model." - }, - { - "name": "facility_name", - "type": "string", - "description": "Name or internal agency ID for the facility where the train car or asset is generally held." - }, - { - "name": "capacity_seated", - "type": "integer", - "description": "Number of seats on the train car or asset.", - "constraints": { - "minimum": 0 - } - }, - { - "name": "capacity_wheelchair", - "type": "integer", - "description": "Number of wheelchair spaces on the train car or asset.", - "constraints": { - "minimum": 0 - } - }, - { - "name": "capacity_bike", - "type": "integer", - "description": "Number of bike spaces on the train car or asset.", - "constraints": { - "minimum": 0 - } - }, - { - "name": "bike_rack", - "type": "boolean", - "description": "Indicates if the train car or asset has a usable bike rack." - }, - { - "name": "capacity_standing", - "type": "integer", - "description": "Standing capacity of the train car or asset set by the manufacturer.", - "constraints": { - "minimum": 0 - } - }, - { - "name": "train_car_type", - "type": "string", - "description": "Indicates the type of train car or asset.", - "constraints": { - "enum": [ - "Train car", - "Trolley", - "Other" - ] - } - } - ], - "name": "train_cars.schema.json", - "description": "Assets that comprise vehicles, such as train cars, with descriptive information.", - "_table_type": "Supporting" -} diff --git a/spec/trips_performed.schema.json b/spec/trips_performed.schema.json index 8c4c4b35..d538d129 100644 --- a/spec/trips_performed.schema.json +++ b/spec/trips_performed.schema.json @@ -34,6 +34,17 @@ "required": true } }, + { + "name": "vehicle_direction", + "type": "string", + "description": "Indicates the direction of travel of the vehicle for this trip.", + "constraints": { + "enum": [ + "forward", + "backward" + ] + } + }, { "name": "trip_id_scheduled", "type": "string", diff --git a/spec/vehicle_assignments.schema.json b/spec/vehicle_assignments.schema.json new file mode 100644 index 00000000..ff786f1c --- /dev/null +++ b/spec/vehicle_assignments.schema.json @@ -0,0 +1,91 @@ +{ + "primaryKey": [ + "vehicle_assignment_id" + ], + "missingValues": [ + "NA", + "NaN", + "" + ], + "fields": [ + { + "name": "vehicle_assignment_id", + "type": "string", + "description": "The identifier associated with the vehicle or consist in the operational data. For a single vehicle (type=vehicle), this is typically the same as vehicles.vehicle_id. For a consist (type=consist), this is a unique identifier assigned when the consist is formed; a consist that is broken up and re-formed should receive a new identifier. This identifier is not required to match GTFS-realtime VehicleDescriptor values, though it may where operational systems use the same identifiers.", + "constraints": { + "required": true, + "unique": true + } + }, + { + "name": "service_date", + "type": "date", + "description": "Service date of the assignment. Optional; assignment_start_time and assignment_end_time may be used to bound assignments that span multiple days or change within a day." + }, + { + "name": "type", + "type": "string", + "description": "Indicates whether the assignment refers to a vehicle or a consist.", + "constraints": { + "required": true, + "enum": [ + "vehicle", + "consist" + ] + } + }, + { + "name": "vehicle_id", + "type": "string", + "title": "ID referencing vehicles.vehicle_id", + "description": "Identifies the physical vehicle for this assignment. Required when type=vehicle; omitted when type=consist (the cars of a consist are documented in consist_vehicles)." + }, + { + "name": "vehicle_group_id", + "type": "string", + "title": "ID referencing vehicle_groups.vehicle_group_id", + "description": "Identifies the vehicle group whose attributes apply to this assignment. For a single vehicle, this matches vehicles.vehicle_group_id; for a consist, this references the group describing the consist type." + }, + { + "name": "assignment_start_time", + "type": "datetime", + "description": "The timestamp when the assignment starts." + }, + { + "name": "assignment_end_time", + "type": "datetime", + "description": "The timestamp when the assignment ends." + }, + { + "name": "operational_status", + "type": "string", + "description": "Indicates the status of the vehicle on this date.", + "constraints": { + "enum": [ + "unavailable", + "available" + ] + } + } + + ], + "foreignReferences": [ + { + "fields": "vehicle_id", + "reference": { + "resource": "vehicles", + "fields": "vehicle_id" + } + }, + { + "fields": "vehicle_group_id", + "reference": { + "resource": "vehicle_groups", + "fields": "vehicle_group_id" + } + } + ], + "name": "vehicle_assignments.schema.json", + "description": "Vehicles and consists available for assignment to service, to which operational data and devices may be associated. Optional table: agencies with static fleets and no consists or vehicle status tracking may omit it. A single-car train is represented by two records: one for the physical vehicle and one for the consist.", + "_table_type": "Supporting" +} \ No newline at end of file diff --git a/spec/vehicle_groups.schema.json b/spec/vehicle_groups.schema.json new file mode 100644 index 00000000..8b64451a --- /dev/null +++ b/spec/vehicle_groups.schema.json @@ -0,0 +1,54 @@ +{ + "primaryKey": "vehicle_group_id", + "missingValues": [ + "NA", + "NaN", + "" + ], + "fields": [ + { + "name": "vehicle_group_id", + "type": "string", + "description": "Identifies a group of vehicles.", + "constraints": { + "required": true, + "unique": true + } + }, + { + "name": "capacity_seated", + "type": "integer", + "description": "Number of seats on the vehicle.", + "constraints": { + "minimum": 0 + } + }, + { + "name": "capacity_full", + "type": "integer", + "description": "Total capacity of the vehicle set by the manufacturer.", + "constraints": { + "minimum": 0 + } + }, + { + "name": "capacity_wheelchair", + "type": "integer", + "description": "Number of wheelchair spaces on the vehicle.", + "constraints": { + "minimum": 0 + } + }, + { + "name": "capacity_bike", + "type": "integer", + "description": "Number of bike spaces on the vehicle.", + "constraints": { + "minimum": 0 + } + } + ], + "name": "vehicle_groups.schema.json", + "description": "Groups of vehicles.", + "_table_type": "Supporting" +} \ No newline at end of file diff --git a/spec/vehicle_locations.schema.json b/spec/vehicle_locations.schema.json index 8f7d3d62..09a4da51 100644 --- a/spec/vehicle_locations.schema.json +++ b/spec/vehicle_locations.schema.json @@ -67,6 +67,17 @@ "required": true } }, + { + "name": "vehicle_direction", + "type": "string", + "description": "Indicates the direction of travel of the vehicle for this event.", + "constraints": { + "enum": [ + "forward", + "backward" + ] + } + }, { "name": "device_id", "type": "string", diff --git a/spec/vehicle_train_cars.schema.json b/spec/vehicle_train_cars.schema.json deleted file mode 100644 index a08671b8..00000000 --- a/spec/vehicle_train_cars.schema.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "primaryKey": [ - "vehicle_id", - "train_car_id" - ], - "missingValues": [ - "NA", - "NaN", - "" - ], - "fields": [ - { - "name": "vehicle_id", - "type": "string", - "title": "ID referencing vehicles.vehicle_id", - "description": "Identifies a vehicle, such as a train consist. If possible, this should match other internal agency vehicle IDs.", - "constraints": { - "required": true - } - }, - { - "name": "train_car_id", - "type": "string", - "title": "ID referencing train_cars.train_car_id", - "description": "Identifies a train car or an asset that is a component of the vehicle.", - "constraints": { - "required": true - } - }, - { - "name": "train_car_order", - "type": "integer", - "description": "The assigned order of the train car or asset within the vehicle.", - "constraints": { - "minimum": 0 - } - }, - { - "name": "operator_id", - "type": "string", - "description": "Identifies an operator (person). If possible, this should match other internal agency operator IDs." - } - ], - "foreignReferences": [ - { - "fields": "vehicle_id", - "reference": { - "resource": "vehicles", - "fields": "vehicle_id" - } - }, - { - "fields": "train_car_id", - "reference": { - "resource": "train_cars", - "fields": "train_car_id" - } - }, - { - "fields": "operator_id", - "reference": { - "resource": "operator", - "fields": "operator_id" - } - } - ], - "name": "vehicle_train_cars.schema.json", - "description": "Relationships between assets and vehicles.", - "_table_type": "Supporting" -} diff --git a/spec/vehicles.schema.json b/spec/vehicles.schema.json index 2980b539..c784a3e2 100644 --- a/spec/vehicles.schema.json +++ b/spec/vehicles.schema.json @@ -9,71 +9,49 @@ { "name": "vehicle_id", "type": "string", - "description": "Identifies a vehicle, such as a bus or a train consist. If possible, this should match other internal agency vehicle IDs and the GTFS-realtime VehicleDescriptor.", + "description": "Identifies a physical vehicle, such as a bus or an individual train car. If possible, this should match internal agency asset and vehicle IDs. Note that identifiers in operational data streams (including GTFS-realtime) may refer to either an individual vehicle or a consist; those operational identifiers are documented in vehicle_assignments.", "constraints": { "required": true, "unique": true } }, { - "name": "vehicle_start", - "type": "datetime", - "description": "The timestamp at which the vehicle or train consist is first in operation (i.e., when the consist has been created). Required if Train_car is used." + "name": "start_date", + "type": "date", + "description": "Start of the date range for which operational data may reference this vehicle." }, { - "name": "vehicle_end", - "type": "datetime", - "description": "The timestamp at which the vehicle or train consist no longer exists (i.e., the consist is separated or modified). Only used if Train_car is used." + "name": "end_date", + "type": "date", + "description": "End of the date range for which operational data may reference this vehicle." }, { - "name": "model_name", + "name": "vehicle_group_id", "type": "string", - "description": "Describes the vehicle's model." + "title": "ID referencing vehicle_groups.vehicle_group_id", + "description": "Identifies the vehicle group whose attributes apply to this vehicle." }, { - "name": "facility_name", + "name": "vehicle_label", "type": "string", - "description": "Name or internal agency ID for the facility where the vehicle is generally held." + "description": "The public identifier that is shown on the vehicle (e.g., the bus number)" }, { - "name": "capacity_seated", - "type": "integer", - "description": "Number of seats on the vehicle. Used if Train_car is not used.", - "constraints": { - "minimum": 0 - } - }, - { - "name": "capacity_wheelchair", - "type": "integer", - "description": "Number of wheelchair spaces on the vehicle. Used if Train_car is not used.", - "constraints": { - "minimum": 0 - } - }, - { - "name": "capacity_bike", - "type": "integer", - "description": "Number of bike spaces on the vehicle. Used if Train_car is not used.", - "constraints": { - "minimum": 0 - } - }, - { - "name": "bike_rack", - "type": "boolean", - "description": "Indicates if the vehicle has a useable bike rack. Used if Train_car is not used." - }, + "name": "license_plate", + "type": "string", + "description": "The text of the license plate on the vehicle." + } + ], + "foreignReferences": [ { - "name": "capacity_standing", - "type": "integer", - "description": "Standing capacity of the vehicle set by the manufacturer. Used if Train_car is not used.", - "constraints": { - "minimum": 0 + "fields": "vehicle_group_id", + "reference": { + "resource": "vehicle_groups", + "fields": "vehicle_group_id" } } ], "name": "vehicles.schema.json", - "description": "Vehicles, including buses and train consists, with descriptive information.", + "description": "Physical vehicles, including buses and individual train cars.", "_table_type": "Supporting" }