-
Notifications
You must be signed in to change notification settings - Fork 183
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
stops.zone_id conditional requirement with presence of route-based fare_rules? #429
Comments
Thanks for flagging this @westontrillium! There are two things that might need to be addressed here: primarily a spec clarification (as you pointed out) and secondly an adjustment to the validator rules to avoid this notice when zone-based fares are not being used. On our end we tried to put together two spec clarification alternatives for stops.zone_id, but we didn't ended up having a significant improvement from your proposal, perhaps they can serve as inspiration to make some adjustments (if any) to your proposal.
Regarding the second step, we’re already included this in our backlog of validator changes. Would you be interested in carrying this over to a PR? |
Yes I'd be happy to create a PR for this clarification. Thanks for the wording assistance–I'll pull something together with these in mind. |
I just wanted to call out some additional complexity with the spec here. Fares v1 was always underspecified in the spec so I'm not surprised there are holes here. I wanted to call out another. Namely, I don't think there is anything in the spec that requires a feed to exhaustively define fares for all service in the feed. I think that's true for a single-agency feed, but I think it's especially true for multi-agency feeds where a single agency might have Fares v1 information, but another agency in the feed does not, for whatever reason. Under these circumstances, there very well might be stops that do not have Ignoring validation for a moment and focusing only on the spec, I'd argue that the field is not actually required under any circumstances. I can think of many should statements that might trigger warnings, but fewer musts. |
Describe the problem
We have received multiple messages from agencies confused by an error (
stop_without_zone_id
) found in validation reports forwarded to them by the National Transit Database. I've investigated the error and am wondering if the way the spec handleszone_id
requirements should be clarified, and if so, whether such a clarification would break backwards compatibility. I'm not sure, because it is a conditional requirement, and adding the exception I propose below would be easing a restriction, not adding a new one.The current requirement is essentially: If fare_rules.txt contains records, then presence of
zone_id
is required for all stops in the dataset.However, there are cases where you could define a fare_rule without the use of
zone_id
s, for example, with route-based fares. In my opinion, a feed should still be valid with partialzone_id
presence IF those stops without azone_id
are present in stop_times records with atrip_id
whoseroute_id
is present in a fare_rules.txt record with onlyfare_id
androute_id
defined.Use cases
Consider the following example
fare_rules.txt
stops.txt
Given that
stop_id=111
is present only inroute_id=50
trips, you can determine that any itinerary that includes the stop will have a fare offare_id=7549
since it belongs to route_id=50. Giving the stop azone_id
would be superfluous because there is no fare rule that zone would belong to.Proposed solution
Is it possible to modify the conditional requirement, adding the following exception to the rule?
"Required if providing fare information using fare_rules.txt, unless stop is present only in stop_times.txt records with a
trip_id
whoseroute_id
is present in a fare_rules.txt record with onlyfare_id
androute_id
defined."Ideally written in a less confusing way 😅
Additional information
I have attached an example dataset you can run through the validator to see the
stop_without_zone_id
error in question.stop_without_zone_id_feedTEST.zip
You will find several stops without
zone_id
s accounted for by route-based fares that trigger the error.To my knowledge, feeds containing the
stop_without_zone_id
due to this reason have passed validation of consumers like Google.The text was updated successfully, but these errors were encountered: