3

How would you write microdata for hotels with ratings classified as "1-star" to "5-star" hotels? Looking at http://schema.org/Hotel, I see no "Rating" property but only an "aggregateRating" one which is for multiple ratings from reviews. For reference, here's an explanation of the Star Rating system http://www.hotels.com/customer_care/star_rating.html

Here' s an example of my markup code:

<div class="container mt30" itemscope itemtype="http://schema.org/Product">
    <div class="row">
        <div class="col-sm-7" itemprop="brand" itemscope itemtype="http://schema.org/Hotel">
            <span style="font-size:24px" itemprop="name">Hotel Name</span>

            <span class="hidden" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
                <span itemprop="ratingValue">3.5</span>
                <span itemprop="worstRating">1</span>
                <span itemprop="bestRating">5</span>
                <span itemprop="ratingCount">1</span>
            </span>
...

I'm guessing I would need something like this:

<span class="hidden" itemprop="rating" itemscope itemtype="http://schema.org/Rating">
    <span itemprop="ratingValue">3.5</span>
    <span itemprop="worstRating">1</span>
    <span itemprop="bestRating">5</span>
</span>

However, it seems that code would be invalid microdata. Any help would be appreciated.

1
  • Interesting thought!! That is not the intent of the schema.org mark-up which can be quite limited. I wonder why on-one has ever thought of using that way before?? It is the first time it has been suggested that I have seen. I am not sure if it would not be misleading though. Not meaning that is your intent of course, but a by product.
    – closetnoc
    Commented Dec 23, 2015 at 4:59

2 Answers 2

2

Types and properties for hotels are proposed and will likely be part of the next Schema.org release (2.3).

In this proposal, Hotel¹ can have the property starRating¹:

An official rating for the lodging business, e.g. from national associations or standards bodies. Use the name property of a PropertyValue for indicating the type of the rating (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).

You can see some more documentation about it under the "Star Rating" section.


¹ Don’t use this URI for your data, it’s just a snapshot of the current proposal, used for review, discussion etc. Related issue: Stars for Hotel/LodgingBusiness

1

Traditional hotel star ratings are not based on reviews and would not be appropriate to use the aggregateRating. Instead the stars are an award and if you wish to represent them in schema.org you should do it like this:

Rated <span itemprop="award">★★★★☆</span> by the Hotelstars Union.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.