query-189b3fd452e77008c2db2e4467a3ca13

rq turtle/ttl

title: Gewogs of Bhutan (should be 205)

SELECT ?gewog ?gewogLabel WHERE { ?gewog wdt:P31 wd:Q1352019; # Instance of gewog wdt:P17 wd:Q917. # Located in Bhutan

FILTER NOT EXISTS { ?gewog p:P576 ?dissolution. # Exclude those with a dissolution statement }

SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } ORDER BY ?gewogLabel

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#title: Gewogs of Bhutan (should be 205)

SELECT ?gewog ?gewogLabel WHERE {
  ?gewog wdt:P31 wd:Q1352019;    # Instance of gewog
         wdt:P17 wd:Q917.        # Located in Bhutan

  FILTER NOT EXISTS { 
    ?gewog p:P576 ?dissolution.  # Exclude those with a dissolution statement
  }

  SERVICE wikibase:label { 
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". 
  }
}
ORDER BY ?gewogLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?dissolution") v2("?gewog"):::projected v1("?gewogLabel"):::projected c7(["bd:serviceParam"]):::iri c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal c3(["wd:Q1352019"]):::iri c5(["wd:Q917"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"p:P576"--> e0v2 e0v2("?dissolution"):::projected e0v1("?gewog"):::projected end f0--EXISTS--> f0e0 f0 --> v2 f0 --> c1 f0 --> v3 v2 --"p:P576"--> v3 v2 --"p:direct/P31"--> c3 v2 --"p:direct/P17"--> c5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end