Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a validation rule to check for correct trip to route pair after the addition of trip-to-trip and route-to-route transfers #1268

Closed
isabelle-dr opened this issue Oct 11, 2022 · 0 comments · Fixed by #1267
Labels
GTFS Reference Used for Adding or changing rules that belong in the GTFS reference new rule New rule to be added status: Ready An issue that is ready to be worked on.
Milestone

Comments

@isabelle-dr
Copy link
Contributor

Describe the problem

In Q4 2021, trip-to-trip and route-to-route transfers were added to the specification (google/transit#278).
The validator schema has been modified accordingly (in PR #1208).

These new fields contain the mentions "must" that should be translated to new validation rules. Here are the spec additions in transfers.txt.

  1. in from_route_id and from_trip_id

If both from_trip_id and from_route_id are defined, the trip_id must belong to the route_id, and from_trip_id will take precedence.

  1. in to_route_id and to_trip_id

If both to_trip_id and to_route_id are defined, the trip_id must belong to the route_id, and to_trip_id will take precedence.

Describe the new validation rule

For each trip_id and route_id set defined in transfers.txt, make sure that the trip belongs to the correct route.

Pseudo code:

If [from_trip_id and from_route_id are defined] OR [to_trip_id and to_route_id are defined]:
  If  no record exists in trips.txt with the trip_id and route_id defined (not entirely sure this is the best way to see if the trip belongs to the correct route):
             Trigger the notice.

Sample GTFS datasets

No response

Severity

ERROR because there is a mention of "must"

Additional context

No response

@isabelle-dr isabelle-dr added GTFS Reference Used for Adding or changing rules that belong in the GTFS reference status: Needs triage Applied to all new issues new rule New rule to be added status: Ready An issue that is ready to be worked on. and removed status: Needs triage Applied to all new issues labels Oct 11, 2022
@isabelle-dr isabelle-dr changed the title Add a validation rule after the addition of trip-to-trip and route-to-route transfers Add a validation rule to check for correct trip to route pair after the addition of trip-to-trip and route-to-route transfers Oct 11, 2022
@bdferris-v2 bdferris-v2 linked a pull request Oct 13, 2022 that will close this issue
@isabelle-dr isabelle-dr added this to the Q4 2022 milestone Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GTFS Reference Used for Adding or changing rules that belong in the GTFS reference new rule New rule to be added status: Ready An issue that is ready to be worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant