In SEO terms...
Is it best to put the scheme on the parent containing all the links?
<nav itemscope="itemscope" itemtype="http://www.schema.org/SiteNavigationElement">
<a href="#">Link 1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>
</nav>
...or should each link be considered as it's own element?
<nav>
<span itemscope="itemscope" itemtype="http://www.schema.org/SiteNavigationElement">
<a itemprop="url" href="#">
<span itemprop="name">Link 1</span>
</a>
</span>
<span itemscope="itemscope" itemtype="http://www.schema.org/SiteNavigationElement">
<a itemprop="url" href="#">
<span itemprop="name">Link 2</span>
</a>
</span>
<span itemscope="itemscope" itemtype="http://www.schema.org/SiteNavigationElement">
<a itemprop="url" href="#">
<span itemprop="name">Link 3</span>
</a>
</span>
</nav>
If SiteNavigationElement
is meant for the whole navigation (i.e., a navigation link list), your first example is correct.
If SiteNavigationElement
is meant for a single navigation entry (i.e., a link in the navigation link list), your second example is correct.
I think Schema.org doesn’t unambiguously define which variant is meant, as they only say:
A navigation element of the page.
However, the parent type WebPageElement
is defined as:
A web page element, like a table or an image
Also, all the other child types (like Table
or WPFooter
) seem to be used for the whole thing, and not specific parts of the thing.
So this seems to suggest that the whole navigation should be marked up, and not each single link:
<nav itemscope itemtype="http://schema.org/SiteNavigationElement">
<ul>
<li><a href="/link-1">Link 1</a></li> <!-- don’t use the 'url' or 'name' property here! -->
<li><a href="/link-2">Link 2</a></li>
</ul>
</nav>
In this case, all the properties belong to the whole navigation, so that means the url
property would specify a URL for this navigation (and not the URLs of the links in this navigation!).