架构SiteNavigationElement作为JSON-LD结构化数据

架构SiteNavigationElement作为JSON-LD结构化数据,navigation,schema.org,json-ld,structured-data,Navigation,Schema.org,Json Ld,Structured Data,在这个问题上,我见过另一个类似的问题,但没有公认的正确答案或例子。 此元素的格式应该是什么? 面包屑列表有很好的文档记录,包含列表,但不包含SiteNavigationElement <script type="application/ld+json"> { "@context": "https://schema.org", "@type": "SiteNavigationElement", "@graph": [ {

在这个问题上,我见过另一个类似的问题,但没有公认的正确答案或例子。 此元素的格式应该是什么? 面包屑列表有很好的文档记录,包含列表,但不包含SiteNavigationElement

    <script type="application/ld+json">
    {
    "@context": "https://schema.org",
    "@type": "SiteNavigationElement",
    "@graph": [
        {
        "@type": "ListItem",
        "position": 1,
        "item": {
            "@id": "http://www.example.com/",
            "url": "http://www.example.com/",
            "name": "Home"
            }
        },
        {
        "@type": "ListItem",
        "position": 2,
        "item": {
            "@id": "http://www.example.com/contact.html",
            "url": "http://www.example.com/contact.html",
            "name": "Contact"
            }
        },
    ]
    }
    </script>

{
“@context”:”https://schema.org",
“@type”:“SiteNavigationElement”,
“@graph”:[
{
“@type”:“ListItem”,
"立场":一,,
“项目”:{
“@id”:”http://www.example.com/",
“url”:”http://www.example.com/",
“姓名”:“家”
}
},
{
“@type”:“ListItem”,
"立场":二,,
“项目”:{
“@id”:”http://www.example.com/contact.html",
“url”:”http://www.example.com/contact.html",
“姓名”:“联系人”
}
},
]
}
更新:

我一直在胡闹,想出了一些有效的办法。但它的结构正确吗

<script type="application/ld+json">
//<![CDATA[
{
"@context": "https:\/\/schema.org\/",
"@type": "SiteNavigationElement",
"headline": "Headline for Site Navigation",
"name": [
    "Home",
    "Tours",
    "Transfers",
    "Taxis",
    "Contact"
    ],
"description": [
    "Homes Desc.",
    "Tours Desc.",
    "Transfers Desc.",
    "Taxis Desc.",
    "Contact Desc."
    ],
"url": [
    "http://www.example.com/",
    "http://www.example.com/tours/",
    "http://www.example.com/transfers/",
    "http://www.example.com/taxis/",
    "http://www.example.com/contact.html"
    ]
}
//]]>
</script>

//

我认为您的SiteNavigationElements应该包含在中,或者只是作为单独的项目包含

例如,作为列表的一部分:

<script type="application/ld+json">
{
  "@context":"http://schema.org",
  "@type":"ItemList",
  "itemListElement":[
    {
      "@type":"SiteNavigationElement",
      "position":1,
      "name": "Home",
      "description": "Homes Desc.",
      "url":"http://www.example.com/"
    },
    {
      "@type":"SiteNavigationElement",
      "position":2,
      "name": "Tours",
      "description": "Tours desc.",
      "url":"http://www.example.com/tours/"
    },

    ...etc

  ]
}
</script>

{
“@context”:”http://schema.org",
“@type”:“ItemList”,
“itemListElement”:[
{
“@type”:“SiteNavigationElement”,
"立场":一,,
“姓名”:“家”,
“说明”:“住宅说明”,
“url”:”http://www.example.com/"
},
{
“@type”:“SiteNavigationElement”,
"立场":二,,
“姓名”:“旅行团”,
“说明”:“旅游说明”,
“url”:”http://www.example.com/tours/"
},
等
]
}
然而,仅仅因为你能做到这一点并不意味着你应该这样做。退房


我认为您的SiteNavigationElement URL应该用于当前页面上的元素本身(与它们链接到的页面相反),而这些元素通常不存在。

链接上述问题会很有用。是吗?这不可能是正确的,因为页面上的“ItemList”不应该超过1个,因此将其放在导航上会阻止它出现在其他任何地方。