query-5e42310f659b82ff91fa328d336c74f2

rq turtle/ttl

Propertiesinstance of (P31)subclass of (P279)located in the administrative territorial entity (P131)end time (P582)followed by (P156)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?university ?universityLabel ?cityLabel WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  ?university wdt:P31/wdt:P279* wd:Q38723 .
  ?university wdt:P131 ?city 
              FILTER (?city = wd:Q64 ). # Berlin
  ?city rdfs:label ?cityLabel 
              FILTER (lang(?cityLabel) = "en").
  FILTER NOT EXISTS {?university wdt:P582 ?endDate} 
  FILTER NOT EXISTS {?university wdt:P156 ?followingInstitution} . 
}
LIMIT 100

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?city") v4("?cityLabel"):::projected v3("?endDate") v2("?followingInstitution") v1("?university"):::projected a1((" ")) c6(["bd:serviceParam"]):::iri c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal c11(["wd:Q38723"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"wdt:P156"--> e0v2 e0v2("?followingInstitution"):::projected e0v1("?university"):::projected end f0--EXISTS--> f0e0 f0 --> v1 f0 --> c1 f0 --> v2 v1 --"wdt:P156"--> v2 f1[["not "]] subgraph f1e1["Exists Clause"] e1v1 --"wdt:P582"--> e1v2 e1v2("?endDate"):::projected e1v1("?university"):::projected end f1--EXISTS--> f1e1 f1 --> v1 f1 --> c2 f1 --> v3 v1 --"wdt:P582"--> v3 f2[["?cityLabel = 'en'"]] f2 --> v4 f3[["?city = 'wd:Q64'"]] f3 --> v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c8 end v1 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c11 v1 --"wdt:P131"--> v5 v5 --"rdfs:label"--> v4