Template:Russia district OSM map
How it works
This map template is meant to be used on articles about Russian districts. It relies on a Wikidata query to retrieve and display all elements connected to the page where the template is applied, if they match the following:
- entity has either the property (P31) or (P279) set to :
- and:
- entity has the property (P131) set to the same value as the page on which the template is used.
For more specifics, see a prefilled Wikidata query based on this template.
Usage
<syntaxhighlight lang="wikitext"> <mapframe zoom="3" align="center" frameless="1" height="250" width="270">{ "type": "ExternalData", "service": "geoshape", "properties": { "stroke-width": 1 }, "query": " SELECT ?id (if(?id = wd:, '#C12838', '#07c63e') as ?fill) (if(BOUND(?link), concat('', ?idLabel, ''), ?idLabel) as ?title) WHERE { { ?id p:P31/ps:P31/wdt:P279* wd:Q2198484 . hint:Prior hint:gearing 'forward' } UNION { ?id p:P31/ps:P31/wdt:P279* wd:Q13626398 . hint:Prior hint:gearing 'forward' } UNION { ?id p:P31/ps:P31/wdt:P279* wd:Q4057820 . hint:Prior hint:gearing 'forward' } ?id p:P131 ?locst . ?locst ps:P131/wdt:P131* wd:. hint:Prior hint:gearing 'forward' MINUS { ?locst pq:P582 [] } SERVICE wikibase:label { bd:serviceParam wikibase:language 'en' . ?id rdfs:label ?idLabel . } OPTIONAL {?link schema:about ?id . ?link schema:isPartOf <https://en.wikipedia.org/> . } } GROUP BY ?id ?link ?idLabel "}</mapframe> </syntaxhighlight>
Examples
Perm Krai
<mapframe zoom="5" frameless="1" align="center" height="250" latitude="58.665" longitude="56.17" width="270">{ "type": "ExternalData", "service": "geoshape", "properties": { "stroke-width": 1 }, "query": " SELECT ?id (if(?id = wd:, '#C12838', '#07c63e') as ?fill) (if(BOUND(?link), concat('', ?idLabel, ''), ?idLabel) as ?title) WHERE { { ?id p:P31/ps:P31/wdt:P279* wd:Q2198484 . hint:Prior hint:gearing 'forward' } UNION { ?id p:P31/ps:P31/wdt:P279* wd:Q13626398 . hint:Prior hint:gearing 'forward' } UNION { ?id p:P31/ps:P31/wdt:P279* wd:Q4057820 . hint:Prior hint:gearing 'forward' } ?id p:P131 ?locst . ?locst ps:P131/wdt:P131* wd:Q5400. hint:Prior hint:gearing 'forward' MINUS { ?locst pq:P582 [] } SERVICE wikibase:label { bd:serviceParam wikibase:language 'en' . ?id rdfs:label ?idLabel . } OPTIONAL {?link schema:about ?id . ?link schema:isPartOf <https://en.wikipedia.org/> . } } GROUP BY ?id ?link ?idLabel "}</mapframe>