Project Description/ Pseudo-code Status of linked lakes to wikidata in Sweden(Part 2)
Posted by HuggeK on 26 December 2025 in English.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:
- 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).