query-1b7ef6ca5580c9bb2c7aac969a393bfa

rq turtle/ttl

27 member states of the European Union

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX v: <http://www.wikidata.org/prop/statement/>
SELECT ?state ?stateLabel ?capitalLabel ?start WHERE {
  ?state p:P463 ?memberBlock . 
  ?memberBlock v:P463 wd:Q458 .
  ?memberBlock pq:P580 ?start .
  #?memberBlock pq:P582 ?end .
  FILTER NOT EXISTS {?memberBlock pq:P582 ?end} .
  ?state wdt:P36 ?capital
  SERVICE wikibase:label{bd:serviceParam wikibase:language "en"}
}
ORDER BY ?start ?stateLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?capital") v4("?end") v3("?memberBlock") v1("?start"):::projected v5("?state"):::projected v2("?stateLabel"):::projected c8(["bd:serviceParam"]):::iri c4(["wd:Q458"]):::iri c10(["en"]):::literal f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"p:qualifier/P582"--> e0v2 e0v2("?end"):::projected e0v1("?memberBlock"):::projected end f0--EXISTS--> f0e0 f0 --> v3 f0 --> c1 f0 --> v4 v3 --"p:qualifier/P582"--> v4 v5 --"p:P463"--> v3 v3 --"p:statement/P463"--> c4 v3 --"p:qualifier/P580"--> v1 v5 --"p:direct/P36"--> v6 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end