query-fadb30dbb839d42ae372ef510ddbe7f1

rq turtle/ttl

Select property in resultHi, Thanks to @Tagishsimon I can retrieve the list of actual department in France.

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?department ?departmentLabel WHERE { 
    ?department p:P31 ?stat. 
    ?stat ps:P31 wd:Q6465 .
     OPTIONAL {
       ?stat pq:P582|pq:P576 ?ended.
     }     
     FILTER(!BOUND(?ended)).  
     SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,en" }
  }

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?department"):::projected v1("?ended") v3("?stat") c7(["bd:serviceParam"]):::iri c9(["fr,en"]):::literal c3(["wd:Q6465"]):::iri f0[["not bound(?ended)"]] f0 --> v1 v2 --"p:P31"--> v3 v3 --"p:statement/P31"--> c3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v3 -."p:qualifier/P576".-> v1 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v3 --"p:qualifier/P582"--> v1 end union0r <== or ==> union0l end end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end