query-71358622a436e48b6eabcbfac9ee9df8
- All departments that are offered in Regensburg, including amount of beds
SELECT DISTINCT ?workfield ?workfieldLabel ?item ?itemLabel ?hospitalbeds ?geo
WHERE { #is or instance of Hospital in Regensburg ?item wdt:P31/wdt:P279* wd:Q16917; wdt:P131 wd:Q2978; #item has workfield X, with location wdt:P101 ?workfield; #item has X Beds wdt:P6801 ?hospitalbeds; wdt:P625 ?geo . SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } 
order by lcase(?workfieldLabel) # order a-z
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#>
# 4. All departments that are offered in Regensburg, including amount of beds
SELECT DISTINCT ?workfield ?workfieldLabel ?item ?itemLabel ?hospitalbeds ?geo  
WHERE {
  #is or instance of Hospital in Regensburg
  ?item wdt:P31/wdt:P279* wd:Q16917;
        wdt:P131 wd:Q2978;
        #item has workfield X, with location 
        wdt:P101 ?workfield;
         #item has X Beds 
        wdt:P6801 ?hospitalbeds;
        wdt:P625 ?geo .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
order by lcase(?workfieldLabel) # order a-z
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v5("?geo"):::projected 
  v4("?hospitalbeds"):::projected 
  v2("?item"):::projected 
  v3("?workfield"):::projected 
  v1("?workfieldLabel"):::projected 
  a1((" "))
  c5(["wd:Q2978"]):::iri 
  c10(["bd:serviceParam"]):::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:P101"-->  v3
  v2 --"wdt:P6801"-->  v4
  v2 --"wdt:P625"-->  v5
  subgraph s1["http://wikiba.se/ontology#label"]
    style s1 stroke-width:4px;
    c10 --"wikibase:language"-->  c12
  end