query-90479c8cd9b43533709d00c60934270e

rq turtle/ttl

Adding a fixed administrative level in a located in the administrative territorial entity (P131) tree to which the commune belongs to but I don't know how. Could you help me please? Thanks. (Q6465)department of France ). I'd like to add the (Q142)France in (P131)located in the administrative territorial entity (the lowest (Q484170)commune of France with their (Q12130)Brittany The following query gives me all the churches in

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 DISTINCT ?item ?itemLabel ?commune ?communeLabel
WHERE {

  ?item wdt:P131+ wd:Q12130.
  ?item (wdt:P31/wdt:P279*) wd:Q16970.
  ?item wdt:P131 ?commune.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "fr". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?commune"):::projected v1("?item"):::projected a1((" ")) c7(["bd:serviceParam"]):::iri c2(["wd:Q12130"]):::iri c5(["wd:Q16970"]):::iri c9(["fr"]):::literal v1 --"wdt:P131"--> c2 v1 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c5 v1 --"wdt:P131"--> v2 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end