query-e47a027bc42621e775e0bc86c4afd5b7

rq turtle/ttl

all Wikidata hospitals in berlin SELECT ?hospital ?hospitalLabel ?coordinate_location WHERE { SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } ?hospital wdt:P31 wd:Q16917; wdt:P17 wd:Q183; wdt:P131 wd:Q64. OPTIONAL { ?hospital wdt:P625 ?coordinate_location. } }

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 Wikidata hospitals in berlin
SELECT ?hospital ?hospitalLabel ?coordinate_location WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  ?hospital wdt:P31 wd:Q16917;
    wdt:P17 wd:Q183;
    wdt:P131 wd:Q64.
  OPTIONAL { ?hospital wdt:P625 ?coordinate_location. }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?coordinate_location"):::projected v1("?hospital"):::projected c2(["bd:serviceParam"]):::iri c6(["wd:Q16917"]):::iri c10(["wd:Q64"]):::iri c4(["#91;AUTO_LANGUAGE#93;,en"]):::literal c8(["wd:Q183"]):::iri subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c2 --"wikibase:language"--> c4 end v1 --"wdt:P31"--> c6 v1 --"wdt:P17"--> c8 v1 --"wdt:P131"--> c10 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P625".-> v2 end