Duplicate Informed_Entity values for stations


#1

In this morning’s Alert feed for SydneyTrains we see two alerts for Stop_ID=213510 (as shown below for reference). I can understand why if you were just providing a list of data but this in effect causes problems for anybody who needs to update their own data model. Surely the data should be created as either 1 alert with the text saying "The lifts between the concourse and platforms 3/4 and 5/6 are temporarily out of service, or it should have 4 separate informed_entity values for the individual stop_id’s of the individual platforms.

We need to know if these duplicate id’s are specific to stops or if we might have to consider duplicate id’s for routes or trips.

If anybody has an example of a completely full Alert feed that has every type of informed_entity that could be generated that would also be hugely helpful.

Thanks, Andy

— copy —
entity {
id: “134”
alert {
informed_entity {
agency_id: “SydneyTrains”
stop_id: “213510”
}
cause: OTHER_CAUSE
effect: UNKNOWN_EFFECT
url {
translation {
text: “https://transportnsw.info/alerts#/train
language: “en”
}
}
header_text {
translation {
text: “Lift Availability - Strathfield”
language: “en”
}
}
description_text {
translation {
text: “The lift between the concourse and platforms 3/4 is temporarily out of service. If you require assistance, please ask staff or phone 97528431.”
language: “en”
}
}
}
}
entity {
id: “135”
alert {
informed_entity {
agency_id: “SydneyTrains”
stop_id: “213510”
}
cause: OTHER_CAUSE
effect: UNKNOWN_EFFECT
url {
translation {
text: “https://transportnsw.info/alerts#/train
language: “en”
}
}
header_text {
translation {
text: “Lift Availability - Strathfield”
language: “en”
}
}
description_text {
translation {
text: “The lift between the concourse and platforms 5/6 is temporarily out of service. If you require assistance, please ask staff or phone 9752 8431.”
language: “en”
}
}
}
}
— end —


#2

Alerts are linked by informed entities to the specific entities in a many to many relationship, as per the GTFS real-time spec. There’s no restriction on how many alerts can be associated with a particular entity. For example, there could be a “Delays” alert showing for a particular set of routes and a “Special Events” alert that applies to all routes. Example below from around 6:18pm today:

entity {
  id: "1"
  alert {
    informed_entity {
      agency_id: "SydneyTrains"
      route_id: "IWL_1a"
    }
    informed_entity {
      agency_id: "SydneyTrains"
      route_id: "IWL_1b"
    }
    ...
    informed_entity {
      agency_id: "SydneyTrains"
      route_id: "IWL_2j"
    }
    url {
      translation {
        text: "https://transportnsw.info/alerts#/train"
        language: "en"
      }
    }
    header_text {
      translation {
        text: "Inner West & Leppington Line - Delays"
        language: "en"
      }
    }
    description_text {
      translation {
        text: "Due to a train requiring mechanical repairs at Liverpool. Please listen to announcements, check indicator boards and real-time apps as stopping patterns and departure platforma may change at short notice."
        language: "en"
      }
    }
  }
}
entity {
  id: "21"
  alert {
    ...
    informed_entity {
      agency_id: "SydneyTrains"
      route_id: "IWL_1g"
    }
    informed_entity {
      agency_id: "SydneyTrains"
      route_id: "IWL_2a"
    }
    informed_entity {
      agency_id: "SydneyTrains"
      route_id: "IWL_2b"
    }
    informed_entity {
      agency_id: "SydneyTrains"
      route_id: "BNK_1a"
    }
    ...
    url {
      translation {
        text: "https://transportnsw.info/alerts#/train"
        language: "en"
      }
    }
    header_text {
      translation {
        text: "Special Events - 28th February 2019"
        language: "en"
      }
    }
    description_text {
      translation {
        text: "Cup of Nations - Leichhardt Oval, Lilyfield\nGates open 16:15 \nMatch 1 - Argentina v Korea Republic 16:35 \nMatch 2 - Australia v New Zealand 19:30 \nFinish 21:00\n- The best station for connections to Leichhardt Oval is Central. Change at Central for a Light rail service to Leichhardt North or catch a bus route 440 from Railway Square to Leichhardt."
        language: "en"
      }
    }
  }
}

You can’t go wrong if you cater for all the entities described in the spec :slight_smile:

In terms of the Sydney Trains feed, I’ve seen:

  • agency_id and route_id
  • agency_id and trip (i.e. a trip entity with trip_id), and
  • agency_id and stop_id.

#3

Hi,
in the example you’ve given I presume the … is to indicate not having to paste all the routes inbetween so you’re suggesting that there is an overlap between the two sets of routes, one for Delays and another for Special Events.
The GTFS-R spec suggests agency_id, route_id, route_type, trip and Trip_id for messageEntitySelector in the messageAlert. Not sure I know what route type covers but we’re covering agency_id, route_id, trip and Trip_id so I think that’s all covered.

Really useful to know that there can be multiple alerts for the same entity - and we’ll therefore have to design around it.

cheers, Andy


#4

That’s right, truncated for brevity. The full alert feed if you’re interested: alerts_1551338287.txt.zip (2.7 KB)

Whilst this isn’t implemented in the Sydney Trains feed, imagine an agency who wants to issue an alert for a particular mode of transport (say ferries), they could use:

informed_entity {
    agency_id: "SomeAgency"
    route_type: 4
}