query-7325a1b2efbd1a6f95a8d4f06f357a02

rq turtle/ttl

hospitals in Brandenburg

SELECT DISTINCT ?hospitalLabel WHERE { { ?hospital wdt:P31 wd:Q16917; #hospital
} UNION { ?hospital wdt:P31 wd:Q1774898; #clinic } UNION { ?hospital wdt:P31 wd:Q644264; #children hospital } UNION { ?hospital wdt:P31 wd:Q1391390; #specialist hospital } UNION { ?hospital wdt:P31 wd:Q39364723; #hospital building } UNION { ?hospital wdt:P31 wd:Q7309759; #rehabilitation hospital } ?hospital wdt:P131+ wd:Q1208. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } order by ?hospitalLabel

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#>
# hospitals in Brandenburg

SELECT DISTINCT ?hospitalLabel
WHERE
{
  {
    ?hospital wdt:P31 wd:Q16917; #hospital            
  }
  UNION 
  { 
    ?hospital wdt:P31 wd:Q1774898; #clinic
  }
  UNION 
  { 
    ?hospital wdt:P31 wd:Q644264; #children hospital
  }
  UNION 
  { 
    ?hospital wdt:P31 wd:Q1391390; #specialist hospital
  }
  UNION 
  { 
    ?hospital wdt:P31 wd:Q39364723; #hospital building 
  }
  UNION
  {
    ?hospital wdt:P31 wd:Q7309759; #rehabilitation hospital 
  }
  ?hospital wdt:P131+ wd:Q1208.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
order by ?hospitalLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?hospital") v1("?hospitalLabel"):::projected c9(["wd:Q1208"]):::iri c3(["wd:Q1774898"]):::iri c4(["wd:Q644264"]):::iri c5(["wd:Q1391390"]):::iri c6(["wd:Q39364723"]):::iri c11(["bd:serviceParam"]):::iri c2(["wd:Q16917"]):::iri c7(["wd:Q7309759"]):::iri c13(["#91;AUTO_LANGUAGE#93;,en"]):::literal subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; subgraph union3[" Union "] subgraph union3l[" "] style union3l fill:#abf,stroke-dasharray: 3 3; subgraph union4[" Union "] subgraph union4l[" "] style union4l fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> c7 end subgraph union4r[" "] style union4r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> c6 end union4r <== or ==> union4l end end subgraph union3r[" "] style union3r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> c5 end union3r <== or ==> union3l end end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> c4 end union2r <== or ==> union2l end end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> c3 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> c2 end union0r <== or ==> union0l end v2 --"wdt:P131"--> c9 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 end