-
Notifications
You must be signed in to change notification settings - Fork 30
Service Alert Data
sheldonabrown edited this page Apr 22, 2013
·
2 revisions
A service alert is a scheduled or unplanned interruption in service, such as a detour on a bus route due to a traffic collision. Service alert data is provided in SIRI-SX XML as shown below.
SIRI is a large and complex standard described here
Service Alert Data is queried for on a scheduled interval via a webservice call. The results of the call are expected to resemble the example below.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Siri xmlns:ns2="http://www.ifopt.org.uk/acsb" xmlns="http://www.siri.org.uk/siri" xmlns:ns4="http://datex2.eu/schema/1_0/1_0" xmlns:ns3="http://www.ifopt.org.uk/ifopt"> <ServiceDelivery> <ResponseTimestamp>2011-11-18T09:36:47.160-05:00</responsetimestamp> <SituationExchangeDelivery> <ResponseTimestamp>2011-11-18T09:36:47.160-05:00</responsetimestamp> <Status>true</status> <Situations> <PtSituationElement> <CreationTime>2011-11-18T10:03:16.597-05:00</creationtime> <SituationNumber>MTA NYCT_56754</situationnumber> <PublicationWindow> <StartTime>2011-10-25T20:00:00-04:00</starttime> <EndTime>2011-11-25T18:59:00-05:00</endtime> </publicationwindow> <Summary xml:lang="EN">X27, X28, X37 and X38 temporary bus stop change due a demonstration</summary> <Description xml:lang="EN">Until further notice Brooklyn bound buses will not make the stop at the near side of Cedar St due to police barricades and will now make the stop at the far side of Cedar St. Please allow additional travel time.</description> <Planned>true</planned> <ReasonName>Service Change</reasonname> <Source> <SourceType>directReport</sourcetype> </source> <Affects> <VehicleJourneys> <AffectedVehicleJourney> <LineRef>MTA NYCT_X27</lineref> <Direction> <DirectionRef>1</directionref> </direction> </affectedvehiclejourney> <AffectedVehicleJourney> <LineRef>MTA NYCT_X28</lineref> <Direction> <DirectionRef>1</directionref> </direction> </affectedvehiclejourney> <AffectedVehicleJourney> <LineRef>MTA NYCT_X37</lineref> <Direction> <DirectionRef>1</directionref> </direction> </affectedvehiclejourney> <AffectedVehicleJourney> <LineRef>MTA NYCT_X38</lineref> <Direction> <DirectionRef>1</directionref> </direction> </affectedvehiclejourney> </vehiclejourneys> </affects> <Consequences> <Consequence> <Condition>altered</condition> <Severity>undefined</condition> </consequence> </consequences> </ptsituationelement> <PtSituationElement> <SituationNumber>MTA NYCT_56755</situationnumber> <PublicationWindow> <StartTime>2011-11-07T19:00:00-05:00</starttime> </publicationwindow> <Summary xml:lang="EN">S79 buses detoured due to road work</summary> <Description xml:lang="EN">Buses are being detoured from Hylan Blvd between Midland Av and Steuben St</description> <Affects> <VehicleJourneys> <AffectedVehicleJourney> <LineRef>MTA NYCT_S79</lineref> <Direction> <DirectionRef>1</directionref> </direction> </affectedvehiclejourney> <AffectedVehicleJourney> <LineRef>MTA NYCT_S79</lineref> <Direction> <DirectionRef>0</directionref> </direction> </affectedvehiclejourney> </vehiclejourneys> </affects> <Consequences> <Consequence> <Condition>altered</condition> </consequence> </consequences> </ptsituationelement> </situations> </situationexchangedelivery> </servicedelivery> </siri>
Element | Explanation/Notes | Format | Required? |
---|---|---|---|
{{ResponseTimestamp}} | When this SIRI-SX XML was generated | String, full ISO-8601 format | Required |
{{Status}} | Indication of the success of the data generation process. {{true}} means success, {{false}} means failure. | String | Required |
{{CreationTime}} | Original creation time of the alert, if available. | String, full ISO-8601 format | Optional |
{{SituationNumber}} | Unique ID for a service alert. OneBusAway will use this to determine whether a service alert is new, updated, or should be deleted (e.g. when no longer delivered). | <agency></agency>_<id></id>, e.g. "MTA NYCT_567" | Required |
{{PublicationWindow.StartTime}} | Begin time for the service alert. Full ISO-8601-formatted string. | See XML sample above. | Optional |
{{PublicationWindow.EndTime}} | End time for the service alert. Full ISO-8601-formatted string. Note in the second {{PtSituationElement}} above, there is no {{PublicationWindow.EndTime}}, meaning the service alert is open-ended. A service alert can be open-ended at either end (e.g. not start or no end) or at both ends (e.g. has no defined start or end). Note if the there is neither {{StartTime}} nor {{EndTime}}, {{PublicationWindow}} should be omitted as well. | See XML sample above. | Optional |
{{Summary}} | Summary of service alert. {{Title}} element. | String | Optional |
{{Description}} | Full description of service alert. Text only, strip of all HTML. | String | Optional |
{{Planned}} | {{true}}=planned service alert, {{false}}=unplanned | String | Optional |
{{ReasonName}} | Text explanation of situation reason. One of: Good Service, Delay, Planned Work, Service Change, Suspended, Emergency | String | Required |
{{Source}}/{{SourceType}} | Hardcode to {{directReport}} for now. Possible SIRI-SX values: {{directReport, email, phone, fax, post, feed, radio, tv, web, pager, text, other}}. | String | Required |
{{LineRef}} | Route affected. If multiple routes are affected, the {{AffectedVehicleJourney}} element should be repeated (as shown in the first {{PtSituationElement}} in the sample). Prefix with "MTA NYCT_" prefix. Strip "-LTD" suffix (this works for Staten Island, will need to be revisited as we expand to other boroughs). | <agency></agency>_<route></route>, e.g. "MTA NYCT_B63" | Optional |
{{Direction,DirectionRef}} | Direction associated with the alert/situation. Should be one of: 0,1. S and W map to 1, N and E map to 0. When there is no value, treat this as being associated with both directions. | String, one of 0 or 1 | Optional |
{{Condition}} | Type of service alert. Permissible SIRI values are: {{unknown, altered, cancelled, delayed, diverted, noService, disrupted, additionalService, specialService, onTime, normalService, intermittentService, shortFormedService, fullLengthService, extendedService, splittingTrain, replacementTransport, arrivesEarly, shuttleService, replacementService, undefinedServiceInformation}}. -If multiple types need to be supplied, the {{Consequence}} element should be repeated. | String, one of the permissible values | Optional |
The following SIRI-SX elements will be parsed by OneBusAway if in the input, so if they can be made available, they can be used (not included above because they are not currently available). If any of these are to be used, we can provide new sample XML that details how they are delivered.
Element | Description |
---|---|
{{ValidityPeriod}} | Time window to which the service alert applies. |
{{ ( Environment|Equipment|Personnel|Miscellaneous ) Reason}} | Additional detail about the nature of the service alert. |
{{Severity}} | Additional detail about the nature of the service alert. |
{{InfoLink}} | URL at which more information can be acquired. |
Element | Description |
---|---|
OBA consequence.effect | SIRI-SX consequence.condition |
NO_SERVICE | CANCELLED, NO_SERVICE |
REDUCED_SERVICE | DISRUPTED, INTERMITTENT_SERVICE, SHORT_FORMED_SERVICE |
SIGNIFICANT_DELAYS | DELAYED |
DETOUR | DIVERTED |
ADDITIONAL_SERVICE | (ADDITIONAL | EXTENDED | SHUTTLE | SPECIAL | REPLACEMENT)_SERVICE |
MODIFIED_SERVICE | ALTERED, ARRIVES_EARLY, REPLACEMENT_TRANSPORT, SPLITTING_TRAIN |
OTHER_EFFECT | ON_TIME, FULL_LENGTH_SERVICE, NORMAL_SERVICE |
UNKNOWN_EFFECT | UNDEFINED_SERVICE_INFORMATION, UNKNOWN |
STOP_MOVED |
GMS unplanned | SIRI SX |
---|---|
Good Service | |
Delay | DELAYED |
Planned Work | DIVERTED |
Service Change | ALTERED |
Suspended | NO_SERVICE |
Emergency | DISRUPTED |