OpenStreetMap

Wikidata <3

Posted by pangoSE on 8 November 2019 in English (English)

You can help with the integration of OSM and Wikidata by using this tool: https://osm.wikidata.link

A while ago the property OSM relation id was added to Wikidata.

Since then a lot of objects now have an OSM id attached.

This enables us to harnes the power of Wikidata queries and do something with OSM object based on that.

Today I did this search https://query.wikidata.org/sparql?query=%23OSM%20relation%20ids%20of%20Swedish%20counties%0ASELECT%20%3Finstance_of%20%3Finstance_ofLabel%20%3FOSM_relation_ID%20WHERE%20%7B%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%2Cen%22.%20%7D%0A%20%20%0A%20%20OPTIONAL%20%7B%20%20%7D%0A%20%20%3Finstance_of%20wdt%3AP31%20wd%3AQ200547.%0A%20%20OPTIONAL%20%7B%20%3Finstance_of%20wdt%3AP402%20%3FOSM_relation_ID.%20%7D%0A%7D

It outputs the counties of Sweden and their OSM relation id.

I use this to easily get all the ids I need to generate the .poly files I need for my cleanup of water tags project. See https://www.openstreetmap.org/user/pangoSE/diary/391133

List of contries and OSM ids - a few are still missing

Total number of items in wikidata with OSM relation ids are as of this writing 101725 which is about a third of all relations with a wikidata key.

Login to leave a comment