1

I have a Brand and a Product, I am associating the Product to the Brand like this:

<h1 itemprop="brand" itemscope itemtype="http://schema.org/Brand" id="v1437">
   <span itemprop="name">MyBrand</span>
   <link itemprop="url" href="http://www.example.com/MyBrand"/>
   <link itemprop="logo" href="http://www.example.com/MyBrand/logo.png"/>
</h1>

<div itemscope itemtype="http://schema.org/Product" itemref="v1437">
   <span itemprop="name">MyProduct</span>
</div>

I would like to create an AggregateRating associated to the Brand, like the following:

<div itemprop="aggregateRating" itemscope
     itemtype="http://schema.org/AggregateRating"
     itemref="v1437">
  <meta itemprop="ratingValue" content="4.24"/>
  <meta itemprop="ratingCount" content="17"/>
</div>

The AggregateRating needs an itemReviewed field, pointing to the Brand, I can add an itemReviewed attribute inside my Brand:

<h1 itemprop="brand itemReviewed" itemscope 
    itemtype="http://schema.org/Brand" id="v1437">

But the validator displays some conflicts:

1 error for Product, 1 error for AggregateRating

Is there another way to achieve this without having to duplicate the Brand?

EDIT: Referring to Evgeniy's answer, I can't embed an item into another, itemref seems to be the only option available.

2

This code will do the job, and is errorfree validated:

<div itemscope itemtype="http://schema.org/Product"
     itemref="v1437">
<span itemprop="name">MyProduct</span>
</div>

<div itemprop="brand" itemscope itemtype="http://schema.org/Brand"
     id="v1437" itemref="p1437">
<h1 itemprop="name">MyBrand</h1>
<link itemprop="url" href="http://www.example.com/MyBrand"/>
<link itemprop="logo" href="http://www.example.com/MyBrand/logo.png"/>
</div>

<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"
     id="p1437">
<meta itemprop="ratingValue" content="4.24"/>
<meta itemprop="ratingCount" content="17"/>
</div>
  • 1
    Thanks, it's working indeed. However, I must admit that I wasn't explicit enough, I forgot to tell that I can't embed an item into another, itemref is the only option available afaik. – Axel Isouard Sep 15 '15 at 13:49
  • 1
    i thought firstly about embedding/nesting of items one into another, like product->brand->aggregateRating. It works like a charm too. But i f you can't nest them because of layout issues, then itemref does the rest. – Evgeniy Sep 15 '15 at 14:02
  • A good way to achieve this was indeed organizing items differently. Thanks again ! – Axel Isouard Sep 15 '15 at 15:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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