如何为 LocalBusiness 指定多个 areaServed(例如多个城市)?
How to specify more than one areaServed (eg multiple municipalities) for a LocalBusiness?
很多企业服务于多个城市。
在https://schema.org/areaServed(JSON LD)中应该如何表达?
例如 https://schema.org/Service:
<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "Service",
"serviceType": "Weekly home cleaning",
"provider": {
"@type": "LocalBusiness",
"name": "ACME Home Cleaning"
},
"areaServed": {
"@type": "City",
"name": "New York"
},
... ?
</script>
应该是:
"areaServed": {
"@type": "City",
"name": "New York"
},
"areaServed": {
"@type": "City",
"name": "Buffalo"
},
"areaServed": {
"@type": "City",
"name": "Syracuse"
},
或类似的东西:
"areaServed": {
"@type": "City",
"name": "New York",
"name": "Buffalo",
"name": "Syracuse"
},
还是别的?
根据 Schema 文档,属性 areaServed 可以具有以下类型之一的值:
- AdministrativeArea
- GeoShape
- Place
- Text
这里没有您在示例中指出的城市类型。所以我使用 Place 类型作为我对你的建议(替代方案是 AdministrativeArea 类型):
{
"@context": "https://schema.org/",
"@type": "Service",
"serviceType": "Weekly home cleaning",
"provider": {
"@type": "LocalBusiness",
"name": "ACME Home Cleaning"
},
"areaServed": {
"@type": "Place",
"name":[ "New York","Buffalo"]
}
}
要使用替代方法,只需将名称更改为 type。
根据 schema.org 文档,城市是“AdministrativeArea”的“更具体类型”,因此使用它没有错。
(不幸的是,没有足够的积分将其写为 nikant25s 评论下的评论,但认为提及这一点很重要)
我会这样写:
"areaServed": [{
"@type": "City",
"name": “New York”,
"sameAs": "https://en.wikipedia.org/wiki/New_York_City"
},
{
"@type": "City",
"name": “Buffalo”,
"sameAs": (the Wiki-page for the right Buffalo)
}],
因为有很多同名的城市,所以最好使用 sameAs 属性 来指定您指的是哪一个 :)
很多企业服务于多个城市。
在https://schema.org/areaServed(JSON LD)中应该如何表达?
例如 https://schema.org/Service:
<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "Service",
"serviceType": "Weekly home cleaning",
"provider": {
"@type": "LocalBusiness",
"name": "ACME Home Cleaning"
},
"areaServed": {
"@type": "City",
"name": "New York"
},
... ?
</script>
应该是:
"areaServed": {
"@type": "City",
"name": "New York"
},
"areaServed": {
"@type": "City",
"name": "Buffalo"
},
"areaServed": {
"@type": "City",
"name": "Syracuse"
},
或类似的东西:
"areaServed": {
"@type": "City",
"name": "New York",
"name": "Buffalo",
"name": "Syracuse"
},
还是别的?
根据 Schema 文档,属性 areaServed 可以具有以下类型之一的值:
- AdministrativeArea
- GeoShape
- Place
- Text
这里没有您在示例中指出的城市类型。所以我使用 Place 类型作为我对你的建议(替代方案是 AdministrativeArea 类型):
{
"@context": "https://schema.org/",
"@type": "Service",
"serviceType": "Weekly home cleaning",
"provider": {
"@type": "LocalBusiness",
"name": "ACME Home Cleaning"
},
"areaServed": {
"@type": "Place",
"name":[ "New York","Buffalo"]
}
}
要使用替代方法,只需将名称更改为 type。
根据 schema.org 文档,城市是“AdministrativeArea”的“更具体类型”,因此使用它没有错。
(不幸的是,没有足够的积分将其写为 nikant25s 评论下的评论,但认为提及这一点很重要)
我会这样写:
"areaServed": [{
"@type": "City",
"name": “New York”,
"sameAs": "https://en.wikipedia.org/wiki/New_York_City"
},
{
"@type": "City",
"name": “Buffalo”,
"sameAs": (the Wiki-page for the right Buffalo)
}],
因为有很多同名的城市,所以最好使用 sameAs 属性 来指定您指的是哪一个 :)