query-90c294a9ff6eb459cf73a7050b878ede

rq turtle/ttl

Items in the UK with more than one wdt:P131

SELECT DISTINCT ?item ?itemLabel ?adm1 ?adm1Label ?adm2 ?adm2Label WHERE { ?item wdt:P31/wdt:P279* wd:Q171634; wdt:P17 wd:Q145; wdt:P131 ?adm1; wdt:P131 ?adm2 . ?adm1 wdt:P131+ ?adm2 . SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ?itemLabel

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Items in the UK with more than one wdt:P131

SELECT DISTINCT ?item ?itemLabel ?adm1 ?adm1Label ?adm2 ?adm2Label WHERE {
  ?item wdt:P31/wdt:P279* wd:Q171634;
        wdt:P17 wd:Q145;
        wdt:P131 ?adm1;
        wdt:P131 ?adm2 .
  ?adm1 wdt:P131+ ?adm2 .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
}
ORDER BY ?itemLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?adm1"):::projected v4("?adm2"):::projected v2("?item"):::projected v1("?itemLabel"):::projected a1((" ")) c8(["bd:serviceParam"]):::iri c10(["en"]):::literal c3(["wd:Q171634"]):::iri c5(["wd:Q145"]):::iri v2 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c3 v2 --"wdt:P17"--> c5 v2 --"wdt:P131"--> v3 v2 --"wdt:P131"--> v4 v3 --"wdt:P131"--> v4 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end