2017-03-05 206 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

相關問題