2017-06-22 4 views
1

この件に関してもう1つの同様の質問がありましたが、正解または例は受け入れられません。 この要素の形式はどのようにする必要がありますか? BreadcrumbListは文書化されており、リストは含まれていますが、SiteNavigationElementは含まれていません。JSON-LD構造化データとしてのSchema 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> 

UPDATE:

が遊んでてきと働く何かが出ています。しかし、それは正しい構造ですか?

<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> 
+0

上記の質問にリンクすると便利です。 JSON-LDを使用してSiteNavigationElementを作成する方法は?*](https://stackoverflow.com/q/37813757/1591669)でしたか? – unor

答えて

2

私はあなたのSiteNavigationElementsがItemListsに含まれているか、単に個別の項目として含まれるべきであると思うだろう。

は、例えばリストの一部として:

<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> 

はしかし、という理由だけであなたはこれは、あなたがしなければならないという意味ではありません行うことができます。 this relevant answerをチェックしてください。

あなたのSiteNavigationElementのURLは、通常は存在しない現在のページ(リンク先のページではなく)の要素自体のものでなければならないと思います。

関連する問題