query-0f2779a3f57a319814766f7b40139d92

rq turtle/ttl

عدد جوائز الأكاديمية التي تم توزيعها حسب نوع الجائزة Number of handed out Academy Awards per award type Number of handed out Academy Awards per award type Počet udělených cen akademie podle typu ocenění Number of handed out Academy Awards per award type Number of handed out Academy Awards per award type Number of handed out Academy Awards per award type Number of handed out Academy Awards per award type Number of handed out Academy Awards per award type Number of handed out Academy Awards per award type Number of handed out Academy Awards per award type Nombre de prix décernés aux académiciens par type de prix מספר פרסי האקדמיה שחולקו לפי סוג הפרס Number of handed out Academy Awards per award type Number of handed out Academy Awards per award type Numero di premi dell'accademia consegnati per tipo di premio Number of handed out Academy Awards per award type Number of handed out Academy Awards per award type Number of handed out Academy Awards per award type Number of handed out Academy Awards per award type Number of handed out Academy Awards per award type Aantal uitgereikte Academy Awards per prijstype Number of handed out Academy Awards per award type Number of handed out Academy Awards per award type Number of handed out Academy Awards per award type Number of handed out Academy Awards per award type Number of handed out Academy Awards per award type Antalet utdelade Oscars efter kategori Number of handed out Academy Awards per award type Number of handed out Academy Awards per award type Кількість вручених премія «Оскар» за типом премії Number of handed out Academy Awards per award type 奥斯卡金像奖每种奖项颁发数量

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#>
SELECT ?awardCount ?award ?awardLabel WHERE {
  {
    SELECT (COUNT(?award) AS ?awardCount) ?award
    WHERE
    {
      {
        SELECT (SAMPLE(?human) AS ?human) ?award ?awardWork (SAMPLE(?director) AS ?director) (SAMPLE(?awardEdition) AS ?awardEdition) (SAMPLE(?time) AS ?time) WHERE {
          ?award wdt:P31 wd:Q19020 .      # All items that are instance of(P31) of Academy awards (Q19020)
          {
            ?human p:P166 ?awardStat .              # Humans with an awarded(P166) statement
            ?awardStat ps:P166 ?award .        # ... that has any of the values of ?award
            ?awardStat pq:P805 ?awardEdition . # Get the award edition (which is "subject of" XXth Academy Awards)
            ?awardStat pq:P1686 ?awardWork . # The work they have been awarded for
            ?human wdt:P31 wd:Q5 .        # Humans
          } UNION {
            ?awardWork wdt:P31 wd:Q11424 . # Films
            ?awardWork p:P166 ?awardStat . # ... with an awarded(P166) statement
            ?awardStat ps:P166 ?award .        # ... that has any of the values of ?award
            ?awardStat pq:P805 ?awardEdition . # Get the award edition (which is "subject of" XXth Academy Awards)
          }
          OPTIONAL {
            ?awardEdition wdt:P585 ?time . # the "point of time" of the Academy Award
            ?awardWork wdt:P57 ?director .
          }
        }
        GROUP BY ?awardWork ?award # We only want every movie once for a category (a 'random' person is selected)
      }
    } GROUP BY ?award
    ORDER BY ASC(?awardCount)
  }
  SERVICE wikibase:label { # ... include the labels
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en" .
  }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?award"):::projected v9("?awardCount"):::projected v9("?awardEdition") v4("?awardStat") v6("?awardWork") v9("?director") v9("?human") v9("?time") c2(["wd:Q19020"]):::iri c14(["#91;AUTO_LANGUAGE#93;,mul,en"]):::literal c12(["bd:serviceParam"]):::iri c7(["wd:Q5"]):::iri c8(["wd:Q11424"]):::iri v2 --"p:direct/P31"--> c2 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v6 --"p:direct/P31"--> c8 v6 --"p:P166"--> v4 v4 --"p:statement/P166"--> v2 v4 --"p:qualifier/P805"--> v9 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v9 --"p:P166"--> v4 v4 --"p:statement/P166"--> v2 v4 --"p:qualifier/P805"--> v9 v4 --"p:qualifier/P1686"--> v6 v9 --"p:direct/P31"--> c7 end union0r <== or ==> union0l end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v9 -."p:direct/P585".-> v9 v6 --"p:direct/P57"--> v9 end bind4[/"sample(?human)"/] v9 --o bind4 bind4 --as--o v9 bind5[/"sample(?director)"/] v9 --o bind5 bind5 --as--o v9 bind6[/"sample(?awardEdition)"/] v9 --o bind6 bind6 --as--o v9 bind7[/"sample(?time)"/] v9 --o bind7 bind7 --as--o v9 bind9[/"count(?award)"/] v2 --o bind9 bind9 --as--o v9 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c12 --"wikibase:language"--> c14 end