2017-03-05 176 views
0

我试图使用结构化数据来指定多个组织(请参见下文)。但Google的结构化数据测试工具只能识别每种类型的第一项。在Schema.org中使用多个相同类型的项目JSON-LD

我如何可以列出多个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> 
+0

@理查德瓦利斯在这里就此主题发表了博文:http://dataliberate.com/2015/04/15/the-role-of-role-in-schema-org/ –

回答

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

+0

我会在今天验证测试并标记在当时是正确的。谢谢!太简单! – s2t2

相关问题