query-aa8021201142191dcd320a7048958c00

rq turtle/ttl

Academy Award winners and nominees which don't mention the respective ceremony Strange result

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#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX v: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>

SELECT ?instanceLabel ?item ?itemLabel ?property ?awardLabel WHERE {
  ?item wdt:P31 ?instance .
  ?instance wdt:P279* wd:Q11424 .
  {{
    ?item p:P166 ?award_statement .
    ?award_statement v:P166 ?award
  }  UNION {
    ?item p:P1411 ?award_statement .
    ?award_statement v:P1411 ?award
  }}.
  ?item ?property ?award .
  ?award wdt:P31 wd:Q19020 .
  FILTER NOT EXISTS { ?award_statement pq:P805 ?ceremony } .
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en" .
  }
} ORDER BY ?property ?instanceLabel ?itemLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v8("?award") v4("?award_statement") v5("?ceremony") v7("?instance") v2("?instanceLabel"):::projected v6("?item"):::projected v3("?itemLabel"):::projected v1("?property"):::projected c9(["wd:Q19020"]):::iri c13(["en"]):::literal c11(["bd:serviceParam"]):::iri c4(["wd:Q11424"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"p:qualifier/P805"--> e0v2 e0v1("?award_statement"):::projected e0v2("?ceremony"):::projected end f0--EXISTS--> f0e0 f0 --> v4 f0 --> c1 f0 --> v5 v4 --"p:qualifier/P805"--> v5 v6 --"p:direct/P31"--> v7 v7 --"p:direct/P279"--> c4 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v6 --"p:P1411"--> v4 v4 --"p:statement/P1411"--> v8 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v6 --"p:P166"--> v4 v4 --"p:statement/P166"--> v8 end union0r <== or ==> union0l end v6 -->v1--> v8 v8 --"p:direct/P31"--> c9 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 end