query-2d8511249aca2c47627243c2d7d5b428

rq turtle/ttl

Propertiesaward received (P166)instance of (P31)subclass of (P279)Nobel Laureate API ID (P8024)P3188

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#>
SELECT DISTINCT ?recipient ?recipientLabel ?NobelID ?NobelLaureateID WHERE {

  { ?recipient wdt:P166 [wdt:P31/wdt:P279* wd:Q7191]. } 
  UNION
  { ?recipient wdt:P8024 ?NobelLaureateID . } 
  UNION
  { ?recipient wdt:P3188 ?NobelID . } 

  FILTER(NOT EXISTS { ?recipient wdt:P3188 ?NobelID. ?recipient wdt:P8024 ?NobelLaureateID . })
  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; v2("?NobelID"):::projected v3("?NobelLaureateID"):::projected v1("?recipient"):::projected a1((" ")) a2((" ")) c8(["bd:serviceParam"]):::iri c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal c5(["wd:Q7191"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"wdt:P3188"--> e0v2 e0v1 --"wdt:P8024"--> e0v3 e0v2("?NobelID"):::projected e0v3("?NobelLaureateID"):::projected e0v1("?recipient"):::projected end f0--EXISTS--> f0e0 f0 --> v1 f0 --> c1 f0 --> v2 f0 --> c2 f0 --> v3 v1 --"wdt:P3188"--> v2 v1 --"wdt:P8024"--> v3 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P3188"--> v2 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P8024"--> v3 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; a1 --"wdt:P31"--> a2 a2 --"wdt:P279"--> c5 v1 --"wdt:P166"--> a1 end union0r <== or ==> union0l end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end