query-ce6f599654c506eff1b4256332df20d4

rq turtle/ttl

hospitals in Potsdam with an emergency service SELECT DISTINCT ?hospitalLabel ?phoneNumber WHERE { ?hospital wdt:P31/wdt:P279* wd:Q16917; #hospital
wdt:P131 wd:Q1711; #Potsdam p:P6855 [pq:P1329 ?phoneNumber].

SERVICE wikibase:label { bd:serviceParam wikibase: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 pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# hospitals in Potsdam with an emergency service
SELECT DISTINCT ?hospitalLabel ?phoneNumber
WHERE
{
  ?hospital wdt:P31/wdt:P279* wd:Q16917; #hospital            
            wdt:P131 wd:Q1711; #Potsdam
            p:P6855 [pq:P1329 ?phoneNumber].

  SERVICE wikibase:label { bd:serviceParam wikibase: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 v3("?phoneNumber"):::projected a1((" ")) a2((" ")) c5(["wd:Q1711"]):::iri c9(["bd:serviceParam"]):::iri c3(["wd:Q16917"]):::iri c11(["en"]):::literal v2 --"p:direct/P31"--> a1 a1 --"p:direct/P279"--> c3 v2 --"p:direct/P131"--> c5 a2 --"p:qualifier/P1329"--> v3 v2 --"p:P6855"--> a2 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end