MobilityData / gtfs-realtime-validator

Java-based tool that validates General Transit Feed Specification (GTFS)-realtime feeds
Other
41 stars 10 forks source link

New rule - Check Alert EntitySelector field integrity #19

Open barbeau opened 2 years ago

barbeau commented 2 years ago

Issue by barbeau Thursday Oct 06, 2016 at 14:12 GMT Originally opened as https://github.com/CUTR-at-USF/gtfs-realtime-validator/issues/19


See discussion at https://groups.google.com/forum/#!topic/gtfs-realtime/jamsDygrcSk.

Protocol Buffer currently allows you to specify route_id and route_type, and .proto indicates that they should be joined as an AND. However, the documentation suggests they are treated as an OR.

barbeau commented 2 years ago

Comment by barbeau Wednesday Sep 12, 2018 at 21:58 GMT


It would be useful to analyze how many agencies are populating the EntitySelector.route_type field but not EntitySelector.route_id in service alerts, how many agencies are populating EntitySelector.route_id but not EntitySelector.route_type in service alerts, and how many agencies are populating both EntitySelector.route_type AND EntitySelector.route_id in service alerts.

barbeau commented 2 years ago

Comment by barbeau Wednesday Oct 10, 2018 at 14:25 GMT


Our plan going forward:

  1. Review the protobuf - https://github.com/google/transit/blob/master/gtfs-realtime/proto/gtfs-realtime.proto#L587 - and verify the behavior outlined there, which from a glance appears to be AND
  2. Review all combinations of EntitySelector variables and flag any that don't make sense when combined using AND
  3. Review and update all of the alert text documentation to reflect the AND behavior:
  4. Verify with agencies that are publishing both fields that their intent is the AND behavior, not OR
barbeau commented 2 years ago

Comment by minhhpham Monday Oct 22, 2018 at 21:52 GMT


Step 2 can be viewed at https://drive.google.com/drive/folders/1qYFLHdgJdVQ8rpoDlgPiCzvd1DfO8fV3

barbeau commented 2 years ago

Comment by barbeau Monday Oct 29, 2018 at 15:26 GMT


Initial draft PR at https://github.com/MobilityData/transit/pull/5.

barbeau commented 2 years ago

Comment by barbeau Monday Oct 29, 2018 at 15:27 GMT


@minhhpham We have another step that I forgot to add in the above comment earlier (I just added it):

Verify with agencies that are publishing both fields that their intent is the AND behavior, not OR

After we finalize the existing draft PR and confirm with agencies, then we can open PR on main Google repo.

barbeau commented 2 years ago

Comment by barbeau Wednesday Nov 14, 2018 at 22:58 GMT


Proposal opened at https://github.com/google/transit/pull/118.

barbeau commented 2 years ago

Comment by barbeau Thursday Feb 07, 2019 at 20:46 GMT


https://github.com/google/transit/pull/118 clarifies the AND behavior and was accepted into the spec.

We can now implement a rule that checks the integrity of the fields provided in the EntitySelector to ensure they match. For example, a route_type and route_id should both refer to the same GTFS route - having a route_type for the provided route_id that doesn't match the GTFS route_type for that route_id would be an error.