OpenStreetMap logo OpenStreetMap

HuggeK's Diary

Recent diary entries

In regards that the tool https://wiki.openstreetmap.orgdata.link works best with smaller administerey areas I will break it down on the municipality level(Kommun in Swedish) we have 290 in Sweden.

Goal:

To be served a table which have the following data:

municipality(kommun) Amount of linked lakes Total amount of lakes Precentage
Total amount of municipality(kommun) Total amount of linked lakes Total amount of lakes Total Precentage

Main category of all lakes in Sweden on sv.wikipedia.org:

The catgory I will use to get total amount of lakes in each municipality(kommun)

Kategori:Insjöar i Sverige efter kommun

Approach

I will then query each municipality(kommun) using Sophox in the SPARQL language on each municipality(kommun) (by name). I will then get a list of QID of all the wikidata lakes that I then can use to ask Sophox if any element has that wikidata QID. If anyone has that

Acknowledged drawbacks/limitations of this strategy:

  1. This database query will not detect cases which multiple elements in OSM has the same QID. The tool https://wiki.openstreetmap.orgdata.link will make you aware of this but not i a table which can give you an overview. For that it is best to update the code at that project, see issue #680 I created in it´s repostory.

Where does the data off the lakes come from in wikidata?

They are inported some time the last 10 years from the national database of lakes and bodies of water called VISS Bots created the articles on Swedish wikipedia from this database and this is the reason we now can link the data from OSM to the wikipedia articles through the wikidata QID on the water=lake polygons(enclosed ways/areas and multipolygons).

Why didn´t I just use the Overpass Turbo API?

See full entry

I´m trying to start a project to learn SPARQL to be able to get on how many of the 63 00 lakes which are in swedish wikipedia/wikidata has their wikidata tag on the OSM element. If the OSM element contains the wikidata tag we can show the proper zoomed polygon in the template sidebar on the articles in all their glory, instead of just a coordinate from wikidata. Mall:Insjöfakta Sverige is the template which makes this possible, please share it for other purposes to use the maplinked feature on other WMF Wikipedias than sv.wikipedia.org!

https://en.wikipedia.org/wiki/Wikipedia:Why_mapframe_maps%3F

Part 2