Search code examples
schema.orgrich-snippetsgoogle-rich-snippets

schema.org markup and nesting for Review of "ApartmentComplex"


I have some structured data implemented in my website using microdata so that Google and other search engines could parse it and show appropriate rich snippets. I have added the appropriate markup for all the microdata tags that I have used but I am unable to view the rich snippets for my website while testing it using the Rich Snippets Testing Tool. I have gone through the usage guidelines and frequent issues section at the Google Webmaster but to no avail.

Upon debugging the html I found that the following snippet was successfully showing rich snippets when fed to the Rich Snippets Testing Tool.

  <div class="row">
                <div class="col-sm-12">
                    <div class="page-header">
                        <h1><span itemprop="name">T Park </span></h1>
                                <div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress" class="address">
                                <span itemprop="streetAddress">1 Scenic Park</span>
                                <span itemprop="postalCode" class="hidden">123456</span>
                                <span itemprop="addressRegion" class="hidden">Central </span>
                                <span itemprop="addressCountry" class="hidden">Singapore</span>
                    </div>
                </div>
            </div>
        </div>
            <div class="col-sm-6 box-map">
                <h2>Location</h2>
            </div>
        <div style="margin-bottom:0px;" itemprop="review" itemscope itemtype="http://schema.org/Review" class="jumbotron row">
            <h2>T Park Reviews</h2>
            <br>
            <meta itemprop="itemReviewed" content="T Park">
            <div id="reviews" itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating">
                <meta itemprop="worstRating" content="1">
                <meta itemprop="ratingValue" content="9">
                <meta itemprop="bestRating" content="10"><span>Rating: 9/10</span>
            </div>
            <br><span itemprop="reviewBody">Lorem Ipsum....</span>
            <br><strong itemprop="author" class="row pull-right">John May</strong>
        </div>

However as soon as an enclosing markup of ApartmentComplex is added as shown in the snippet below, the rich snippet is not visible.

<div itemscope itemtype="http://schema.org/ApartmentComplex" class="container">
    <div class="row">
        <div class="col-sm-12">
            <div class="page-header">
                <h1><span itemprop="name">T Park </span></h1>
                    <div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress" class="address">
                    <span itemprop="streetAddress">1 Scenic Park</span>
                    <span itemprop="postalCode" class="hidden">123456</span>
                    <span itemprop="addressRegion" class="hidden">Central</span>
                    <span itemprop="addressCountry" class="hidden">Singapore</span>
            </div>
        </div>
    </div>
    </div>
    <div style="margin-bottom:0px;" itemprop="review" itemscope itemtype="http://schema.org/Review" class="jumbotron row">
        <h2>T Park Reviews</h2>
        <br>
        <meta itemprop="itemReviewed" content="T Park">
        <div id="reviews" itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating">
            <meta itemprop="worstRating" content="1">
            <meta itemprop="ratingValue" content="9">
            <meta itemprop="bestRating" content="10"><span>Rating: 9/10</span>
        </div>
        <br><span itemprop="reviewBody">Lorem Ipsum....</span>
        <br><strong itemprop="author" class="row pull-right">John May</strong>
    </div>
</div>

So assuming my page is about ApartmentComplex, and I want to include a Review of it, how should I structure/nest this markup?


Solution

  • I don't think there's anything wrong with your mark-up or Microdata. I just don't think that the Google Structured Data tool shows any rich snippets for http://schema.org/ApartmentComplex types - rich snippets are only available for certain schema.org types.

    To prove this, change the wrapping ApartmentComplex type to a Product type, and remove the address (which isn't part of "Product") and you'll see that a rich snippet is produced in the Google Structured Data Testing Tool (because Google do show rich snippets for Products).

    Edit to add: this is a possible workaround - Google will show rich snippets for schema.org types where the surrounding type is a Review, so you could use Review as the top-level type, then have the ApartmentComplex type as the "itemReviewed" property - this works in the Google Structured Data Testing Tool:

    <div itemscope itemtype="http://schema.org/Review" class="container">
      <div class="row" itemprop="itemReviewed" itemscope itemtype="http://schema.org/ApartmentComplex">
        <div class="col-sm-12">
          <div class="page-header">
        <h1><span itemprop="name">T Park </span></h1>
        <div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress" class="address">
          <span itemprop="streetAddress">1 Scenic Park</span>
          <span itemprop="postalCode" class="hidden">123456</span>
          <span itemprop="addressRegion" class="hidden">Central</span>
          <span itemprop="addressCountry" class="hidden">Singapore</span>
        </div>
          </div>
        </div>
      </div>
      <div style="margin-bottom:0px;" class="jumbotron row">
        <h2>T Park Reviews</h2>
        <br>
        <div id="reviews" itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating">
          <meta itemprop="worstRating" content="1">
          <meta itemprop="ratingValue" content="9">
          <meta itemprop="bestRating" content="10"><span>Rating: 9/10</span>
        </div>
        <br><span itemprop="reviewBody">Lorem Ipsum....</span>
        <br><strong itemprop="author" class="row pull-right">John May</strong>
      </div>
    </div>