-
Notifications
You must be signed in to change notification settings - Fork 173
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
Clarify definition of "cardinality" #19
Conversation
"Cardinality" as currently defined in the spec documentation is Protocol Buffer cardinality, and not semantic cardinality. This patch clarifies that definition in the field title. See https://groups.google.com/d/msg/gtfs-realtime/wm3W7QIEZ9Y/DLyWKkknJyoJ.
It's a bit long, maybe Field Cardinality instead? (still not a fan) |
@bboissin I originally had "Protobuf Cardinality" but then changed to the full text. I can change back to this if it's preferred. Or maybe "PB Cardinality", defining "PB" above? Also open to other ideas. I think it's important to make clear that this is an implementation-specific cardinality, so I'd prefer to call out protobufs specifically. |
Honestly, I think we should just replace that column's contents with the semantic cardinality instead (which we also need to document in the .proto anywhere it's unclear). |
@magdalar I agree - this PR was a baby-step in that direction, but I'm fine with directly tackling semantic cardinality if you'd prefer. I think there will be some debate, though, on semantic cardinality (for example #20 (comment)). Do you want me to go ahead and propose the semantic cardinality in this PR? |
@barbeau I think that would be the much more useful discussion, even if it might end up being a bit hairier to tackle :) |
@magdalar Two questions on semantic cardinality, using #20 (comment) and
So, would So, my opinion for how the spec language should be mapped to semantic cardinality:
|
@barbeau Apologies for the delay -- somehow I lost track of this!
The other potential difference however is supporting backwards compatibility. Given at least the current state of affairs, it's difficult to add new requirements and enforce them. I'd like to change that status quo, however, because it ties our hands. My comment from pull #20 was largely addressing the backwards-compatible nature, rather than the desired intent. I could also quite easily be convinced to your own proposed terminology. :) |
This was my original thought, and in a vacuum it makes sense, but the problem is that it doesn't seem to hold up in the wild. However, I'm also not sure I like conditionally required being mapped to should in the spec, as that could force us to switch a lot of fields that should be required to conditionally required depending on implementation limitations. And we're trying to get away from implementation-specific (protobuf) cardinality with this proposal. I'd like to see the semantic cardinality reflect what should logically be contained in a feed. A stronger stance to change the status quo could be to start using One question with this design is whether we change should to must in the language for the spec for fields like |
Alright, I'm convinced by your terminology choices :) On Mon, Feb 29, 2016 at 4:27 PM, Sean Barbeau notifications@github.com
|
@magdalar Are you ok then with bumping |
@barbeau I don't think that's a call we can make directly, but I think it's worth proposing alongside the rest of the proposal. I would recommend proceeding as if it were the case though, as a specification without strong wording or guarantees is not particularly useful in practice :) |
(So, yes.) |
What is the status of the proposal? |
@egorich239 I still intend to tackle semantic cardinality in this proposal, although I've had to focus on a few other things over the last few months. I plan to be able to spend more time on this in the next few weeks. |
Given the age and focus of this PR, I'm going to close it out and open a new PR focused primarily on semantic cardinality. This will make the discussion easier to follow for those new to the topic. |
* As originally discussed in google#19 and https://groups.google.com/forum/#!msg/gtfs-realtime/wm3W7QIEZ9Y/DLyWKkknJyoJ, the current GTFS-realtime spec documentation describes field Protocol Buffer cardinality, not semantic cardinality. This has created confusion for consumers and producers where fields have been omitted based on them being labeled as "optional" in the GTFS-realtime spec, even if they were required under certain logical transit conditions (e.g., stop_sequence must be provided if a trip contains a loop). * This patch changes the "Cardinality" documentation to define the semantic cardinality for each data element as "required", "conditionally required", and "optional". It also bumps the gtfs_realtime_version in the .proto file to 2.0 so validators can strictly enforce semantic cardinality based on the gtfs_realtime_version.
* Define semantic cardinality for GTFS-realtime fields * As originally discussed in #19 and https://groups.google.com/forum/#!msg/gtfs-realtime/wm3W7QIEZ9Y/DLyWKkknJyoJ, the current GTFS-realtime spec documentation describes field Protocol Buffer cardinality, not semantic cardinality. This has created confusion for consumers and producers where fields have been omitted based on them being labeled as "optional" in the GTFS-realtime spec, even if they were required under certain logical transit conditions (e.g., stop_sequence must be provided if a trip contains a loop). * This patch changes the "Cardinality" documentation to define the semantic cardinality for each data element as "required", "conditionally required", and "optional". It also bumps the gtfs_realtime_version in the .proto file to 2.0 so validators can strictly enforce semantic cardinality based on the gtfs_realtime_version. * Make trip.stop_time_update conditionally required based on trip.schedule_relationship Addresses #64 (review) * Fix conditional states for stop_time_update.arrival/departure ...based on stop_time_update.schedule_relationship. See https://github.com/google/transit/blob/master/gtfs-realtime/spec/en/reference.md#enum-schedulerelationship * Separate "Required" and "Cardinality" into different columns * A new "Required" field holds the information as to whether a particular field is Required, Optional, or Conditionally required * The existing "Cardinality" field is changed to a semantic version of cardinality instead of using Protobuf cardinality * Change FeedMessage.entity to "Conditionally required" * This field can't be "Required", because there are legitimate scenarios where a feed may not have any real-time information about the system (e.g., if it's 3am, and the agency doesn't offer any service at 3am). So, change to "Conditionally required" with description.
"Cardinality" as currently defined in the spec documentation is Protocol Buffer cardinality, and not semantic cardinality. This patch clarifies that definition in the field title. See https://groups.google.com/d/msg/gtfs-realtime/wm3W7QIEZ9Y/DLyWKkknJyoJ for related past discussions.
This proposal is announced on GTFS-realtime list at https://groups.google.com/forum/#!topic/gtfs-realtime/JU5I0HRlzpE.