大网数据广告活动
网站运营与故障问答

Nesting Product in AggregateRating

· 52CE 我爱测

Our site is a review site, not a shop. We have 'product description' pages that list product information with a bunch of user reviews. At the top you can see the product, its price, and the aggregate score. I think this page is f…

问题原文

原帖链接 · Daniel Thompson · CC BY-SA 3.0

Our site is a review site, not a shop. We have 'product description' pages that list product information with a bunch of user reviews. At the top you can see the product, its price, and the aggregate score.

I think this page is fundamentally an AggregateRating type, right? But it also has a bunch of data relevant to product, brand, offers, etc.

How do you think I should structure this? Here's what I was thinking for the general layout:

<li itemscope itemtype="http://schema.org/AggregateRating">
        <span itemprop="itemReviewed" itemscope itemtype="http://schema.org/Product"> 
            <img itemprop="image">  
            <b itemprop="name"></b>
            <span itemscope itemtype="http://schema.org/PriceSpecification">
                <em itemprop="price" priceCurrency="USD"></em>
            </span>
        </span> <!-- Product itemscope end -->
        <meta itemprop="bestRating" content="5"> <!-- set range of possible ratings -->
        <meta itemprop="worstRating" content="0">
        <span itemprop="ratingValue"></span>
        <span itemprop="reviewCount"></span>
    </span> 
</li>

Schema.org only shows examples of AggregateRating nested inside of other data -- is it incorrect to use it like this?

已采纳解答

原帖链接 · unor · CC BY-SA 3.0

That’s what the itemReviewed property is for, so yes, nesting it like that is fine.

Note that nesting items in other items doesn’t connect them, unless you use a property. So your PriceSpecification is standing on its own, it’s not related to the Product in any way.

If you want to provide the price(s) of a product, you have to provide Offer items (or an AggregateOffer). Use the offers property for this.

(Also, the em element can’t have a priceCurrency attribute.)

So the structure could be:

<div itemscope itemtype="http://schema.org/AggregateRating">

  <div itemprop="itemReviewed" itemscope itemtype="http://schema.org/Product">

    <div itemprop="offers" itemscope itemtype="http://schema.org/AggregateOffer"> <!-- or omit this "AggregateOffer" if you don’t want to provide e.g. a "lowPrice" -->

      <ul>
        <li itemprop="offers" itemscope itemtype="http://schema.org/Offer"></li>
        <li itemprop="offers" itemscope itemtype="http://schema.org/Offer"></li>
        <li itemprop="offers" itemscope itemtype="http://schema.org/Offer"></li>
      </ul>

    </div>

  </div>

</div>

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2017-12-21)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。