-
Notifications
You must be signed in to change notification settings - Fork 8
discuss & define data format #1
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
Changes from 2 commits
a7a35f6
1750c04
33b79fa
1a915c1
09d4938
9522945
b0c90bd
fbfff85
43a0b81
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| { | ||
| "name": "Deutsche Bahn (DB)", | ||
| "type": "hafas_mgate_deutschebahn", | ||
| "supportedLanguages": [ | ||
| "en", | ||
| "de", | ||
| "fr", | ||
| "es" | ||
| ], | ||
| "options": { | ||
| "auth": { | ||
| "aid": "n91dB8Z77MLdoR0K" | ||
| }, | ||
| "checksumSalt": "6264493855566A34304B356676787766", | ||
| "client": { | ||
| "id": "DB", | ||
| "name": "DB Navigator", | ||
| "type": "AND", | ||
| "v": 19040000 | ||
| }, | ||
| "endpoint": "https://reiseauskunft.bahn.de/bin/mgate.exe", | ||
| "ext": "DB.R19.12.a", | ||
| "lineModeMap": { | ||
| "1": "Long-distance train (ICE)", | ||
| "128": "Metro", | ||
| "16": "Rapid Transit (S)", | ||
| "2": "Long-Distance Train (IC/EC)", | ||
| "256": "Tram", | ||
| "32": "Bus", | ||
| "4": "Local Train (D)", | ||
| "512": "Taxi", | ||
| "64": "Ferry", | ||
| "8": "Local Train (RE/RB)" | ||
| }, | ||
| "locationIdentifierType": "db", | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the idea behind this? @vkrause That the IDs returned by the endpoint are DB-style IBNRs?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. KPublictTransport has multiple id "namespaces" per location. This can be endpoint-specific ones that have no meaning outside (the default), proprietary ones that are shared between two or more endpoints (BVG/VBB are such an example), or standard ones (IBNR, UIC, IFOPT, etc). This is useful for merging data from different sources (different backends, OSM, Wikidata, etc). To support this we have the following settings:
This is obviously very specific to what KPublicTransport does, not particularly elegant or generic, and for most existing users probably irrelevant. I could imagine something like this to be relevant for your merging work though?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, highly relevant for my merging work! In fact, there are several projects (in the European community) that try to cross-reference public transport "things" in some way. |
||
| "standardLocationIdentifierCountries": [ | ||
| 51, | ||
| 53, | ||
| 54, | ||
| 55, | ||
| 56, | ||
| 70, | ||
| 71, | ||
| 74, | ||
| 76, | ||
| 80, | ||
| 81, | ||
| 82, | ||
| 83, | ||
| 84, | ||
| 85, | ||
| 86, | ||
| 87, | ||
| 88 | ||
| ], | ||
| "standardLocationIdentifierType": "ibnr", | ||
| "version": "1.18" | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| { | ||
| "name": "Deutsche Bahn (DB)", | ||
| "type": "hafas_query", | ||
| "supportedLanguages": [ | ||
| "en", | ||
| "de", | ||
| "fr", | ||
| "es" | ||
| ], | ||
| "options": { | ||
| "endpoint": "https://reiseauskunft.bahn.de/bin/trainsearch.exe/", | ||
| "lineModeMap": { | ||
| "1": "Long-distance train (ICE)", | ||
| "128": "Metro", | ||
| "16": "Rapid Transit (S)", | ||
| "2": "Long-Distance Train (IC/EC)", | ||
| "256": "Tram", | ||
| "32": "Bus", | ||
| "4": "Local Train (D)", | ||
| "512": "Taxi", | ||
| "64": "Ferry", | ||
| "8": "Local Train (RE/RB)" | ||
| }, | ||
| "locationIdentifierType": "db", | ||
| "standardLocationIdentifierCountries": [ | ||
| 51, | ||
| 53, | ||
| 54, | ||
| 55, | ||
| 56, | ||
| 70, | ||
| 71, | ||
| 74, | ||
| 76, | ||
| 80, | ||
| 81, | ||
| 82, | ||
| 83, | ||
| 84, | ||
| 85, | ||
| 86, | ||
| 87, | ||
| 88 | ||
| ], | ||
| "standardLocationIdentifierType": "ibnr" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "name": "Verkehrsverbund Rhein-Ruhr (VRR)", | ||
| "type": "efa", | ||
| "supportedLanguages": [ | ||
| "en", | ||
| "de" | ||
| ], | ||
| "options": { | ||
| "endpoint": "https://efa.vrr.de/standard/" | ||
| } | ||
| } |
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.
As I said before, I don't think an "enum of types of APIs" will scale. I'd rather prefer something like
"hafasMgate": true, because it can be combined with other flags describing the endpoint.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.
ah, I see what you meant there now. That would work for us too. Making
typean array could be an alternative?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.
Fair enough. I prefer boolean flags (e.g.
"hafasMgate": true) over a"type":["hafas_mgate", ...]array – checking whether a dict key exists is more straightforward than iterating over an array.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 don't care if its several boolean flags, or an array of flags. Both are a lot more future-proof than a single type enum.