query-c85cfa287c220f31f3ca9af0b185c9b4

rq turtle/ttl

Art venues in the UK, but not pubs

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Map{"hide":["?coord"]}
SELECT DISTINCT ?item ?itemLabel ?url ?coord WHERE {
  VALUES ?type {wd:Q15090615 wd:Q7062022} # Arts venues + not-for-profit arts organisations
  ?item (wdt:P31/wdt:P279*) ?type. 
  ?item wdt:P17 wd:Q145. # in the UK
  MINUS {?item wdt:P31 wd:Q212198} # Exclude pubs
  OPTIONAL{?item wdt:P625 ?itemcoord}
  OPTIONAL {?item wdt:P131/wdt:P625 ?wherecoord}
  OPTIONAL {?item wdt:P856 ?url}
  BIND(IF(BOUND(?itemcoord), ?itemcoord, ?wherecoord) AS ?coord)
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en".
  }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?coord"):::projected v2("?item"):::projected v3("?itemcoord") v1("?type") v5("?url"):::projected v4("?wherecoord") a1((" ")) a2((" ")) c10(["bd:serviceParam"]):::iri c5(["wd:Q212198"]):::iri c4(["wd:Q145"]):::iri c12(["#91;AUTO_LANGUAGE#93;,mul,en"]):::literal bind0[/VALUES ?type/] bind0-->v1 bind00(["wd:Q15090615"]) bind00 --> bind0 bind01(["wd:Q7062022"]) bind01 --> bind0 v2 --"wdt:P31"--> a1 a1 --"wdt:P279"--> v1 v2 --"wdt:P17"--> c4 subgraph minus1["MINUS"] style minus1 stroke-width:6px,fill:pink,stroke:red; v2 --"wdt:P31"--> c5 end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P625".-> v3 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P131".-> a2 a2 --"wdt:P625"--> v4 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P856".-> v5 end bind2[/"if(bound(?itemcoord),?itemcoord,?wherecoord)"/] v3 --o bind2 v4 --o bind2 bind2 --as--o v6 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 end