如何使用 JSON-LD 正确实现多个列表的 Schema.org?

How can I correctly implement Schema.org with multiple lists using JSON-LD?

我正在将 Schema.org 结构化数据实施到我的杂志式网站中,并且对使用多个列表有一些担忧。

我的主页上有两个部分:'Most Recent' 和 'Most Popular'。这两个部分各包含五篇迷你文章。我将这两个部分都视为 'lists'。这是一个部分的示例 - 除了文章之外,另一部分是相同的,显然:

这是我的架构 JSON-LD。为了使示例易于阅读,我在 ... 处缩短了此示例,并删除了 domains/names 等。到目前为止,我只将 'Most Recent' 中的五篇文章添加到此ItemList 并使用 Google 的结构化数据测试工具对其进行测试 returns 零警告和零错误:

<script type="application/ld+json">
    {
        "@context": "http://schema.org",
        "@type": "ItemList",
        "numberOfItems": "5",
        "itemListOrder": "Descending",
        "itemListElement": [
            {
                "@type": "Article",
                "position": "1",
                "mainEntityOfPage": {
                    "@type": "WebPage",
                    "@id": "/motoring/audi-launches-2019-sq8-tdi/"
                },
                "articleSection": "Motoring",
                "headline": "Audi launches 2019 SQ8 TDI",
                "datePublished": "2019-09-01",
                "dateModified": "2019-09-01",
                "image": "/content/uploads/2019/08/2019-audi-sq8-tdi-001-800.jpg",
                "url": "/motoring/audi-launches-2019-sq8-tdi/",
                "author": "The Author",
                "publisher": {
                    "@type": "Organization",
                    "name": "Company Name",
                    "url": "https://company.name",
                    "logo": {
                        "@type": "ImageObject",
                        "url": "https://company.name/logo.png"
                    },
                    "founder": "Founder",
                    "foundingDate": "2019"
                }
            },
            {
                "@type": "Article",
                "position": "2",
                "mainEntityOfPage": {
                    "@type": "WebPage",
                    "@id": "/gadgets-tech/meet-keysmart-the-smart-key-oraganiser/"
                },
                "articleSection": "Gadgets & Tech",
                "headline": "Meet Keysmart: The smart key organiser",
                "datePublished": "2019-09-01",
                "dateModified": "2019-09-01",
                "image": "/content/uploads/2019/08/the-smartkey-orgainser-001-800.jpg",
                "url": "/gadgets-tech/meet-keysmart-the-smart-key-oraganiser/",
                "author": "The Author",
                "publisher": {
                    "@type": "Organization",
                    "name": "Company Name",
                    "url": "https://company.name",
                    "logo": {
                        "@type": "ImageObject",
                        "url": "https://company.name/logo.png"
                    },
                    "founder": "Founder",
                    "foundingDate": "2019"
                }
            },
            ...
        ]
    }
</script>

不过,如上所述,这个ItemList只针对'Most Recent'五篇文章。我现在想为另一部分添加结构化数据,'Most Popular',但不确定如何最好地处理它。

  1. 我是否将最受欢迎的五篇文章添加到相同的ItemList,我是否 创建一个新的 ItemList 还是我创建一个新的 script/JSON?怎么 这最好实现?请举个例子。
  2. 我真的需要为每篇文章添加 publisher/organization 吗? 我有或者可以以某种方式缩短它?看起来不必要的笨重 像我一样做。我读过将 'Organization' 数据添加到 每个页面都是不好的做法(请参阅下面的 link)- 这在此处适用吗?
  3. 这些迷你文章中的每一篇都指向一篇完整的文章,使用 mainEntityOfPage。我使用 type 'WebPage' 是正确的还是应该 使用类型 'Article'?
  4. 如果需要两个列表,有没有办法告诉搜索引擎 一个列表包含最近的项目,一个包含最多 流行还是不必要?

https://www.searchenginejournal.com/google-do-not-put-organization-schema-markup-on-every-page/289981/

一般使用 HTML5 语义元素(主要、部分等)+ 正确的站点大纲(每个列表的 H2 等)。

两个列表

关于您的架构。 最好的办法是从 "microdata" 的角度思考。

您的列表没有嵌套

<ul>
  <li>
    <ul><li></li></ul>
  </li>
  <li>
    <ul><li></li></ul>
  </li>
</ul>

嵌套列表示例: https://schema.org/OfferCatalog#offer-3

使用多个 json-ld 脚本

在这种情况下,我认为 best/simple 的想法是使用 两个单独的列表 "objects"(并添加 name/url/and 等等每个列表)- 示例 大纲(短代码缺少属性):

<script type="application/ld+json">
    {
        "@context": "http://schema.org",
        "@type": "ItemList",
        "name": "Recent Articles",
        "numberOfItems": "1",
        "itemListOrder": "Descending",
        "itemListElement": [
            {
                "@type": "Article",
                "position": "1",
                "headline": "I am recent Article"
            }          
        ]

    }
</script>
<script type="application/ld+json">
    {
        "@context": "http://schema.org",
        "@type": "ItemList",
        "name": "Popular Articles",
        "numberOfItems": "1",
        "itemListOrder": "Descending",
        "itemListElement": [
            {
                "@type": "Article",
                "position": "1",
                "headline": "I am Popular Article"
            }          
        ]    
    }
</script>

https://webmasters.stackexchange.com/questions/96903/can-i-have-multiple-json-ld-scripts-in-the-same-page

作为 itemref 的发布者

试试这个想法:

示例(对文章的引用组织对象):

<!-- Organization -->
<script type="application/ld+json">
{
    "@context": "http://schema.org",
    "@type": "Organization",
    "@id": "#Organization-name",
    "name": "My Organization"
}
</script>
<!-- Recent Articles -->
<script type="application/ld+json">
    {
        "@context": "http://schema.org",
        "@type": "ItemList",
        "name": "Recent Articles",
        "numberOfItems": "1",
        "itemListOrder": "Descending",
        "itemListElement": [
            {
                "@type": "Article",
                "position": "1",
                "headline": "I am recent Article",
                "publisher": {
                 "@id": "#Organization-name"
                 }
            }          
        ]
    }
</script>
<!-- Popular Articles -->
<script type="application/ld+json">
    {
        "@context": "http://schema.org",
        "@type": "ItemList",
        "name": "Popular Articles",
        "numberOfItems": "1",
        "itemListOrder": "Descending",
        "itemListElement": [
            {
                "@type": "Article",
                "position": "1",
                "headline": "I am Popular Article",
                 "publisher": {
                     "@id": "#Organization-name"
                 }
            }          
        ]    
    }
</script>

测试工具输出:

mainentityofpage

读这个: https://webmasters.stackexchange.com/questions/87940/new-required-mainentityofpage-for-article-structured-data