【问题标题】:Implement structured schema in HTML website在 HTML 网站中实现结构化架构
【发布时间】:2020-03-15 22:03:51
【问题描述】:

我正在为我的网站实施结构化数据 (schema.org)。

我一直在输入ratingValuereviewCount,其他我可以动态输入的东西。

"review": [
    {
        "@type": "Review",
        "reviewRating":{
            "@type": "Rating",
            "ratingValue": "4",
            "bestRating": "5"
        },
        "author":{
            "@type": "Organization",
            "name": "xyz"
        }
    }
],
"aggregateRating": 
{
    "@type": "AggregateRating",
    "ratingValue": "3.7",
    "reviewCount": "15"
}

我可以将reviewCountratingValue 放在哪里? 我们不要求我们的客户提供任何评论/评分

【问题讨论】:

  • 您能否提供一个更完整的示例。 aggregateRating 不应位于 review 属性内,而应直接位于正在审查的项目内。您的评论属性应包含一系列评论项目。例如[{...},{...},{...}]
  • 是的,但我的问题是获得评级值,因为我们没有维护任何审查系统。我还看到许多没有评论系统的网站,但它们在架构中显示评级值。
  • 用户如何添加评分?
  • 用户不提供任何评分。因此,在这种情况下,我们如何获得评分值。有许多网站没有评论系统,但在架构中它们显示评级。是否有任何第三方 api 可用或从哪里以及如何获得此评论计数
  • 那些关于你的东西的评分必须由用户从某个地方提交?

标签: schema.org json-ld


【解决方案1】:

我认为在您的情况下使用 AggregateRating 没有意义,因为(假定的)网站作者只有一个评论。 “聚合”基本上是指“集合的摘要”,所以使用 AggregateRating 表示您有或可能有多个评论 - 而不仅仅是一个评论。

假设这是Product,我会改用这个标记:

{
    "@context": "https://schema.org/",
    "@type": "Product",
    "name": "Some Product",
    "description": "This is some product",
    "review": {
        "@type": "Review",
        "author": {
            "@type": "Organization",
            "name": "xyz"
        },
        "reviewRating": {
            "@type": "Rating",
            "bestRating": "5",
            "ratingValue": "4",
            "worstRating": "1"
        }
    }
}

Structured Data Testing Tool 中的AggregateRating 是推荐的,但不是必需的。

如果由于某种原因您必须在此项目中使用AggregateRating,那么您可以将reviewCount 硬编码为1,并将ratingValue 设置为您已经拉入reviewRating 的值。不过,这又违背了AggregateRating 的目的。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-12-22
    • 2015-01-05
    • 2020-08-02
    • 1970-01-01
    • 2023-03-19
    • 2012-01-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多