架构:在列出嵌套对象时是否有必要(甚至可取)重复结构化数据?

Schema: Is it necessary (or even advisable) to repeat structured data when listing nested objects?

我们正在处理一个单页网站的 JSON 结构化数据。这个单一页面提供了大量关于本地企业的数据(包括地址、定价、评论、服务等)。 我们将其作为业务本身结构化数据的 json:

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "LocalBusiness",
  "name": "Example Business",
  "url": "https://www.example.com/",
  "logo": "https://www.example.com/logo.jpg",
  "areaServed": {
    "@type": "City",
    "name": "New York"
  },
  "image": "https://www.example.com/image.jpg",
  "description": "Good description of example business",
  "telephone": "+123456789",
  "priceRange": "$$$",
  "address": {
    "@type": "PostalAddress",
    "streetAddress": "101 Main Road",
    "addressLocality": "Hereabouts",
    "addressRegion": "New York",
    "postalCode": "AB123456",
    "addressCountry": "US"
  },
  "aggregateRating": {
   "@type": "AggregateRating",
     "ratingValue": "4.95",
     "reviewCount": "100"
  },
  "openingHoursSpecification": [
  {
    "@type": "OpeningHoursSpecification",
    "dayOfWeek": [
      "Monday",
      "Tuesday",
      "Wednesday",
      "Thursday",
      "Friday"
    ],
    "opens": "09:00",
    "closes": "17:00"
  }
  ],
  "contactPoint": {
    "@type": "ContactPoint",
    "telephone": "+123456789",
    "contactType": "Sales"
  }
}
</script>

我们还想为页面上提供和列出的服务添加结构化数据:

<script type='application/ld+json'> 
  {
  "@context": "https://www.schema.org",
  "@type": "Service",
  "serviceType": "The Main Services",
  "provider": {
  "@type": "LocalBusiness",
  "name": "Example Business",
  "url": "https://www.example.com/",
  "logo": "https://www.example.com/logo.jpg",
  "areaServed": {
    "@type": "City",
    "name": "New York"
  },
  "image": "https://www.example.com/image.jpg",
  "description": "Good description of example business",
  "telephone": "+123456789",
  "priceRange": "$$$",
  "address": {
    "@type": "PostalAddress",
    "streetAddress": "101 Main Road",
    "addressLocality": "Hereabouts",
    "addressRegion": "New York",
    "postalCode": "AB123456",
    "addressCountry": "US"
  },
  "hasOfferCatalog": {
    "@type": "OfferCatalog",
    "name": "The Main Services",
    "itemListElement": [
      {
        "@type": "OfferCatalog",
        "name": "First Main Services",
        "itemListElement": [
          {
            "@type": "Offer",
            "itemOffered": {
              "@type": "Service",
              "name": "Service 1A",
     "url": "https://www.example.com/service1A"
            }
          },
          {
            "@type": "Offer",
            "itemOffered": {
              "@type": "Service",
              "name": "Service 1B",
     "url": "https://www.example.com/service1B"
            }
          },
          {
            "@type": "Offer",
            "itemOffered": {
              "@type": "Service",
              "name": "Service 1C",
     "url": "https://www.example.com/service1C"
            }
          }
        ]
 },
    {
        "@type": "OfferCatalog",
        "name": "Second Main Services",
        "itemListElement": [
          {
            "@type": "Offer",
            "itemOffered": {
              "@type": "Service",
              "name": "Service 2A",
     "url": "https://www.example.com/service2A"
            }
          },
          {
            "@type": "Offer",
            "itemOffered": {
              "@type": "Service",
              "name": "Service 2B",
     "url": "https://www.example.com/service2B"
            }
          },
          {
            "@type": "Offer",
            "itemOffered": {
              "@type": "Service",
              "name": " 2C",
     "url": "https://www.example.com/service2C"
            }
          }
        ]}
    ]
  }
}
}
 </script>

我的问题是关于服务 "provider" 部分的。在本节中,我不得不重复第一个脚本中 "localbusiness" @type 的大量数据。

如果我要在 "service" 脚本中重复数据(就 Google 而言),是否有必要同时使用 "localbusiness"(第一个脚本)?

我能否改为删除第一个脚本并将所有信息放入服务脚本中? Google 在寻找有关业务本身的结构化数据时,是否能够从那里获取和使用本地业务数据?

此外,当我开始添加评论数据时,我将需要再次将 localbusiness 添加为 "itemreviewed" 属性,这意味着我将再次重复所有内容!我基本上会为每条评论重复 "localbusiness" 数据。这真的开始看起来有点垃圾。

任何人都可以帮助阐明 Google 如何查看此数据以及应该有多少数据或重复多少数据?

您可以详细说明一个实体并包含一个@id。

然后您可以在引用同一实体的地方引用该@id。这使您不必重复所有数据,节省 space,并有助于澄清所有地方都在谈论同一件事。

例如

"provider": {
  "@type": "LocalBusiness",
  "@id": "https://example.com/#LocalBusiness"
}