在Schema.org JSON-LD中使用多个相同类型的项目

时间:2017-03-05 03:04:16

标签: seo schema.org json-ld

我正在尝试使用结构化数据来指定多个组织(请参阅下文)。但Google的结构化数据测试工具只能识别每种类型的第一项。

如何列出多个alumniOf项?

<script type="application/ld+json">
  {
    "@context": "http://schema.org",
    "@type": "Organization",
    "name": "My Org",
    "founder": {
      "@type": "Person",
      "name":"Me",
      "alumniOf":{
        "@type": "Organization",
        "name": "My Org 1"
      },
      "alumniOf":{
        "@type": "Organization",
        "name": "My Org 2"
      }

  }
</script>

1 个答案:

答案 0 :(得分:4)

您只需将这些项目放在一起就可以列出多个alumniOf项目:

<script type="application/ld+json">
{
    "@context": "http://schema.org",
    "@type": "Organization",
    "name": "My Org",
    "founder": {
        "@type": "Person",
        "name":"Me",
        "alumniOf": [
            {
                "@type": "Organization",
                "name": "My Org 1"
            },
            {
                "@type": "Organization",
                "name": "My Org 2"
            }
        ]
    }
}
</script>

在这里测试过。 https://search.google.com/structured-data/testing-tool