OpenStreetMap

For the curious, the crowdsourced open knowledge database - Wikidata has a property for OpenStreetMap tags that can be used to tag items that describe the same/similar object on the Wikidata database.

It took some time to understand how Wikidata items are described having been used to the more flat OSM tagging model, but we can use a simple example of the popular OSM tag of that is used for any human settlement as a start.

Finding a Wikidata item describing an OSM tag

Any notable topic that exists on Wikipedia will exist as a Wikidata item. Hence any widely used OSM tag should be easy to match to a Wikidata item. For example, cities are one of the most important features of maps, and from the OSM Wiki we know that this feature is described on the map using the Tag:place=city.

If we can find a Wikipedia page that describes the same concept as the OSM tag, we can get the associated Wikidata item from the sidebar links of the page. The Wikidata item for a city is Q515.

Improving Wikidata using OpenStreetMap tags

We can associate the city item Q515 on Wikidata to the OSM tag place=city by adding it as a new property to the item.

new3 Add Tag:place=city as a new OpenStreetMap tag or key property to the item

This will create a link on the Q515 item to the OSM Wiki Tag:place=city page.

Querying Wikidata using OpenStreetMap tags

By adding OSM tags to Wikidata, it is now possible to query Wikidata for all items that are linked to this property.

The query runs live on the Wikidata database using a language called SPARQL, similar to OverpassQL for OpenStreetMap.

Note The above queries only list items that are a direct instance of (P31) a city or town item in Wikidata. Unlike OSM, these items in Wikidata can have a fairly large structure of children items that more specifically describe a type of city. In the future I’m looking to further explore how we can use OSM and WIkidata together for data validation across both projects.

Update The total number of Wikidata items with an OSM tag is currently 964 items - Thanks to Ainali on #wikidata for the query

Discussion

Comment from tyr_asd on 23 February 2017 at 14:20

You can also see which OSM tags are already linked from wikidata on the following (daily updated) list on taginfo: https://taginfo.openstreetmap.org/projects/wikidata_org#tags. Strangely, it only reports 872 items.

Comment from Alex-7 on 24 February 2017 at 11:43

It is very interesting. I did not know it. Thank you! From now on I will add OSM tag to Wikidata items where applicable.

Log in to leave a comment