query-c138b37b8feb968aaf9947ef8ebf7630
Propertiesinstance of (P31)subclass of (P279)located in the administrative territorial entity (P131)country (P17)end time (P582)
Use at
- https://query.wikidata.org/sparql
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 bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?university ?universityLabel ?city ?cityLabel
WHERE {
?university wdt:P31/wdt:P279* wd:Q38723 ;
wdt:P131 ?city .
?city wdt:P17 wd:Q183 .
FILTER NOT EXISTS { ?statement pq:P582 ?university } # ... but the statement has no P582 (end date) qualifier
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?city"):::projected
v1("?statement")
v2("?university"):::projected
a1((" "))
c9(["bd:serviceParam"]):::iri
c11(["en"]):::literal
c7(["wd:Q183"]):::iri
c4(["wd:Q38723"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"pq:P582"--> e0v2
e0v1("?statement"):::projected
e0v2("?university"):::projected
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> v2
v1 --"pq:P582"--> v2
v2 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c4
v2 --"wdt:P131"--> v3
v3 --"wdt:P17"--> c7
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end