query-f28120ac33571d7f50bb015a53892658

rq turtle/ttl

Propertiesinstance of (P31)subclass of (P279)located in the administrative territorial entity (P131)inception (P571)

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
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#>
SELECT DISTINCT ?hospitalLabel  (year(xsd:dateTime(?inception)) as ?year)
WHERE
{
  ?hospital wdt:P31/wdt:P279* wd:Q16917; #hospital
            wdt:P131 wd:Q1711; #Potsdam
            wdt:P571 ?inception. #get inception
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
order by ASC(?year) #order by year (oldest to newest)
limit 10

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?hospital") v3("?inception"):::projected v4("?year") a1((" ")) c5(["wd:Q1711"]):::iri c8(["bd:serviceParam"]):::iri c3(["wd:Q16917"]):::iri c10(["en"]):::literal v2 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c3 v2 --"wdt:P131"--> c5 v2 --"wdt:P571"--> v3 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end bind0[/"year-from-dateTime(http://www.w3.org/2001/XMLSchema#dateTime(?inception))"/] v3 --o bind0 bind0 --as--o v4