query-0b6fc1a2bf6e5b8103ebb606dcd02351

rq turtle/ttl

List of persons who hold a bachelor's degree in Computer science SELECT DISTINCT ?institution ?institutionLabel ?person ?personLabel ?degree ?degreeLabel ?majorLabel WHERE { ?person wdt:P31 wd:Q5 ; # instances (P31) of humans (Q5) p:P69 ?statement . # check for an "educated at" (P69) statement

?statement ps:P69 ?institution . # get value of the "educated at" statement, i.e. the institution ?institution wdt:P625 ?geoloc . # get the geolocation of the institution

?statement pq:P512 ?degree . # get qualifier "academic degree" (P512) ?statement pq:P812 ?major . # get qualifier "academic major (P812) ?degree wdt:P31/wdt:P279 wd:Q163727 . # filter for bachelor degrees (Q163727) ?major wdt:P31/wdt:P279 wd:Q21198 . # filter major for computer science (Q21198)

SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# List of persons who hold a bachelor's degree in Computer science
SELECT DISTINCT ?institution ?institutionLabel ?person ?personLabel ?degree ?degreeLabel ?majorLabel WHERE {
  ?person wdt:P31 wd:Q5 ; # instances (P31) of humans (Q5)
            p:P69 ?statement . # check for an "educated at" (P69) statement

  ?statement ps:P69 ?institution . # get value of the "educated at" statement, i.e. the institution
  ?institution wdt:P625 ?geoloc . # get the geolocation of the institution

  ?statement pq:P512 ?degree . # get qualifier "academic degree" (P512) 
  ?statement pq:P812 ?major . # get qualifier "academic major (P812)
  ?degree wdt:P31*/wdt:P279* wd:Q163727 . # filter for bachelor degrees (Q163727) 
  ?major wdt:P31*/wdt:P279* wd:Q21198 . # filter major for computer science (Q21198)

  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?degree"):::projected v4("?geoloc") v3("?institution"):::projected v6("?major") v1("?person"):::projected v2("?statement") a1((" ")) a2((" ")) c10(["wd:Q21198"]):::iri c12(["bd:serviceParam"]):::iri c2(["wd:Q5"]):::iri c9(["wd:Q163727"]):::iri c14(["#91;AUTO_LANGUAGE#93;,en"]):::literal v1 --"p:direct/P31"--> c2 v1 --"p:P69"--> v2 v2 --"p:statement/P69"--> v3 v3 --"p:direct/P625"--> v4 v2 --"p:qualifier/P512"--> v5 v2 --"p:qualifier/P812"--> v6 v5 --"p:direct/P31"--> a1 a1 --"p:direct/P279"--> c9 v6 --"p:direct/P31"--> a2 a2 --"p:direct/P279"--> c10 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c12 --"wikibase:language"--> c14 end