如何为 LocalBusiness 指定多个 areaServed例如多个自治市?

问题描述

许多企业为多个城市服务。

这应该如何在 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"]
  }
  }

要使用替代方法,只需将名称更改为输入即可。

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...