Wikidata:Property proposal/Check Digit
Check Digit edit
Originally proposed at Wikidata:Property proposal/Generic
Represents | check digit (Q1337960) |
---|---|
Data type | String |
Allowed values | [0-9] |
Allowed units | numbers |
Example 1 | Oss railway station (Q801301) → https://m.ter.sncf.com/occitanie/se-deplacer/gares/oss-84844950 |
Example 2 | Luxembourg railway station (Q801140) → https://www.ter.sncf.com/grand-est/se-deplacer/gares/luxembourg-82001000 |
Example 3 | Stockholm Central Station (Q54315) → https://m.ter.sncf.com/occitanie/se-deplacer/gares/stockholms-central-74037510 |
Planned use | For documenting (incorrect) UIC station code (P722) 8 numbers |
Number of IDs in source | +10000 |
Expected completeness | eventually complete (Q21873974) (eventually complete) |
Formatter URL | https://m.ter.sncf.com/occitanie/se-deplacer/gares/(value of P722)$1 (Not sure if can combine multiple values 😅) |
See also | Earlier discussions on the https://www.wikidata.org/wiki/Property_talk:P722 page |
Single-value constraint | yes |
Motivation edit
UIC station codes (UIC station code (P722)) normally exist out of 7 numbers, the first 2 are the country code, the last 5 are location specific. As far as my knowledge the Société nationale des chemins de fer français (Q13646) system is the only system that uses an eight number, a luhn check digit calculated with the 5 numbers.
Unfortunately I noticed a couple of cases where the check digit inside the SNCF system is incorrect with the expected value, it would be neat if I could document those inconsistencies.
E.g. take this station in the SNCF system https://www.ter.sncf.com/grand-est/se-deplacer/gares/luxembourg-82001000
The UIC code is: 8200100 The (luhn) check digit should be: 8 (2*0+0+2*1+0+2*0=2 -> 10-2=8) But, as seen in the last digit of the url, the SNCF system uses a 0 instead.
This inconsistencies also exist for:
- Oss, 84-84495(1), https://m.ter.sncf.com/occitanie/se-deplacer/gares/oss-84844950
- Stockholm Central, 74-03751(5), https://m.ter.sncf.com/occitanie/se-deplacer/gares/stockholms-central-74037510
- Rodange, 82-00237(8), https://m.ter.sncf.com/occitanie/se-deplacer/gares/rodange-82002370
- Norrköping Central, 74-02930(6), https://www.ter.sncf.com/occitanie/se-deplacer/gares/norrkopings-central-74029300
As such I would like to document these values as:
UIC station code (P722) with qualifier "check digit" x
(I can imagine this property could be used as qualifier of more properties, I am just not aware for which properties it would be useful for...)
– The preceding unsigned comment was added by LisaOmbos (talk • contribs).
Discussion edit
- Comment "check digit" is too general. If the property is for SNCF-specific info it should certainly have "SCNF" in its label. So we could have Luxembourg railway station (Q801140)UIC station code (P722)8200100
SNCF check digit0. However formatter URL (P1630) indeed cannot take qualifier values into account, so I think it would be better to just have a regular property instead, e.g. Luxembourg railway station (Q801140)SNCF station code82001000. With the label "SNCF station code" that property would however end up getting used even in cases where the SNCF code is correct and could be derived from the UIC station code. We probably want to avoid duplication on such a large scale, so perhaps the new property should be called "irregular SNCF station code" to clarify that it shouldn't be added to every station. --Push-f (talk) 06:53, 5 November 2022 (UTC) - Comment Stockholm Central Station (Q54315) has a completely different UIC station code (7400001) vs the 74037510 SNCF code of your third example. Do you know what's up with that? --Push-f (talk) 06:53, 5 November 2022 (UTC)
- That item is now updated, see last conversation at https://www.wikidata.org/wiki/Property_talk:P722 for explanation why previous value was incorrect. (The original value was likely derived from trafiklab). LisaOmbos (talk) 11:49, 7 November 2022 (UTC)
- Currently, the example of this property don't have the required data type of string but are URLs. ChristianKl ❪✉❫ 12:16, 26 November 2022 (UTC)
- Oppose Seems to me checksum (P4092) can be used for this purpose. Infrastruktur (talk) 14:31, 26 November 2022 (UTC)
- @LisaOmbos: do you see a reason why checksum (P4092) doesn't do the job? ChristianKl ❪✉❫ 13:03, 1 December 2022 (UTC)
Not done @LisaOmbos, ChristianKl, Infrastruktur, Push-f: sitting idle for months. re apply if you can respond to the given concern. BrokenSegue (talk) 05:19, 29 June 2023 (UTC)