The viv.rating
capsule provides a set of abstract concepts for storing user-generated ratings and reviews of other entities, such as businesses or movies.
This reference lists out several of the models available in this library capsule. Some sections contain tables listing information about those concepts or actions.
Types are always in the viv.*
namespace, and in the viv.rating.*
namespace unless another namespace is specified (for example, viv.geo.*
). All properties have a cardinality of min (Optional)
, max (One)
unless otherwise specified.
This is a typical quality rating, generally expressed as stars (for example, "4 stars") or as a fraction (for example, "8 out of 10").
Property | Type | Kind | Notes |
---|---|---|---|
maxScore | MaxScore | decimal | Required (1) |
minScore | MinScore | decimal | Required (2) |
ratingSource | RatingSource | name | Required |
score | Score | decimal | Required |
normalizedScore | NormalizedScore | decimal | (3) |
numberOfAggregatedRatings | NumberOfAggregatedRatings | integer | |
discretizedScore | DiscreteStars | enum | (4) |
MaxScore
is the score denominator, such as the highest possible score: 5.0
for a 1–5 star rating; 10.0
for a 10-point rating scale.MinScore
is the lowest possible score. This will generally be 0
or 1
.NormalizedScore
is a decimal fraction between 0.0
and 1.0
. It will be computed for you based on MinScore
, MaxScore
, and Score
.discretizedScore
will be calculated for you, and set to one of OneStar
, TwoStars
, ThreeStars
, FourStars
, or FiveStars
. This is intended to assist in preference learning.The default sort ordering for Rating
is descending by normalizedScore
, then descending by numberOfAggregatedRatings
.
The PriceRating
model is used for entities that might have separate ratings for their prices, such as hotels or restaurants, that might be marked with 1–4 currency signs, such as "$$$$" for "very expensive." It has the same properties as Rating
, with the following exceptions:
discretizedScore
is of type DiscreteDollars
, and its enumerated symbols are OneDollar
, TwoDollars
, ThreeDollars
, and FourDollars
.MinScore
should be set to 1.0
and MaxScore
should be set to 4.0
.normalizedScore
(least expensive to most expensive).The capsule includes vocabulary for sorting (for example, requesting "affordable" prices will sort from lowest to highest, while requesting "premium" prices will sort from highest to lowest).
Property | Type | Kind | Notes |
---|---|---|---|
author | ReviewAuthor | structure | |
title | ReviewTitle | text | |
content | ReviewContent | name | |
rating | Rating | structure | |
snippet | ReviewSnippet | text | Required |
url | ReviewUrl | text | |
created | ReviewCreatedDate | structure | role-of time.DateTime (1) |
viv.time
for details.Property | Type | Kind |
---|---|---|
name | ReviewAuthorName | name |
image | ReviewAuthorImage | text |
url | ReviewAuthorUrl | text |
This model is used to rank items arbitrarily within a group.
Property | Type | Kind | Notes |
---|---|---|---|
rank | Rank | integer | Required |
outOf | RankTotal | integer | Required |
source | RatingSource | name | Required |
category | RankingCategory | name |
The default sort ordering is ascending by rank
.
RatingCount is a named primitive concept, an integer representing the total number of ratings for an item. This is not used in other structure concepts in Rating
but can be used by your capsules.