要指定多个顶级项目,您可以使用三个选项:
数组
<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "Organization" }, { "@context": "http://schema.org", "@type": "BreadcrumbList" }]</script>缺点:您必须
@context为每个项目重复此操作。
@graph
<script type="application/ld+json">{ "@context": "http://schema.org", "@graph": [ { "@type": "Organization" }, { "@type": "BreadcrumbList" } ]}</script>多个script
要素
<script type="application/ld+json">{ "@context": "http://schema.org", "@type": "Organization"}</script><script type="application/ld+json">{ "@context": "http://schema.org", "@type": "BreadcrumbList"}</script>缺点:您必须为每个项目重复
script元素和
@context。
但是通常最好只提供一个顶级项,并将其他项嵌套在适当的属性下。不过,这并非在所有情况下都可行。
在您的情况下,似乎可以通过添加
WebPage项目来实现,假设它是组织的页面,并且此页面具有以下面包屑列表:
<script type="application/ld+json">{ "@context": "http://schema.org", "@type": "WebPage", "provider": { "@type": "Organization" }, "breadcrumb": { "@type": "BreadcrumbList" }}</script>(您可以在不嵌套的情况下实现相同效果:使用,为每个项目提供一个URI
@id,然后将这些URI作为属性值引用。)



