query-6258a2283437d3b418b9bd10bc7c8910

rq turtle/ttl

UK theses, with no ETHoS ID SELECT ?doctor ?doctorLabel ?thesis ?thesisLabel (sample(?university) as ?univ) { ?doctor wdt:P69 ?university ;wdt:P1026 ?thesis filter not exists { ?thesis wdt:P4536 [] } . ?university wdt:P17 wd:Q145 ; wdt:P361/wdt:P31/wdt:P279 wd:Q3918 . service wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }

} GROUP BY ?doctor ?doctorLabel ?thesis ?thesisLabel having (count(?university) = 1 ) values (?university) {(wd:Q160302) }

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# UK theses, with no ETHoS ID
SELECT ?doctor ?doctorLabel ?thesis ?thesisLabel (sample(?university) as ?univ) {
  ?doctor wdt:P69 ?university 
          ;wdt:P1026 ?thesis
          filter not exists { ?thesis wdt:P4536 [] } 
          .
  ?university wdt:P17 wd:Q145 
              ; wdt:P361*/wdt:P31/wdt:P279* wd:Q3918
              .
  service wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }

} GROUP BY ?doctor ?doctorLabel ?thesis ?thesisLabel  having (count(?university) = 1 ) values (?university) {(wd:Q160302) }

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?_anon_d00291b7e9a143df8ec0be8c8ebd714c77559") v3("?doctor"):::projected v2("?thesis"):::projected v5("?univ") v1("?university"):::projected a2((" ")) a3((" ")) a4((" ")) a1((" ")) c10(["wd:Q3918"]):::iri c12(["bd:serviceParam"]):::iri c14(["#91;AUTO_LANGUAGE#93;,en"]):::literal c6(["wd:Q145"]):::iri bind0[/VALUES ?university/] bind0-->v1 bind00(["wd:Q160302"]) bind00 --> bind0 f1[[" = '1^^xsd:integer'"]] f1 --> a1 f2[["not "]] subgraph f2e0["Exists Clause"] e0v1 --"wdt:P4536"--> e0a1 e0v1("?thesis"):::projected e0a1((" ")):::projected end f2--EXISTS--> f2e0 f2 --> v2 f2 --> c2 f2 --> a2 v2 --"wdt:P4536"--> a2 v3 --"wdt:P69"--> v1 v3 --"wdt:P1026"--> v2 v1 --"wdt:P17"--> c6 v1 --"wdt:P361"--> a3 a3 --"wdt:P31"--> a4 a4 --"wdt:P279"--> c10 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c12 --"wikibase:language"--> c14 end bind5[/"count(?university)"/] v1 --o bind5 bind5 --as--o v4 bind6[/"sample(?university)"/] v1 --o bind6 bind6 --as--o v5