query-6f139b2b7544a9c9cb5bba01469c2916

rq turtle/ttl

England & Wales council websitesShow type of council and dissolution date if any

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 ?item ?itemLabel ?website ?P31Label ?dissolved WHERE {
  VALUES ?P31 {
    wd:Q21561306
    wd:Q110418000
    wd:Q110417190
    wd:Q21561350
    wd:Q3154693
    wd:Q21561328
    wd:Q19414242
    wd:Q16690653
    wd:Q110416322
    wd:Q21451686
  }
  ?item p:P31 ?stat.
  ?stat ps:P31 ?P31.
  FILTER(NOT EXISTS { ?stat pq:P582 _:b3. })
  ?item wdt:P17 wd:Q145.
  OPTIONAL { ?item wdt:P856 ?website. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  OPTIONAL { ?item wdt:P576 ?dissolved. }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?P31") v5("?dissolved"):::projected v3("?item"):::projected v1("?stat") v4("?website"):::projected a1((" ")) c8(["bd:serviceParam"]):::iri c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal c5(["wd:Q145"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"p:qualifier/P582"--> e0a1 e0v1("?stat"):::projected e0a1((" ")):::projected end f0--EXISTS--> f0e0 f0 --> v1 f0 --> c1 f0 --> a1 v1 --"p:qualifier/P582"--> a1 bind1[/VALUES ?P31/] bind1-->v2 bind10(["wd:Q21561306"]) bind10 --> bind1 bind11(["wd:Q110418000"]) bind11 --> bind1 bind12(["wd:Q110417190"]) bind12 --> bind1 bind13(["wd:Q21561350"]) bind13 --> bind1 bind14(["wd:Q3154693"]) bind14 --> bind1 bind15(["wd:Q21561328"]) bind15 --> bind1 bind16(["wd:Q19414242"]) bind16 --> bind1 bind17(["wd:Q16690653"]) bind17 --> bind1 bind18(["wd:Q110416322"]) bind18 --> bind1 bind19(["wd:Q21451686"]) bind19 --> bind1 v3 --"p:P31"--> v1 v1 --"p:statement/P31"--> v2 v3 --"p:direct/P17"--> c5 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:direct/P856".-> v4 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:direct/P576".-> v5 end