-
Notifications
You must be signed in to change notification settings - Fork 857
Adding Wikidata Tags
⚠️ April 2022 Update
The use of*:wikipedia
tag has been discontinued (issue #6481)
Contributing the *:wikidata
tag is a very useful task that anybody can help with. It involves a little bit of Internet research.
You can use the online file editor on GitHub to edit the category files under /data/*
and send a Pull Request with your changes.
-
Find an entry in a file that is missing these tags:
In
data/brands/amenity/fast_food.json
:{ "displayName": "Chipotle", "id": "chipotle-658eea", "locationSet": { "include": ["us"] } "matchNames": ["chipotle mexican grill"], "tags": { "amenity": "fast_food", "brand": "Chipotle", "cuisine": "mexican", "name": "Chipotle" } },
-
Google for that brand - if you are lucky, you might find a Wikipedia page right away.
-
On the brand's Wikipedia page, you can also find its "Wikidata item" link. This appears under the "tools" menu in the sidebar.
👉 Tip: @maxerickson has created a user script to make copying these values even easier - see #1881
-
On the brand's Wikidata page, you can identify the
brand:wikidata
value. It is a code starting with 'Q' and several numbers. -
Update the brand file, in this case
brands/amenity/fast_food.json
:We can add the
"brand:wikidata"
tags.{ "displayName": "Chipotle", "id": "chipotle-658eea", "locationSet": { "include": ["us"] } "matchNames": ["chipotle mexican grill"], "tags": { "amenity": "fast_food", "brand": "Chipotle", "brand:wikidata": "Q465751", // added "cuisine": "mexican", "name": "Chipotle" } },
(comments added for clarity)
-
(optional) Rebuild and submit a pull request.
- Run
npm run build
- If it does not fail with an error, you can submit a pull request with your changes (warnings are OK).
If you don't have a local copy of the project for development, just send the pull request anyway. GitHub will test your changes, and a maintainer will run
npm run build
later. - Run
This example uses a brand "かっぱ寿司". I don't know what that is, so I will do some research.
-
Find an entry in a brand file that is missing these tags:
In
data/brands/amenity/fast_food.json
:{ "displayName": "かっぱ寿司", "id": "e7198e-3e7699", "locationSet": {"include": ["jp"]}, "tags": { "amenity": "fast_food", "brand": "かっぱ寿司", "name": "かっぱ寿司" } },
-
Google for that brand - if you are lucky, you might find the Wikipedia page right away.
👉 Tip: You might want to narrow you search by Googling with asite:
filter:"かっぱ寿司 site:ja.wikipedia.org"
From these results, we can know that the brand is "Kappa Sushi", owned by a Japanese company called "Kappa Create". We can also find the Wikipedia page.
-
As with English brands, you can identify the brand's wikipedia value from the URL. Because this is a Japanese brand, we will link to the Japanese Wikipedia page.
Although I can not read Japanese, I can identify the "Wikidata item" link because it always appears in the sidebar and mouseover will show the Wikidata 'Q' code in the URL.
-
On the brand's Wikidata page, you can identify the
brand:wikidata
value. It is a code starting with 'Q' and several numbers.Note: The Wikidata page looks a bit sparse - you can edit this too if you want to help!
-
Update the brand file, in this case
brands/amenity/fast_food.json
:We can add:
-
"brand:en"
and"name:en"
tags to contain the English name "Kappa Sushi" -
"name:ja"
and"brand:ja"
tags to contain the local name "かっぱ寿司" -
"brand:wikidata"
tag -
"cuisine": "sushi"
OpenStreetMap tag - Also check the
"locationSet"
property to make sure it is accurate.
It may seem redundant to add both
"name": "かっぱ寿司"
and also"name:ja": "かっぱ寿司"
tags. We follow this convention because some validator software will complain if there is aname
tag and no matching language tag, such asname:ja
. See also issue #2245
👉 Important: When an item has anyname:xx
language tags, make sure there exists aname:xx
tag that matches thename
tag. See https://wiki.openstreetmap.org/wiki/Multilingual_names#Repeating_name_with_language_specific_tag
{ "displayName": "かっぱ寿司", "id": "kappasushi-3e7699", "locationSet": {"include": ["jp"]}, "tags": { "amenity": "fast_food", "brand": "かっぱ寿司", "brand:en": "Kappa Sushi", // added "brand:ja": "かっぱ寿司", // added "brand:wikidata": "Q11263916", // added "cuisine": "sushi", // added "name": "かっぱ寿司", "name:en": "Kappa Sushi", // added "name:ja": "かっぱ寿司" // added } },
(comments added for clarity)
-
-
(optional) Rebuild and submit a pull request.
- Run
npm run build
- If it does not fail with an error, you can submit a pull request with your changes (warnings are OK).
If you don't have a local copy of the project for developement, just send the pull request anyway. GitHub will test your changes, and a maintainer will run
npm run build
later. - Run
If it exists, we want to know about it!
Some brands haven't been mapped enough on OpenStreetMap (50+ times) to be automatically added to the index. If it is a notable brand, you can add it manually to establish a preferred tagging.
-
Before adding a new brand, the minimum information you should know is the correct tagging required for instances of the brand (
name
,brand
and what it is - e.g.amenity=fast_food
). Ideally you also havebrand:wikidata
andbrand:wikipedia
tags for the brand and any other appropriate tags - e.g.cuisine
. -
Add your new entry anywhere into the appropriate file under
data/**/*
(the files will be sorted alphabetically later) and using the"tags"
key add all appropriate OSM tags. Refer to Category Files if you're not familiar with the syntax. -
If the brand only has locations in a known set of countries add them to the
"locationSet"
property. This takes an array of ISO 3166-1 alpha-2 country codes in lowercase (e.g.["de", "at", "nl"]
). -
If instances of this brand are commonly mistagged add the
"matchNames": []
key to list these. Again, refer to Category Files for syntax. -
(optional) Run
npm run build
If you don't have a local copy of the project for developement, just send the pull request anyway. GitHub will test your changes, and a maintainer will run
npm run build
later.
Contributing to the index
- Feature Files (geofences)
- Using Overpass Turbo
- Config Files
- Property Reference
Information for developers using the name-suggestion-index in another project.
Information for maintainers, including how to clone and build the project.