RID: Difference between revisions

From Open Rail Data Wiki
Add a description of RIDs
 
EvelynSnow (talk | contribs)
A lot of rewording, reference to XSD, slightly more exact about train vs service, correct final example (P63461 on 2024-11-20 would be 202411208063461, not 201411208063461)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
RID stands for <em>RTTI Identity</em>, and RTTI stands for <em>Real-Time Train Information</em>, the original name of the system now called Darwin.
A '''RID''' is Darwin's globally unique identifier for a service. RIDs are currently expressed as a string of 15 numeric characters (e.g. ''202301147621947''), but no guarantees are provided about the specific format of RIDs, except the 16 character maximum length described in the relevant XSDs<ref>https://lite.realtime.nationalrail.co.uk/OpenLDBSVWS/rtti_2007-10-10_ldb_common_types.xsd – ''RIDType''</ref>. As with the 10-character TRUST train identifier, developers are strongly advised not to rely on RIDs being calculated by any specific method.


A RID is Darwin's globally unique numeric identifier for a train.  It cannot be guaranteed to be in a specific format other than a set of numbers as described in the relevant XSD.  As with the 10-character TRUST train identifier, developers are strongly advised not to rely on it being calculated via a specific method.
= Name =
''RID'' stands for ''RTTI Identity'', with ''RTTI'' itself expanding to ''Real-Time Train Information'', the original name of the system now called Darwin.


= Algorithm =
= Algorithm =


The RID comprises of the date the train is scheduled to depart its origin, e.g. 20230115.
Before 2015, a RID was formed from the date a service was scheduled to depart its origin (e.g. 20141120 for a SSD of 2014-11-20), prepended to a padded incrementing sequence number based on an internal counter within Darwin, resetting every time a new timetable was loaded (e.g. 201411200059826). At some time after 2014, the counter portion of the RID was replaced with a more predictable element, possibly to speed up Darwin by avoiding the reliance on a single counter to generate RIDs.


The next digits were originally an incrementing sequence number based on an internal counter within Darwin, resetting each time a new timetable was loaded - for example 201411200059826. This was changed some time after 2014, possibly to speed up Darwin by not relying on a single counter to generate RIDs.
As of October 2023, the non-date part of of the RID is calculated by taking the [https://en.wikipedia.org/wiki/ASCII#Printable_characters ASCII value] of the letter contained in the schedule UID and appending the digits. For example, the RID for schedule P63461 starting on 2024-11-20 would be 202411208063461. The ASCII value of 'P' in decimal is 80, and the digits are 63461.


As of Octtober 2023, the non-date part of of the RID is calculated by taking the [https://en.wikipedia.org/wiki/ASCII#Printable_characters ASCII value] of the letter contained in the schedule UID and appending the digits.  For example, the RID for schedule P63461 starting on 2024-11-20 would be 201411208063461.  The ASCII value of 'P' in decimal is 80, and the digits are 63461.
=References=
 
<references />
 
[[Category:National Rail Enquiries Data Feeds]]

Latest revision as of 19:16, 28 October 2023

A RID is Darwin's globally unique identifier for a service. RIDs are currently expressed as a string of 15 numeric characters (e.g. 202301147621947), but no guarantees are provided about the specific format of RIDs, except the 16 character maximum length described in the relevant XSDs[1]. As with the 10-character TRUST train identifier, developers are strongly advised not to rely on RIDs being calculated by any specific method.

Name

RID stands for RTTI Identity, with RTTI itself expanding to Real-Time Train Information, the original name of the system now called Darwin.

Algorithm

Before 2015, a RID was formed from the date a service was scheduled to depart its origin (e.g. 20141120 for a SSD of 2014-11-20), prepended to a padded incrementing sequence number based on an internal counter within Darwin, resetting every time a new timetable was loaded (e.g. 201411200059826). At some time after 2014, the counter portion of the RID was replaced with a more predictable element, possibly to speed up Darwin by avoiding the reliance on a single counter to generate RIDs.

As of October 2023, the non-date part of of the RID is calculated by taking the ASCII value of the letter contained in the schedule UID and appending the digits. For example, the RID for schedule P63461 starting on 2024-11-20 would be 202411208063461. The ASCII value of 'P' in decimal is 80, and the digits are 63461.

References