-
Notifications
You must be signed in to change notification settings - Fork 206
Add communication_period and impact_period #546
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
base: master
Are you sure you want to change the base?
Conversation
|
Perhaps the impact period should be allowed even if there is no communication period so the producer doesn't have to support a communications period. Maybe also indicate the active period is being deprecated. |
gcamp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments, I agree with @doconnoronca that we should also deprecate active_period
gtfs-realtime/spec/en/reference.md
Outdated
| |------------------|------------|----------------|-------------------|-------------------| | ||
| | **active_period** | [TimeRange](#message-timerange) | Optional | Many | Time when the alert should be shown to the user. If missing, the alert will be shown as long as it appears in the feed. If multiple ranges are given, the alert will be shown during all of them. | | ||
| | **active_period** | [TimeRange](#message-timerange) | Conditionally Forbidden | Many | Time when the alert should be shown to the user. If missing, the alert will be shown as long as it appears in the feed. If multiple ranges are given, the alert will be shown during all of them. <br><br> - **Forbidden** if communication_period and impact_period exist | | ||
| | **communication_period** | [TimeRange](#message-timerange) | Conditionally Required | Many | Time when the alert should be shown to the user strictly for informative reasons. If missing, the alert will be shown as long as it appears in the feed. If multiple ranges are given, the alert will be shown during all of them. <br><br> - **Required** If impact_period is specified.<br> - **Forbidden** otherwise.| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| | **communication_period** | [TimeRange](#message-timerange) | Conditionally Required | Many | Time when the alert should be shown to the user strictly for informative reasons. If missing, the alert will be shown as long as it appears in the feed. If multiple ranges are given, the alert will be shown during all of them. <br><br> - **Required** If impact_period is specified.<br> - **Forbidden** otherwise.| | |
| | **communication_period** | [TimeRange](#message-timerange) | Conditionally Forbidden | Many | Time when the alert should be shown to the user strictly for informative reasons. If missing, the consuming application can decide when it's appropriate to be shown. If multiple ranges are given, the alert will be shown during all of them. <br><br> - **Optional** If impact_period is specified.<br> - **Forbidden** otherwise.| |
|
What is the use case of |
gtfs-realtime/spec/en/reference.md
Outdated
| | **active_period** | [TimeRange](#message-timerange) | Optional | Many | Time when the alert should be shown to the user. If missing, the alert will be shown as long as it appears in the feed. If multiple ranges are given, the alert will be shown during all of them. | | ||
| | **active_period** | [TimeRange](#message-timerange) | Conditionally Forbidden | Many | Time when the alert should be shown to the user. If missing, the alert will be shown as long as it appears in the feed. If multiple ranges are given, the alert will be shown during all of them. <br><br> - **Forbidden** if communication_period and impact_period exist | | ||
| | **communication_period** | [TimeRange](#message-timerange) | Conditionally Required | Many | Time when the alert should be shown to the user strictly for informative reasons. If missing, the alert will be shown as long as it appears in the feed. If multiple ranges are given, the alert will be shown during all of them. <br><br> - **Required** If impact_period is specified.<br> - **Forbidden** otherwise.| | ||
| | **impact_period** | [TimeRange](#message-timerange) | Conditionally Required | Many | Time when the services are affected by the disruption mentioned in the alert. <br><br> - **Required** If communication_period is specified.<br> - **Forbidden** otherwise.| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd remove the word "disruption" since alerts come in a lot of different flavors...
Time when the services are affected by this alert.
Agencies often want to alert riders to upcoming situations, and create alerts with a very broad I'm in favor of this generally, with a few notes:
|
I still don't know why there is a need for Also, is it required that the impact period is totally within the communication period. Is it allowed to have impact period outside communication period? Also, should the alert be shown in the following situations, assuming that the impact period is within the communication period?
|
I wouldn't be opposed to a spec update that says the dates of the active period are the dates it has an impact, and that an alert appearing in the feed should be considered an affirmative intent from the producer that it is currently within the desired communication timeframe. That would essentially achieve the same thing, but it's not quite how it's interpreted now. As for your four specific questions/situations... I think those are things that are pretty dependent on the specific consumer and the specific place in their app where the user is at the time. Different consumers may handle it differently, because their UX is different. If you are on a screen, for example, where you are looking at a route without planning a trip. I would suggest that the alert should be shown during the communication period. But if you're on a screen in the app that is specific to a future-planned trip that is outside of the impact period, then I probably wouldn't show the alert on that screen. In general, I do believe that the details of the user experience should still be the responsibility of the consuming app developer, and not something that's completely explicit in the spec. The spec should allow for communication of the agency's intent. |
|
Some people want to change the journey planner results based on the alerts. This alone is a reason to know about communication versus actual period. |
+1 to this. In the event that only Impact Period is defined, the alert should still be displayed, but only impact routing during the Impact Period. But I think agencies will also want the option to have an alert with a Communication Period without the need to define the hard boundaries of an Impact Period, especially if that alert is for something more nebulous, like an expected severe weather event (pun likely intended). For other alerts, there may not really be an "impact." So I would actually be in support of:
I don't think it would work, strictly speaking. Unless deprecated means we all just don't talk about it. 😅 I think it would have to be here to stay until the versioning question is resolved, yes?
Something else to consider regarding the usefulness of Communication Period is that an agency might not have staff available 24/7 to add an alert at any given moment. Such agencies may want the ability to "queue" up an alert by adding it to their feed ahead of time with a Communication Period for when they actually want it to be displayed in apps.
I think there are too many possible scenarios to establish explicit rules around how Communication and Impact Periods' respective time ranges must relate to one another. I'd rather allow agencies more flexibility on how they communicate with riders and keep the responsibility of conveying information in a logical way on them (anyway, you could still publish some very whacky alerts even with limitations on how impact/communication have to relate to one another).
I think that if the user is using the screen to select the date/time, then if there is a Communication Period defined and the selected date/time falls within the Communication Period, the tool should show it. If the selected date/time falls outside the Communication Period, do not show the alert. If there is no Communication Period defined but the alert is in the feed, show it. |
We are talking about GTFS-RT feeds here. Isn't GTFS-RT supposed to be generated real-time? |
It is, exactly at the moment that someone enters an notification, which is known from now on, but in effect at a later time. |
|
A couple points to make... Let's remember that GTFS is the standard for communicating information between two systems. It is not the feature specification for the features those systems can provide. With that in mind...
Sorry I've been slow to respond, but I agree with what @westontrillium said here about your use case. This is how I would design it, but again, if this is your product, you get to decide. There are other reasonable design patterns that could be used to accommodate the same intent.
People don't edit their GTFS-RT feeds directly. They use software to do so. It's totally reasonable for that software to have the "communication period" feature and use it to determine when to include the alert in the feed it produces, without us needing to have this as a field in the data spec. So I don't think that staff wanting to set up alerts ahead of when they want them communicated is necessarily a reason we have to have communication period in the spec -- it could just be a good feature of the producing application, if the spec was clear about what presence in the feed means. In general, my support for this is around clarifying for everyone what the intent of the people publishing alerts is. In practice, these people who use software to publish alerts have shown that they intend to inform their riders about things at times that are in advance of those things having an actual impact, if they know about them in advance. They do this already by publishing alerts with I'm in support of @westontrillium's suggestion here:
|
|
Since this PR and #504, it may be worth checking the meaning of "deprecate" in the context of GTFS Realtime. Here are some of my findings: In 2014, In 2018, during discussions on experimental field process, the practice of adding the In 2019, the previously "deprecated" TripDescriptor.ScheduleRelationship = REPLACEMENT was added back in .proto with the Since this approach allows any existing consumers or producers that have implemented support to leave their code as-is, this type of "deprecate" does not seem to be considered a breaking change but rather a strong recommendation? We can also observe this tendency in the discussion of #504 (e.g., this comment). If there is a consensus on this, we can follow the approach in #504 and include "deprecate guidance" in both the reference and .proto. @stevenmwhite @westontrillium @doconnoronca @gcamp |
|
Thank you all for your interest in this change and for your valuable feedback. @gcamp , @doconnoronca , @stevenmwhite and @westontrillium – on deprecating active_period, please check @tzujenchanmbd 's comment above. @stevenmwhite , @doconnoronca , and @westontrillium – your points regarding impact_period and communication_period are valid. I will make both fields optional while keeping restrictions on active_period to ensure it doesn’t interact with any new fields. @miklcct - Restricting impact_period within communication_period (if present) seems like a good approach, so we can add it to the spec change. Regarding the four cases you outlined, below is how they might play out. I say “might” because, as discussed, consumers determine where to display alerts in their app and how to handle them. The intent of this PR is to clarify when an alert is purely informative vs when it indicates an active impact. Case 1: If the current time is outside the communication_period, but the trips fall within the impact_period, then they are effectively inside the communication_period as well. Consumers may choose to adjust routing suggestions accordingly and display the alert in results or details pages since it is in effect. However, if the consumer has a “current service alerts” page, the alert might not be shown there. Case 2: If the current time is outside the communication_period, consumers may choose not to show the alert for informational purposes. Since the journeys are also outside the impact_period, they may not display an alert at all, as those journeys remain unaffected. Case 3: If the current time is within the communication_period, but the trips are outside the impact_period, the alert can be displayed for informational purposes, though it won’t impact current trips. Case 4: If the current time is within the communication_period, but the user searches for trips outside of it, the alert may appear on a general “current service alerts” page, but not necessarily in the journey results, this is up to the consumer’s implementation. |
|
Sorry to be late to the conversation, which I hope I'm sufficiently caught up on to comment. As a long-time publisher of alerts within a transit agency (Santa Clara VTA) and now with a tool (SimplifyTransit Alerts) used by agencies of all sizes to publish GTFS-realtime Alerts:
That said, SimplifyTransit also has a product that consumes GTFS-realtime Service Alerts, our Subscriptions module that sends highly personalized SMS/email alerts to riders.
I hope that's helpful. Happy to clarify anything or fill in gaps I missed. |
Strongly agree with this point. At Mecatran, as a transit alert data producer for many different consumers, we have to ensure full backward compatibility for all, regardless of their support for this change. To support this new version, I see two ways of handling this:
To be honest, I'd strongly prefer to follow option 2: so far the evolution of the GTFS-RT specs never forced us to version our APIs, and option 1 would require a new GTFS-RT version (this being not talked about here?). Option 2 would require to relax indeed a bit the possibility of mixing the 3 fields. Maybe the standard could express this, to allow mixing active with impact for backward-compatibility purpose? Stating that when the two version are present at the same time, the new version taking precedence over the old one. |
Chiming in to say that Switly is also in favour of Option 2 here, in that we see the inclusion of |
|
I think we should allow both fields, similar to the process of deprecating ADDED trips, and a migration guide added into the specification. |
|
This proposal has grown on me! The addition of communication_period will give our customers more control over when alerts are sent via SMS/email or published on their website, which they've appreciated hearing about. SimplifyTransit is ready to join in the testing phase if that's next, and implement if there are no major obstacles.
How long would we continue to have all three fields in Alerts feeds? One year? I don't think including "deprecated" fields in active feeds should go on indefinitely. If we need to publish all three fields for backwards compatibility, SimplifyTransit would only give our customers impact_period and active_period values would be identical to impact_period. Would that be acceptable to Consumers? Any problems with that approach? We've always trained our customers that active_period is when the Effect is impacting riders, so they'll enter impact_period the same way they enter active_period today. They won't really know the difference.
@miklcct could a "migration guide" specify a sunset date for active_period for all Producers, giving Consumers a reasonable amount of time to adapt? One year? |
|
I my experience, one year is rather short to make sure all consumer will support the new specs. I've seen in real life old systems not being updated for so long... Sorry to go back to this, but as the real meaning of the current
I'm not really sure why this alternative solution has been rejected (or at least not fully discussed)? |
I support this perspective @laurentg. If we have to provide three fields two of them will always be identical anyway. I also have never been confused by the primary meaning of active_period. What’s “active”? The Effect. Your reading of the connotation is correct. If an Alert were definitely not “active,” it wouldn’t be in the feed (with very few exceptions that all point to the value of adding communication_period). Active_period has never stopped Consumers from displaying an Alert before it starts (I hope). If Producers, Consumers and agencies need disambiguation by extracting communication_period into its own field, we can minimize impact 😉 by clarifying that “active_period” = “Effect/Impact is active.” We’ll approach it that way regardless. |
My current app will display alerts within the active period - i.e. for journey searches within the active period and timetable views when the user has selected a date/time within the active period. If outside, it won't be displayed. If this PR goes through, I will display the alerts within the communication period, where in the alert details, the impact period is shown to the user. |
|
@miklcct that’s perfect! You would do that regardless of when your user looks up that future journey, so you’re interpreting active_period as I understand it. That’s when the Effect is happening, but there’s no reason to hide it from riders before then and many reasons to show it to them. I honestly think the main benefit of adding communication_period will be helping agencies control website displays and our automated SMS/email. It will likely have minimal impact on apps (in large part because many agencies won’t practically spend the time creating distinct communication_periods). |
|
@laurentg @phil-swiftly @miklcct @ckraatz Thank you everyone for your feedback. The current definition of
In other words, @laurentg's suggestion to redefine This ambiguity and double interpretation of Therefore, proposing two new fields is basically a departure from
We would like to hear your thoughts on this, specifically:
|
|
The migration guide should say that new clients should ignore |
|
Is there any reason why this problem is not handled with semantic versioning like in any other versioned protocol or API? Version X deprecates the old field(s) and introduces the new field(s). Then version Y removes those previously deprecated fields after a grace period of M months/years/versions. The producer clearly indicates which version is used, which makes it easy for the consumer to know which fields to expect. If those fields are not present, the message is not valid and will therefore be discarded. Some protocols use two versions (compatibility version + target version, names can differ) to indicate "this message targets GTFS-RT seems to have a version already, but it doesn't seem to be used: transit/gtfs-realtime/proto/gtfs-realtime.proto Lines 56 to 58 in 1540c87
|
|
@skalexch I'm neutral as to whether there are three fields active (impact_period and communication_period prioritized, active_period deprecated and discouraged) or a redefinition of active_period and addition of communication_period. I see your points about backwards compatibility and clarity and would vote +1 for either option.
I strongly agree with @felixguendling that the deprecation and backwards compatibility dilemma's here would be resolved simply by a versioning protocol. It's not on @skalexch or any of us to solve in this PR, and requires a bigger conversation. As far as I can tell, it gets brought up but no one does anything about it. Another angle: are there examples of technology standards/protocols/languages/frameworks used widely around the world that do not have any sort of versioning protocol? Are GTFS and GTFS-realtime alone in that? Yikes! |
|
@miklcct @phil-swiftly @laurentg @felixguendling @ckraatz Thank you for the feedback! Regarding versioning, this topic has been previously discussed and remains a point of debate within GTFS (see PR#504 for an example). To continue the conversation, we’ve created a dedicated issue to focus specifically on versioning. For the current proposal, I removed the “forbidden” restriction for |
|
In Switzerland, we use SIRI-SX for the national exchange of event data. SIRI-SX has 1.n ValidityPeriods and 0.n PublicationWindow. In addition, there are 3 perspectives:
All SIRI-SX events are then converted into GTFS SA and published centrally for the entire Swiss public transport system. According to the proposal, a planned SIRI-SX event (e.g. a construction site) with two perspectives could then be converted or interpreted by GTFS SA as follows:
Unfortunately, the solution discussed here only partially solves our problem. For us, it is imperative that it be possible to map the perspectives. Otherwise, we have to provide 3 separate APIs, i.e. one for each of the 3 perspectives. This is because the following case cannot be displayed correctly: In practice, SIRI-SX often publishes an event with customer information for the timetable (Perspective=general / entire line / e.g. ‘Construction work on line 1’) and more specific customer information per stop (Perspective=stopPoint / e.g. ‘Due to construction work on line 6, stop XY has been moved’). |
|
@knr2000 Below is a suggestion for a possible way to model the different perspectives using Case 1) Perspective=general / entire line. E.g. ‘Construction work on line 1’. In that case, Then Case 2) Perspective=stopPoint. E.g. ‘Due to construction work on line 6, stop XY has been moved’. In that case, Then I hope I understood your point. Please let me know if I missed anything. |
|
Thank you for your feedback. I just realised that I made a small mistake in my example. Both events concern the same line 1. With your suggestion, both events would be displayed to the passenger at stop_id_XY on line route_id_line_1. And that is exactly what we want to avoid! Only one event should be displayed in the routing system and only one event should be displayed on the display at the bus stop. Passengers have different information needs depending on their perspective. I hope my requirement is now clear :-) Do you have any idea how we can solve this? |
From your description and example, SIRI-SX has a single data structure (the event) with 1 to 3(?) sub-data-structures (the perspectives.) The perspectives have separate human readable messages and time periods, and (probably) share other metadata about the event, e.g. to what type of real world entity it should be applied (route/schedule signage/pages, stop signage/pages, etc.) GTFS-RT does not have that hierarchy. Perhaps mapping the perspectives directly to the GTFS-RT service alert on a 1 to 1 basis, might solve that. Given that... having one GTFS-RT SA with an informed_entity with the route_id only, and the other with an informed_entity with the stop_id only (and having slightly different messages about the event,) could end up with the stop contexts showing both alerts... depending on how the consuming app controlling the signage determines which alerts to display. It might help if there was a way to group GTFS-RT alerts together to show they are applicable to the same event, adding back in the SIRI-SX hierarchy of event -> perspective. |
|
@knr2000 regarding the interpretation of different perspectives, @johnhelmuth-st's response sums it up. There is no hierarchy in GTFS-RT Service Alerts that would result in different perspective being shown at different times. Someone can create:
It definitely is worth discussing ways to group alerts together. In any case, the current proposal will not address this discrepancy. The proposal might however provide a direct mapping of time periods between GTFS-RT and SIRI-SX: |
|
Must a GTFS-realtime data change account for how it interoperates with a completely separate and distinct data standard? I understand it could, and perhaps some would argue it should. Is this a requirement? We haven’t had capacity yet, but we’re planning to test this because it has advantages in the GTFS-realtime paradigm. I wouldn’t support changes that make it align with another data standard AND interfere with the benefits in GTFS-realtime. I’m more interested in making this parallel and consistent with ideas inside GTFS-realtime, like disambiguating informed_entity with communication_entity and impacted_entity fields. To be clear, I’m all for walk-across bridges and translations between the data standards. I think there will be limits to that based on the paradigms they operate in. |
|
Hello everyone, @felixguendling , @phil-swiftly , @ckraatz , @miklcct , since you're actively working with GTFS-RT Alerts, do you have capacity to produce or consume these fields in the upcoming period? |
|
MOTIS already has the distinction on the routing API, so I'm waiting for a producer to test this with. |
Unfortunately we are a consolidator and we don't have such data available from the operators yet, neither in GTFS or other formats, so we cannot help on this. I am not aware of any operators in Great Britain who already have such distinction, regardless of the format they use. If anyone knows that please let me know. Furthermore, the general information provision on disruption is still very 3rd world in Great Britain. There is a requirement for local authorities in England to supply disruption data in SIRI-SX onto Bus Open Data Service but compliance is only seen in Greater Manchester. National Rail and Transport for London provide some data but they are not in any international standard, and the meanings are not 100% clear. Transport is a devolved matter in the UK so the requirement by the UK Government only applies to England, Scotland doesn't even have a National Access Point yet, and their government is still consulting on their open data requirement which lists compatibility with England as a point as well. |
|
Since the old field is already set to |
|
I’m excited to test and adopt this change in SimplifyTransit Alerts. We need to focus on some important backlog tasks right now, and I can’t commit to a timeline till I know those are complete. |

BACKGROUND
In the GTFS Realtime Alert spec, active_period is defined as: Time when the alert should be shown to the user. If missing, the alert will be shown as long as it appears in the feed. If multiple ranges are given, the alert will be shown during all of them.
However, there still is an ambiguity of interpretation of the active_period field; whether it is intended for the period of showing the alert or for the period of the related service disruption itself.
PROPOSAL
We propose the addition of two fields, communication_period and impact_period, to disambiguate active_period.
communication_period: Time when the alert should be shown to the user strictly for informative reasons.
impact_period: Time when the services are affected by the disruption mentioned in the alert.
We also define rules of interaction with active_period to ensure that the new fields are mutually exclusive with active_period.
More details and potential combinations can be found in Issue#521 and the proposal doc.