If you find this helpful, please click the Google Button to the left, if it is white, to make it turn blue or red. Thank you! (It also helps find this page again more easily.) |
Microdata for Ratings
Syntax
Examples
Rating on a scale from 1 to 5 (default scale)
<span itemprop="rating">4 stars</span>
The default scale with a range from 1 to 5 is used, where 5 is the best rating, since the best rating is not explicitly specified with an itemscope="best"
property.
Rating displayed using an image
<img itemprop="rating" src="/rating-images/three-stars.png" alt="3 stars"/>
Again, the default scale with a range from 1 to 5 is used, where 5 is the best rating, since the best rating is not explicitly specified with an itemscope="best"
property.
Rating for a list of items with the same rating
<section itemprop="rating" itemscope="itemscope" itemtype="http://data-vocabulary.org/Rating"> <h1 itemprop="value">Five Star Hotels</h1> <ul> <li>...</li> ... </ul> </section>
Since the value of the rating in the <h1> heading tag applies to all of the <li> list items in the section, the section is a microdata item that gets its value from the itemprop="value"
attribute on the heading tag. As above, the default scale with a range from 1 to 5 is used, where 5 is the best rating.
Rating on a scale from 1 to 10
<span itemprop="rating" itemscope="itemscope" itemtype="http://data-vocabulary.org/Rating"> <span itemprop="value">9</span> out of <span itemprop="best">10</span> </span>
In this example, the rating
microdata item has a second itemprop="best"
property indicating that the range of ratings is from 1 to 10, with 10 being the best rating.
Rating for a single review of a book
- Harry Potter and the Sorcerer's Stone
- 9 out of 10
- Harry Potter and the Sorcerer's Stone is a fantasy novel written by J. K. Rowling. It is the first of a series of seven Harry Potter books and when it was originally published in Britain, the title was Harry Potter and the Philosopher's Stone. It is about the adventures of the adolescent wizard Harry Potter and his friends and starts when an evil wizard kills his parents to try and conquer the magical people and the Muggles, who are the normal non-magical people.
- I really liked this book.
<dl itemscope="itemscope" itemtype="http://data-vocabulary.org/Review"> <dt><label>Title:</label> <span itemprop="itemreviewed">Harry Potter and the Sorcerer's Stone</span></dt> <dd><label>Rating:</label> <span itemprop="rating" itemscope="itemscope" itemtype="http://data-vocabulary.org/Rating"><span itemprop="value">9</span> out of <span itemprop="best">10</span></span></dd> <dd><label>Date reviewed:</label> <time itemprop="dtreviewed" datetime="2011-04-01">April 1, 2011</time></dd> <dd><label>Description:</label> <span itemprop="description"><cite>Harry Potter and the Sorcerer's Stone</cite> is a fantasy novel written by J. K. Rowling. It is the first of a series of seven Harry Potter books and when it was originally published in Britain, the title was <cite>Harry Potter and the Philosopher's Stone</cite>. It is about the adventures of the adolescent wizard Harry Potter and his friends and starts when an evil wizard kills his parents to try and conquer the magical people and the <dfn>Muggles</dfn>, who are the normal non-magical people.</span></dd> <dd><label>Summary:</label> <span itemprop="summary">I really liked this book.</span></dd> </dl>
Rating for a summary of book reviews
- Harry Potter and the Sorcerer's Stone
- 8.5 out of 10 based on 745 user ratings
- 15
- Most people seem to like this book.
<dl itemscope="itemscope" itemtype="http://data-vocabulary.org/Review-aggregate"> <dt><label>Title:</label> <span itemprop="itemreviewed">Harry Potter and the Sorcerer's Stone</span></dt> <dd><label>Rating:</label> <span itemprop="rating" itemscope="itemscope" itemtype="http://data-vocabulary.org/Rating"><span itemprop="value">8.5</span> out of <span itemprop="best">10</span></span> based on <span itemprop="votes">745</span> user ratings</dd> <dd><label>Number of user reviews:</label> <span itemprop="count">15</span></dd> <dd><label>Summary:</label> <span itemprop="summary">Most people seem to like this book.</span></dd> </dl>