【问题标题】:How to specify more than one areaServed (eg multiple municipalities) for a LocalBusiness?如何为 LocalBusiness 指定多个区域服务(例如多个城市)?
【发布时间】:2021-08-08 00:15:06
【问题描述】:

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

这在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.org json-ld structured-data


    【解决方案1】:

    根据 Schema 文档,属性 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"]
      }
      }

    要使用替代方法,只需将名称更改为 type。

    【讨论】:

      【解决方案2】:

      根据 schema.org 文档,City 是“AdministrativeArea”的“更具体的类型”,所以使用它没有错。

      (不幸的是,在 nikant25 的评论下没有足够的分数来写这个作为评论,但认为这很重要)


      我会这样写:

      "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 属性来指定您的意思:)

      【讨论】:

      • 您好,感谢您的回答!那么在这种情况下,您推荐什么实际的“语法”?我应该补充“city”来代替 nikant25 使用“areaServed”的地方,还是可以看看我在我的问题中提出的语法?再次感谢。 =)
      • 更新了我的答案,因为格式在 cmets 中很麻烦,呵呵。
      • 谢谢,这完全有道理!
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-06-14
      • 2023-02-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-12
      • 1970-01-01
      • 2020-05-30
      相关资源
      最近更新 更多