query-b7d452906102d6bd41cc60cd19db9611
Propertiesinstance of (P31)grants (P5460)academic major (P812)
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 p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?university ?universityLabel ?degreeLabel ?majorLabel WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
?university wdt:P31 wd:Q3918 .
?university wdt:P5460 ?degree .
OPTIONAL { ?university p:P5460 ?rev . ?rev pq:P812 ?major}
FILTER(?degree = wd:Q183816) #master's degree
FILTER(?major = wd:Q55636433) #Electrical Engineering
}
ORDER BY ?universityLabel ?degreeLabel ?majorLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?degree")
v2("?degreeLabel"):::projected
v4("?major")
v3("?majorLabel"):::projected
v7("?rev")
v6("?university"):::projected
v1("?universityLabel"):::projected
c4(["bd:serviceParam"]):::iri
c6(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c8(["wd:Q3918"]):::iri
f0[["?major = 'wd:Q55636433'"]]
f0 --> v4
f1[["?degree = 'wd:Q183816'"]]
f1 --> v5
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c4 --"wikibase:language"--> c6
end
v6 --"p:direct/P31"--> c8
v6 --"p:direct/P5460"--> v5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v6 -."p:P5460".-> v7
v7 --"p:qualifier/P812"--> v4
end