query-2733a826b93b52f8ba92adfa81db6c70

rq turtle/ttl

All hospitals of selected types in Berlin SELECT DISTINCT ?hospital ?hospitalLabel ?coord WHERE { SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],de". } ?hospital (wdt:P31/wdt:P279) ?hospitalType . FILTER (?hospitalType = wd:Q16917 || ?hospitalType = wd:Q1059324 ||
?hospitalType = wd:Q4284971 || ?hospitalType = wd:Q569500 || ?hospitalType = wd:Q64624840 || ?hospitalType = wd:Q46124 || ?hospitalType = wd:Q695416 || ?hospitalType = wd:Q61794666 || ?hospitalType = wd:Q688829 || ?hospitalType = wd:Q210999 || ?hospitalType = wd:Q1391390 || ?hospitalType = wd:Q1774898 || ?hospitalType = wd:Q5166147 || ?hospitalType = wd:Q7315485 || ?hospitalType = wd:Q13171852 || ?hospitalType = wd:Q2424154 || ?hospitalType = wd:Q644264 || ?hospitalType = wd:Q22914759 || ?hospitalType = wd:Q25004734 || ?hospitalType = wd:Q42297537 || ?hospitalType = wd:Q64578911 || ?hospitalType = wd:Q96243215 || ?hospitalType = wd:Q2387974 || ?hospitalType = wd:Q1009272 || ?hospitalType = wd:Q1877467 || ?hospitalType = wd:Q3145296 || ?hospitalType = wd:Q5154967 || ?hospitalType = wd:Q5466630 || ?hospitalType = wd:Q6672116 || ?hospitalType = wd:Q7048982 || ?hospitalType = wd:Q7309759 || ?hospitalType = wd:Q7883677 || ?hospitalType = wd:Q1706476 || ?hospitalType = wd:Q1813474) ?hospital (wdt:P131/wdt:P127/wdt:P137*) wd:Q64 . OPTIONAL { ?hospital wdt:P625 ?coord. } }

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#>
#All hospitals of selected types in Berlin
SELECT DISTINCT ?hospital ?hospitalLabel ?coord WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],de". }
  ?hospital (wdt:P31*/wdt:P279*) ?hospitalType .
  FILTER (?hospitalType = wd:Q16917 || 
          ?hospitalType = wd:Q1059324 ||  
          ?hospitalType = wd:Q4284971 ||
          ?hospitalType = wd:Q569500 ||
          ?hospitalType = wd:Q64624840 ||
          ?hospitalType = wd:Q46124 ||
          ?hospitalType = wd:Q695416 ||
          ?hospitalType = wd:Q61794666 ||
          ?hospitalType = wd:Q688829 ||
          ?hospitalType = wd:Q210999 ||
          ?hospitalType = wd:Q1391390 ||
          ?hospitalType = wd:Q1774898 ||
          ?hospitalType = wd:Q5166147 ||
          ?hospitalType = wd:Q7315485 ||
          ?hospitalType = wd:Q13171852 ||
          ?hospitalType = wd:Q2424154 || 
          ?hospitalType = wd:Q644264 ||
          ?hospitalType = wd:Q22914759 ||
          ?hospitalType = wd:Q25004734 ||
          ?hospitalType = wd:Q42297537 ||
          ?hospitalType = wd:Q64578911 ||
          ?hospitalType = wd:Q96243215 ||
          ?hospitalType = wd:Q2387974 ||
          ?hospitalType = wd:Q1009272 ||
          ?hospitalType = wd:Q1877467 ||
          ?hospitalType = wd:Q3145296 ||
          ?hospitalType = wd:Q5154967 ||
          ?hospitalType = wd:Q5466630 ||
          ?hospitalType = wd:Q6672116 ||
          ?hospitalType = wd:Q7048982 ||
          ?hospitalType = wd:Q7309759 ||
          ?hospitalType = wd:Q7883677 ||
          ?hospitalType = wd:Q1706476 ||
          ?hospitalType = wd:Q1813474)
  ?hospital (wdt:P131*/wdt:P127*/wdt:P137*) wd:Q64 .
  OPTIONAL { ?hospital wdt:P625 ?coord. }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?coord"):::projected v2("?hospital"):::projected v1("?hospitalType") a1((" ")) a2((" ")) a3((" ")) c36(["bd:serviceParam"]):::iri c38(["#91;AUTO_LANGUAGE#93;,de"]):::literal c44(["wd:Q64"]):::iri f0[["(?hospitalType = 'wd:Q16917' || (?hospitalType = 'wd:Q1059324' || (?hospitalType = 'wd:Q4284971' || (?hospitalType = 'wd:Q569500' || (?hospitalType = 'wd:Q64624840' || (?hospitalType = 'wd:Q46124' || (?hospitalType = 'wd:Q695416' || (?hospitalType = 'wd:Q61794666' || (?hospitalType = 'wd:Q688829' || (?hospitalType = 'wd:Q210999' || (?hospitalType = 'wd:Q1391390' || (?hospitalType = 'wd:Q1774898' || (?hospitalType = 'wd:Q5166147' || (?hospitalType = 'wd:Q7315485' || (?hospitalType = 'wd:Q13171852' || (?hospitalType = 'wd:Q2424154' || (?hospitalType = 'wd:Q644264' || (?hospitalType = 'wd:Q22914759' || (?hospitalType = 'wd:Q25004734' || (?hospitalType = 'wd:Q42297537' || (?hospitalType = 'wd:Q64578911' || (?hospitalType = 'wd:Q96243215' || (?hospitalType = 'wd:Q2387974' || (?hospitalType = 'wd:Q1009272' || (?hospitalType = 'wd:Q1877467' || (?hospitalType = 'wd:Q3145296' || (?hospitalType = 'wd:Q5154967' || (?hospitalType = 'wd:Q5466630' || (?hospitalType = 'wd:Q6672116' || (?hospitalType = 'wd:Q7048982' || (?hospitalType = 'wd:Q7309759' || (?hospitalType = 'wd:Q7883677' || (?hospitalType = 'wd:Q1706476' || ?hospitalType = 'wd:Q1813474')))))))))))))))))))))))))))))))))"]] f0 --> v1 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c36 --"wikibase:language"--> c38 end v2 --"wdt:P31"--> a1 a1 --"wdt:P279"--> v1 v2 --"wdt:P131"--> a2 a2 --"wdt:P127"--> a3 a3 --"wdt:P137"--> c44 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P625".-> v3 end