【发布时间】:2020-01-31 22:32:39
【问题描述】:
我们正在为一个单页网站处理 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>
我的问题是关于服务“提供者”部分。在本节中,我必须重复第一个脚本中“localbusiness”@type 的大量数据。
如果我在“服务”脚本中重复数据(就 Google 而言),是否需要同时拥有“本地业务”(第一个脚本)?
我可以改为删除第一个脚本并将所有这些信息放入服务之一吗? Google 在查找有关企业本身的结构化数据时,是否能够从那里获取和使用本地企业数据?
此外,当我开始添加评论数据时,我需要再次将 localbusiness 包含为“itemreviewed”属性,这意味着我将再次重复所有内容!我基本上会为每条评论重复“本地业务”数据。这真的开始看起来有点垃圾了。
谁能帮助阐明 Google 如何查看这些数据以及应该有多少数据或重复多少数据?
【问题讨论】:
-
关于您的代码的注意事项:Schema.org 术语区分大小写(即,它必须是
LocalBusiness而不是localbusiness)。 -
谢谢 unor - 我不知道这个!我在这里修改了代码。
标签: html json schema google-rich-snippets structured-data