query-408b28e17d3ad46da3bdf35f31166ed3

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
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 ?code_Insee_d_un_d_partementLabel 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". }
    OPTIONAL { ?department wdt:P2586 ?code_Insee_d_un_d_partement. }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?code_Insee_d_un_d_partement") 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 subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:direct/P2586".-> v4 end