query-103e683c55ce1b13403a116e0f125cbd

rq turtle/ttl

Number of participants (needs work):

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?regatta ?year ?number ?sum ?diff {
  {
    SELECT ?regatta (SUM(?number) AS ?sum) {
      ?item wdt:P31 wd:Q18536594; wdt:P361 ?regatta; wdt:P1132 ?number .
      ?regatta wdt:P31 wd:Q720609 .
    } GROUP BY ?regatta
  }
  ?regatta wdt:P1132 ?number; wdt:P580 ?date .
  BIND(YEAR(?date) AS ?year) .
  BIND(?number - ?sum AS ?diff) .
} ORDER BY ASC(?year)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?date") v7("?diff"):::projected v2("?item") v4("?number"):::projected v3("?regatta"):::projected v5("?sum"):::projected v7("?year"):::projected c5(["wd:Q720609"]):::iri c2(["wd:Q18536594"]):::iri v2 --"wdt:P31"--> c2 v2 --"wdt:P361"--> v3 v2 --"wdt:P1132"--> v4 v3 --"wdt:P31"--> c5 bind1[/"sum(?number)"/] v4 --o bind1 bind1 --as--o v5 v3 --"wdt:P1132"--> v4 v3 --"wdt:P580"--> v6 bind2[/"year-from-dateTime(?date)"/] v6 --o bind2 bind2 --as--o v7 bind3[/"?number - ?sum"/] v4 --o bind3 v5 --o bind3 bind3 --as--o v7