Google现在支持Schema.org BreadcrumbList的新版本吗? [英] Google now supporting new version of Schema.org BreadcrumbList?

查看:276
本文介绍了Google现在支持Schema.org BreadcrumbList的新版本吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎Google现在已实现Schema.org版本2,而Google自己的示例未通过Google的验证测试。例如,这是 Google的面包屑示例JSON-LD代码

It appears as though Google has now implemented Schema.org version 2 and Google's own examples fail Google's validation test. For example, here's is Google's example JSON-LD code for breadcrumbs:

<script type="application/ld+json">
{
    "@context": "http://schema.org",
    "@type": "BreadcrumbList",
    "itemListElement": [
        {
            "@type": "ListItem",
            "position": 1,
            "item": {
                "@id": "https://example.com/arts",
                "name": "Arts"
            }
        },
        {
            "@type": "ListItem",
            "position": 2,
            "item": {
                "@id": "https://example.com/arts/books",
                "name": "Books"
            }
        },
        {
            "@type": "ListItem",
            "position": 3,
            "item": {
                "@id": "https://example.com/arts/books/poetry",
                "name": "Poetry"
            }
        }
    ]
}
</script>

昨天,当我将上述代码粘贴到 test.html 文件, Google的验证工具将其验证为通过。

Yesterday, when I pasted the above code into a test.html file, Google's validation tool validated it as a "Pass".

今天,它失败了。看来您现在必须显式定义 mainEntity 。但是他们没有费心去更新文档。

Today, it fails. It appears that you now have to explicitly define a mainEntity. But they haven't bothered to update their docs.

有人知道在哪里可以找到使用JSON-LD的官方文档吗? Schema.org提供的功能不多,而且似乎也已过时。我设法获得以下代码通过测试:

Does anyone know where to find the official documentation on using JSON-LD? Schema.org doesn't offer much and appears to also be out-dated. I managed to get the following code to pass the test:

<script type="application/ld+json">
{
    "@context": "http://schema.org",
    "@type": "WebPage",
    "mainEntity": {
        "@context": "http://schema.org",
        "@type": "BreadcrumbList",
        "itemListElement": [
            {
                "@type": "ListItem",
                "position": 1,
                "item": {
                    "@id": "http://www.example.com",
                    "name": "Home"
                }
            },
            {
                "@type": "ListItem",
                "position": 2,
                "item": {
                    "@id": "http://www.example.com/shop.com",
                    "name": "Shop"
                }
            }
        ]
    }
}
</script>

我担心的是:

假设您还使用微数据在同一页面上定义了产品,搜索引擎会将面包屑列表视为 mainEntity 吗?即,它在搜索结果中的排名会比产品高吗?

Let's say you also define a product on the same page, using microdata, will the search engines treat the breadcrumb list as the mainEntity? i.e. Will it rank higher in search results, than the product will?

推荐答案

您必须分开关注点:

  • Schema.org is a vocabulary.
  • JSON-LD is a syntax.
  • Google is a consumer that supports structured data that


  • 是在JSON-LD语法中提供的,而

  • 使用了Schema.org词汇。

Schema.org不能过时:它们当然是它们自己的类型/属性的规范来源。如果不赞成使用某些类型/属性,它们通常会一直是词汇表的一部分。

Schema.org can’t be "out-dated": they are of course the canonical source of their own types/properties. If some of their types/properties get deprecated, they typically keep being part of the vocabulary.

有关使用JSON-LD的官方文档是W3C建议书(链接

The "official documentation on using JSON-LD" is the W3C Recommendation (linked above).

如果我正确理解了您的问题,那么您的问题出在Google:他们的文档与他们的测试工具。 他们记录表明他们支持 Schema.org的 BreadcrumbList 类型,但其测试工具无法识别此类型:

If I understand your issue correctly, your problem is with Google: their documentation vs. their testing tool. They document that they support Schema.org’s BreadcrumbList type, but their testing tool doesn’t recognize this type:


属性 itemtype 的值无效。

(尽管此错误消息指的是 itemtype,这是一个微数据属性,无论您测试哪种受支持的语法,它都会出现。)

(Although this error message refers to "itemtype", which is a Microdata attribute, it comes up no matter which supported syntax you test.)

您无能为力。第一个片段是有效的JSON-LD,并且是Schema.org词汇的适当用法。 Google甚至以这种方式进行记录的事实使得他们的测试工具目前似乎有漏洞(之前发生过几次)。

There is nothing you can do about it. The first snippet is valid JSON-LD and it’s an appropriate use of the Schema.org vocabulary. The fact that Google even documents it that way makes it seem likely that their testing tool is bugged currently (which happened several times before).

关于第二个代码段:使用 mainEntity 可能不是您想要传达的。您是说面包屑将成为网页的主要实体,但这并不常见。通常,主要实体是 Article 等。

About your second snippet: using mainEntity that way is probably not what you want to convey. You are saying that the breadcrumbs would be the main entity of the web page, but that would be very uncommon. Typically the main entity is an Article etc.

这篇关于Google现在支持Schema.org BreadcrumbList的新版本吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆