query-2392a8d7c4516763ca46ca482e1bed9e
- Hospitals in Regensburg with emergency department SELECT DISTINCT ?item ?itemLabel ?itemDescription ?statusLabel WHERE { #is or instance of Hospital ?item wdt:P31/wdt:P279* wd:Q16917; #in Regensburg wdt:P131 wd:Q2978; #get geo information wdt:P625 ?geo ; #with emergency department wdt:P527 wd:Q1295316. #OPTIONAL { ?hospital wdt:P6855 ?status. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }
sort by geo location
ORDER BY DESC (?geo)
Use at
- https://query.wikidata.org/sparql
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#>
# 2. Hospitals in Regensburg with emergency department
SELECT DISTINCT ?item ?itemLabel ?itemDescription ?statusLabel WHERE {
#is or instance of Hospital
?item wdt:P31/wdt:P279* wd:Q16917;
#in Regensburg
wdt:P131 wd:Q2978;
#get geo information
wdt:P625 ?geo ;
#with emergency department
wdt:P527 wd:Q1295316.
#OPTIONAL { ?hospital wdt:P6855 ?status. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
#sort by geo location
ORDER BY DESC (?geo)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?geo")
v2("?item"):::projected
a1((" "))
c5(["wd:Q2978"]):::iri
c10(["bd:serviceParam"]):::iri
c8(["wd:Q1295316"]):::iri
c3(["wd:Q16917"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v2 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
v2 --"wdt:P131"--> c5
v2 --"wdt:P625"--> v1
v2 --"wdt:P527"--> c8
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end