Hi,
for the OSM-Validatior of the "Open Diplomatic Map" [1] I would
like to a get a list of all ISO 3166-2 Codes (P300) in a "table".
In SQL I would do:
SELECT p.value, q.label.en, q.id FROM Q q, P p WHERE p='P300' AND p in q
That should result in:
[{'code':'GB-ENG', 'label-en':'England',
'wikidataId':'Q21'},
{'code':'GB-SCT', 'label-en':'Scotland',
'wikidataId':'Q22'},
...
]
How do I get the data best. I saw that there is an API-call:
https://www.wikidata.org/w/api.php?action=query&titles=Property:P300&am…
After this I have to call for each result:
https://www.wikidata.org/w/api.php?action=wbgetentities&props=labels&am…
I hope there is a better way to do this?
Best Regards
Sven
1:
https://anders.hamburg/osm/diplomatic/