query-4c010ae01741a58bcf3674f0cc398c84

rq turtle/ttl

Multi-level localisation 15:12, 28 May 2019 (UTC) B Yanik name of an entity. --(Q55998242)administrative region of Quebec name and the (Q204613)regional county municipality . What would be the query to list the municipality name, the (Q764294)Centre-du-Québec who has P131 (Q1261297)Drummond have P131 (Q141940)Drummondville may be a lower level entity, how can we show upper level entities ? For example, (P131)located in the administrative territorial entity Since

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#>
SELECT ?item ?itemLabel ?county ?countyLabel ?region ?regionLabel WHERE {
  VALUES ?item { wd:Q141940 }
  ?region wdt:P31 wd:Q55998242 .
  ?county wdt:P31 wd:Q204613.
  ?county wdt:P131* ?region .
  ?item wdt:P131* ?county.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?county"):::projected v1("?item"):::projected v2("?region"):::projected c6(["bd:serviceParam"]):::iri c8(["en"]):::literal c2(["wd:Q55998242"]):::iri c3(["wd:Q204613"]):::iri bind0[/VALUES ?item/] bind0-->v1 bind00(["wd:Q141940"]) bind00 --> bind0 v2 --"wdt:P31"--> c2 v3 --"wdt:P31"--> c3 v3 --"wdt:P131"--> v2 v1 --"wdt:P131"--> v3 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c8 end