Repository navigation
Conversation
places.json maps every station to a place of the Offware places dataset (Wikidata, CC0), so an app can show a station's guides and sights. The places themselves stay in that dataset; this API only holds the link. When the dataset can't be read, the timetables still publish without it.
The places repository is now offware-apps/data, with the index at places/index.json; place files keep their places/<id>.json path.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before: the API only knew station names, so an app had no way to show what to see where a train stops.
After: a new
v1/places.jsonmaps every station to its town or city in Offware's shared data repository (https://github.com/offware-apps/data). An app reads a station's place id there and fetches that place's free guide links (Wikivoyage, Wikipedia) and sights from the shared data. The places themselves stay there, built from Wikidata (CC0); this API only holds the link, with the data's licence and attribution copied in.How:
npm run build:placesruns afterbuild:api, readsplaces/index.jsonfrom the shared data and matches each station by name: the place whose name the station name starts with, word for word ("LYON PART DIEU" → Lyon, "ST ETIENNE" → Saint-Étienne). The longest name wins, then a place in the operator's own country, then the largest. Places outside Europe never match. If the shared data can't be read, the file is left out and the timetables still publish. Documented indocs/developers.md,docs/format.mdanddocs/openapi.yaml; CI builds it from a fixture index.The live file appears once the shared data is published at https://offware-apps.github.io/data/v1/.