JSON-LD Schema.org: Multiple video/image page

青春壹個敷衍的年華 提交于 2019-11-26 08:49:10
unor

If you have multiple items as value of a property, you could use an array:

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "WebPage",
  "video":
  [
    {
      "@type": "VideoObject"
    },
    {
      "@type": "VideoObject"
    }
  ]
}
</script>

If you have multiple items on the top-level (not as value of a property), you could use a (named) graph and an array:

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@graph": 
  [
    {
       "@type": "VideoObject"
    },
    {
       "@type": "VideoObject"
    }
  ]
}
</script>

And you could of course use multiple script elements:

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "WebPage",
  "video": 
  {
    "@type": "VideoObject"
  }
}
</script>

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "WebPage",
  "video": 
  {
    "@type": "VideoObject"
  }
}
</script>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!