问题描述
许多企业为多个城市服务。
这应该如何在 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"
},"name": "Syracuse"
},
或者类似的东西:
"areaServed": {
"@type": "City","name": "New York","name": "buffalo",
或者别的什么?
解决方法
根据架构文档,属性 areaServed 可以具有以下类型之一的值:
- 行政区域
- 地理形状
- 地点
- 文字
这里没有您在示例中指出的类型 City。所以我使用了 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"]
}
}
要使用替代方法,只需将名称更改为输入即可。