query-2d482a755ad4dfc83b54a2ed862e187a

rq turtle/ttl

SPARQL query

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT ?item ?source ?name
WHERE 
{
  ?item p:P39 ?statement .
  ?statement ps:P39/wdt:P279* wd:Q15705021 ; pq:P580 ?start .
  OPTIONAL { ?statement pq:P582 ?end }
  OPTIONAL {
    ?item p:P973 ?describedAtOfficial .
    ?describedAtOfficial ps:P973 ?source .
    FILTER(CONTAINS(LCASE(STR(?url)), "www.lachambre.be/"))
  }
  FILTER(!BOUND(?end) || ?end > NOW())

  ?item rdfs:label ?name
  FILTER(LANG(?name) = "en")

}
ORDER BY ?start ?end

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?describedAtOfficial") v2("?end") v5("?item"):::projected v3("?name"):::projected v8("?source"):::projected v1("?start") v6("?statement") v4("?url") a1((" ")) c6(["wd:Q15705021"]):::iri f0[["?name = 'en'"]] f0 --> v3 f1[["(not bound(?end) || ?end > NOW())"]] f1 --> v2 v5 --"p:P39"--> v6 v6 --"p:statement/P39"--> a1 a1 --"p:direct/P279"--> c6 v6 --"p:qualifier/P580"--> v1 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v6 -."p:qualifier/P582".-> v2 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v5 -."p:P973".-> v7 v7 --"p:statement/P973"--> v8 end v5 --"rdfs:label"--> v3