Have build_wikidata.js script fetch *:wikipedia tags
See original GitHub issueI get it - people don’t want to add brand:wikipedia
/ operator:wikipedia
etc tags because they are redundant #4672
We are adding them anyway because many people expect the OSM tags to be mostly human-readable, and Wikidata tags are not human-readable. But I can’t just leave Pull Requests sitting unmerged because people don’t want to supply this tag. 😓
So I’m thinking of just having the build_wikidata
script look up missing Wikipedia tags for us. This approach also has the benefit of catching Wikipedia pages that have been added after the Wikidata pages.
My plan is to write some extremely dumb code to just choose a reasonable Wikipedia tag. I’m not going to write code to try to guess which Wikipedia page is the best one based on what languages are spoken in what countries and for what items - this is too hard.
It will not be as good as having a human pick a value, but at least then I won’t have to hold up the project for unmerged Pull Requests.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:6 (3 by maintainers)
Ok I built this… 🎉 I did a dryrun just now (script does no updates) and it seems to work pretty well.
The actual number of missing wikipedia tags that it catches is pretty small, so I feel confident that I can just look them over when I run the script and adjust anything that looks really wrong. I think I prefer this approach over adding notes that will probably never get removed.
For what it’s worth, each time the
build_wikidata
is run, it finds a lot of stuff that needs attention and I think it would be nice to put these results somewhere for people to see it.Most of the warnings are about brands’ Facebook or Twitter accounts being suspended, so really anybody could go to the Wikidata pages and remove or fix these.
I pasted the output of this script into a gist: https://gist.github.com/bhousel/de4fddf31dbef99daa6e700f2f4264bb I’m kind of amazed that the “just lookup
*:wikipedia
tags” code worked as well as it did 😆Yes, the numbers would update.
build_wikidata.js
updatesdist/wikidata.json
. Then nsi.guide react code calculates those numbers based on whatever it finds indist/wikidata.json
Maybe, but we’d have to change some things somehow. Currently if the item doesn’t have a facebook/twitter anymore, those things just don’t get put into
dist/wikidata.json
.