Average of all ratings is saved as metadata "kaltura_video_rating" to the video object. Owner is set to video owner. I think instead the value should be set as metadata because it doesn't belong to user but only to the video object. This would also allow rating to be used with 'order_by_metadata' parameter in elgg_get_entities().
The same for the total number of ratings.
This is a bit weird: The video object does not get any annotation actually owned by the user who did the rating. Instead the video guid is saved as "kaltura_video_rated" annotation to the user object. This is used to check whether user has already voted. It would propably be much better to actually save the rating as annotation to the video object and set user as the annotation owner.