query-20aef70e00f84a97e467423e5de5d52b

rq turtle/ttl

TODO

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 ?film ?filmLabel ?filmDescription WHERE {
   {
  SELECT ?film (COUNT(DISTINCT ?award) AS ?count) WHERE {
    ?film wdt:P166 ?award.
    ?award (wdt:P31|wdt:P361)+ wd:Q19020. # awards currently use P31 but I could imagine that changing in the future
  }
  GROUP BY ?film
  HAVING(?count = 11) # I’m hard-coding the “target” count here because it shouldn’t ever change
}
  FILTER(?film != wd:Q44578) # *other* films :)
  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; v3("?award") v4("?count") v1("?film"):::projected c5(["wd:Q19020"]):::iri c8(["bd:serviceParam"]):::iri c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["?film != 'wd:Q44578'"]] f0 --> v1 f1[["?count = '11^^xsd:integer'"]] f1 --> v4 v1 --"wdt:P166"--> v3 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P361"--> c5 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P31"--> c5 end union0r <== or ==> union0l end bind3[/"count(?award)"/] v3 --o bind3 bind3 --as--o v4 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end