Thread:Extension talk:Semantic Rating/optimized query/reply

That is not quite the same calculation. The more concise calculation

{{#rating: {{#ask:Item:: [[Author::{{FULLPAGENAME}} ]]|?Rating|format=average}}

will average all of the reviews for all of the items by the author in one step. However, the longer calculation

{{#arraydefine: ratings |{{#arraymap: {{#ask:Author::{{FULLPAGENAME}}|link=none}} |,    |@@@@     |{{#ask:Item::@@@@|?Rating|format=average}} }} }} {{#rating:{{#expr:{{#expr:{{#arrayprint:ratings|+}}}}/{{#arraysize:ratings}}}}}}

will calculate the average of the average reviews. To see the difference, imagine an author that has written two books. One book receives 1 one star review and the other receives 9 five star reviews. The first calculation will yield an average rating of 4.6, while the second will yield an average rating of 3. The choice of which calculation to use will depend upon whether you want all items to contribute equally to the average or whether you want items that generate more reviews to be weighted more heavily.