query-7f859af69ab97c21fc2f6a20eb5e80f1
number of movie ratings by date of original release SELECT ?year ((round(avg(?age)10)/10) AS ?avg) ((round(sum((?age-?avg)(?age-?avg))100/count(?age))/100) AS ?var) (count(distinct ?film) AS ?films) (count(?age) AS ?ratings) WHERE { { SELECT ?film ?age (year(min(?date)) AS ?year) WHERE { [] wdt:P31/wdt:P279 wd:Q24716199; wikibase:directClaim ?p . ?film wdt:P31/wdt:P279 wd:Q11424; wdt:P577 ?date; ?p [ wdt:P2899 ?age ] . } GROUP BY ?film ?age } { SELECT ?year (avg(?avgf) AS ?avg) WHERE { { SELECT ?film (year(min(?date)) AS ?year) (avg(?age) AS ?avgf) WHERE { [] wdt:P31/wdt:P279 wd:Q24716199; wikibase:directClaim ?p . ?film wdt:P31/wdt:P279* wd:Q11424; wdt:P577 ?date; ?p [ wdt:P2899 ?age ] . } GROUP BY ?film } } GROUP BY ?year } } GROUP BY ?year ORDER BY DESC(?year)
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
#number of movie ratings by date of original release
SELECT ?year ((round(avg(?age)*10)/10) AS ?avg)
((round(sum((?age-?avg)*(?age-?avg))*100/count(?age))/100) AS ?var)
(count(distinct ?film) AS ?films) (count(?age) AS ?ratings)
WHERE {
{ SELECT ?film ?age (year(min(?date)) AS ?year)
WHERE {
[] wdt:P31/wdt:P279* wd:Q24716199; wikibase:directClaim ?p .
?film wdt:P31/wdt:P279* wd:Q11424; wdt:P577 ?date; ?p [ wdt:P2899 ?age ] .
} GROUP BY ?film ?age
}
{ SELECT ?year (avg(?avgf) AS ?avg)
WHERE {
{ SELECT ?film (year(min(?date)) AS ?year) (avg(?age) AS ?avgf)
WHERE {
[] wdt:P31/wdt:P279* wd:Q24716199; wikibase:directClaim ?p .
?film wdt:P31/wdt:P279* wd:Q11424; wdt:P577 ?date; ?p [ wdt:P2899 ?age ] .
} GROUP BY ?film
}
} GROUP BY ?year
}
} GROUP BY ?year ORDER BY DESC(?year)