query-cc4795e9ac0191853f90ec7c363af643

rq turtle/ttl

Propertiesinstance of (P31)subclass of (P279)located in the administrative territorial entity (P131)grants (P5460)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 DISTINCT ?university ?universityLabel ?cityLabel ?degreeLabel 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").
  ?university wdt:P5460 ?degree .
  FILTER NOT EXISTS {?university wdt:P582 ?endDate;
                                 wdt:P156 ?followingInstitution} . 
  }
ORDER BY ?universityLabel ?cityLabel ?degreeLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?city") v2("?cityLabel"):::projected v8("?degree") v3("?degreeLabel"):::projected v5("?endDate") v6("?followingInstitution") v4("?university"):::projected v1("?universityLabel"):::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:P582"--> e0v2 e0v1 --"wdt:P156"--> e0v3 e0v2("?endDate"):::projected e0v3("?followingInstitution"):::projected e0v1("?university"):::projected end f0--EXISTS--> f0e0 f0 --> v4 f0 --> c1 f0 --> v5 f0 --> c2 f0 --> v6 v4 --"wdt:P582"--> v5 v4 --"wdt:P156"--> v6 f1[["?cityLabel = 'en'"]] f1 --> v2 f2[["?city = 'wd:Q64'"]] f2 --> v7 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c8 end v4 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c11 v4 --"wdt:P131"--> v7 v7 --"rdfs:label"--> v2 v4 --"wdt:P5460"--> v8