I want to tie together two kinds of structured data: WebPage
, which is JSON-LD, and BreadcrumbList
, which is inline microdata.
The topic is not a duplicate! I've seen many similar answered questions at SO about the subject - but i tested everyone with Google Structured Data Test tool, and no single answer was validely tested.
The code example is:
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Webpage",
"id": "https://www.example.com#Webpage",
"breadcrumb": {
"@type": "BreadcrumbList",
"@id": "https://www.example.com#BreadcrumbList"
}
}
</script>
<nav class="breadcrumbs">
<ol itemscope itemtype="http://schema.org/BreadcrumbList" itemid="https://www.example.com#BreadcrumbList">
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<a itemprop="item" rel="up up up" title="a" href="/a/">
<span itemprop="name">a</span></a>
<meta itemprop="position" content="1" /></li>
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<a itemprop="item" rel="up up" title="b" href="/b/">
<span itemprop="name">b</span></a>
<meta itemprop="position" content="2" /></li>
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<a itemprop="item" rel="up" title="c" href="/c/">
<span itemprop="name">c</span></a>
<meta itemprop="position" content="3" /></li>
</ol>
</nav>
As i said, WebPage
is the main data type in JSON-LD snippet. It has the secondary data type BreadcrumbList
, which has an id. The BreadcrumbList
inside microdata relates with itemid to the same from JSON-LD - i expect, that the test tool shows the relation between the BredcrumbList
from JSON-LD and those from microdata. But no: the test tool displays them as different, and triggers an error at JSON-LD snippet because it hasn't required ItemList
.
Is it a bug of the test tool or do i missing something substantial?
PS: The same construction, build only on JSON-LD is validated as expected:
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Webpage",
"id": "https://www.example.com#Webpage",
"breadcrumb": {
"@type": "BreadcrumbList",
"@id": "https://www.example.com#BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"id": "https://www.example.com#ListItem"
}
]
}
}
</script>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "ListItem",
"id": "https://www.example.com#ListItem",
"position": "1",
"item": {
"@id": "https://www.example.com/item1",
"name": "name1"
}
}
}
</script>