Geocode coordinates to Commons Category
home | visit endpoint | view in OSM | Commons category | Q22 | #
API returns
{
"admin_level": 4,
"commons_cat": {
"title": "Scotland",
"url": "https://commons.wikimedia.org/wiki/Category:Scotland"
},
"coords": {
"lat": 55.5,
"lon": -5.0
},
"wikidata": "Q22"
}
Wikidata item: Q22
Commons category: Scotland
2 surrounding elements found
Searching for Wikimedia Commons categories using this SPARQL query. Wikidata Query service
SELECT DISTINCT ?item ?distance ?itemLabel ?isa ?isaLabel ?commonsCat ?commonsSiteLink WHERE {
{
SELECT DISTINCT ?item ?location ?distance ?isa WHERE {
VALUES ?want { wd:Q486972 wd:Q56061 }
?item wdt:P31/wdt:P279* ?want .
?item wdt:P31 ?isa .
SERVICE wikibase:around {
?item wdt:P625 ?location.
bd:serviceParam wikibase:center "Point(-5.000000 55.500000)"^^geo:wktLiteral;
wikibase:radius 5;
wikibase:distance ?distance.
}
}
}
MINUS { ?item wdt:P582 ?endTime . }
MINUS {
VALUES ?isNot { wd:Q1497375 wd:Q1497364 wd:Q92086 wd:Q31028835 wd:Q160742 wd:Q17485079 wd:Q44613 wd:Q98116669 wd:Q3146899 wd:Q708676 wd:Q18917976 wd:Q2750108 wd:Q6021560 wd:Q39614 wd:Q513550 wd:Q31028695 wd:Q31028314 wd:Q839954 wd:Q744099 wd:Q28045079 wd:Q106626840 }
?item wdt:P31 ?isNot .
}
OPTIONAL { ?item wdt:P373 ?commonsCat. }
OPTIONAL { ?commonsSiteLink schema:about ?item;
schema:isPartOf <https://commons.wikimedia.org/>. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY (?distance)
flag: File:Flag_of_Scotland.svg
name: Alba / Scotland
ref:gss: S92000003
boundary: administrative
wikidata: Q22
ISO3166-2: GB-SCT
wikipedia: en:Scotland
ref:nuts:1: UKM
admin_level: 4
is_in:country_code: GB
flag: https://upload.wikimedia.org/wikipedia/commons/8/83/Flag_of_the_United_Kingdom_%283-5%29.svg
name: United Kingdom
ref:gss: K02000001
boundary: administrative
currency: GBP
int_name: United Kingdom
timezone: Europe/London
wikidata: Q145
ISO3166-1: GB
wikipedia: en:United Kingdom
short_name: UK
admin_level: 2
native_name: United Kingdom of Great Britain and Northern Ireland
driving_side: left
official_name: United Kingdom of Great Britain and Northern Ireland
ISO3166-1:alpha2: GB
ISO3166-1:alpha3: GBR
default_language: en
ISO3166-1:numeric: 826