Can I combine two itemscopes to describe a single item? - html

I would like to add microdata to a page, but the data for an item is broken up into a couple discontinuous parts of the page. If I have two span elements with an itemscope attribute, is it possible to get search engines to merge the two itemscopes and interpret them as a single item?
For example*:
<span itemscope itemtype="http://schema.org/Person">
Hello, my name is <span itemprop="name">Glinda</span>.
</span>
I like to fly around in a giant bubble.
<span itemscope itemtype="http://schema.org/Person">
I live in the <span itemprop="location">Land of Oz</span>.
</span>
Is there a way to add something like an itemid attribute to tell a web spider that the two Person itemscopes should be consumed as one item, instead of two?
Maybe something like this.
<span itemscope itemtype="http://schema.org/Person" itemid="7f6ba1">
Hello, my name is <span itemprop="name">Glinda</span>.
</span>
I like to fly around in a giant bubble.
<span itemscope itemtype="http://schema.org/Person" itemid="7f6ba1">
I live in the <span itemprop="location">Land of Oz</span>.
</span>
* I understand that in this example I could just use one big span, but I can't do that with the actual page I have to work with.
Edit: Perhaps I need a better example. It's a bit contrived, but demonstrates the problem I have. Remember, reorganizing the page is not an option.
<h1>Locations</h1>
<ul>
<li itemscope itemtype="http://schema.org/Person">
<span itemprop="name">Bob</span> lives in <span itemprop="location">Berkeley</span>
</li>
<li itemscope itemtype="http://schema.org/Person">
<span itemprop="name">Carol</span> lives in <span itemprop="location">Cupertino</span>
</li>
</ul>
<h1>Jobs</h1>
<ul>
<li itemscope itemtype="http://schema.org/Person">
<span itemprop="name">Bob</span> works at <span itemprop="affiliation">Borders</span>
</li>
<li itemscope itemtype="http://schema.org/Person">
<span itemprop="name">Carol</span> works at <span itemprop="affiliation">Capitol One</span>
</li>
<ul>
Is there a way to make this microdata result in two Person items, rather than four?
I want to have Bob, who lives in Berkeley, and works at Borders, and Carol who lives in Cupertino and works at Capitol One.

If I'm reading the W3 itemref properly, you can use the itemref property for this purpose:
<h1>Locations</h1>
<ul>
<li itemscope itemtype="http://schema.org/Person" itemref="bob">
<span itemprop="name">Bob</span> lives in
<span itemprop="homeLocation">Berkeley</span>
</li>
<li itemscope itemtype="http://schema.org/Person" itemref="carol">
<span itemprop="name">Carol</span> lives in
<span itemprop="homeLocation">Cupertino</span>
</li>
</ul>
<h1>Jobs</h1>
<ul>
<li itemprop="affiliation" itemscope itemtype="http://schema.org/Organization" id="bob">
Bob works at <span itemprop="name">Borders</span>
</li>
<li itemprop="affiliation" itemscope itemtype="http://schema.org/Organization" id="carol">
Carol works at <span itemprop="name">Capitol One</span>
</li>
<ul>

Yes it is possible if you use the itemref property.
Have a look at this website: IJzerfront 14-18
They link up the information (description and image are separated and are added to the Museum Place).

Related

Google Rich Snippets JobPosting not displaying

I have added the necessary Schema markup for the JobPosting schema to my job board website. However, the rich snippets are not showing up in SERPs unlike one of my competitors.
Am I missing any mandatory fields?
I have checked the webmaster tools Structured Data tool and everything looks fine.
Here is an example screenshot:
Any helps greatly appreciated.
My URL: http://www.backpackerjobboard.com.au/jobs-in/sydney/
EDITED: acode snippet added
<ul class="jobs-list">
<li class="group" itemscope itemtype="http://schema.org/JobPosting">
<div class="inner">
<span class="status"><span>·</span> New</span>
<h3><span itemprop="title">Qualified Joiners and Cabinet Makers wanted Immediate start</span></h3>
<span class="company-name" itemprop="hiringOrganization" itemscope itemtype="http://schema.org/Organization"><span itemprop="name">NSW Joinery Pty Ltd</span></span>
<span class="location"><i class="icon"> </i>
<span itemprop="jobLocation" itemscope itemtype="http://schema.org/Place">
<span itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<span itemprop="addressRegion">Sydney</span>
</span>
</span>
</span>
<span class="time-posted" itemprop="datePosted">Job posted: 21st November 2014</span>
</div>
<span class="category" itemprop="employmentType">Full-time</span>
</li>
...
</ul>

Google rich snippets code div

I checked many different sites (official one also) and all the examples display the google snippets code itemscope/itemtype inside a div and the itemprop inside a span.
I'm wondering if this is just a simple way to show samples code or is the only way yo display it.
I have my address in a list so i wrote like this:
<li itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<i class="fa fa-map-marker fa-lg"></i> <p class="labelSocial">Address:</p>
<a href="https://www.google.com/maps/place/Glogauer+Stra%C3%9Fe+21/#52.49226,13.4369,17z/data=!3m1!4b1!4m2!3m1!1s0x47a84fb24234006b:0x36dfe942fb2b5f97" target="_blank">
<p class="addressText">
<span itemprop="streetAddress"> Glougauerstrasse 21, </span> </br>
<span itemprop="postalCode"> 12435 </span>
<span itemprop="addressLocality"> - Berlin </span>
<span itemprop="addressCountry"> (DE) </span>
</p></a>
</li>
is that also correct?
Your Code is fine but you'll have to nest schema.org/PostalAddress under some main category but use of <li> tag is correct. Here is what Google Structured Data testing tools shows for the code you mentioned above-
http://www.google.com/webmasters/tools/richsnippets?q=uploaded:800501214b811a6b2bbfb52e2d77f96d
In order to tell Google and other search engines that address is related to what, we must specify a category and nest postal address inside it. Please see the example, schema.org/PostalAdsress is nested inside LocalBusiness schema:
<div itemscope itemtype="http://schema.org/LocalBusiness">
<h1><span itemprop="name">Beachwalk Beachwear & Giftware</span></h1>
<span itemprop="description"> A superb collection of fine gifts and clothing
to accent your stay in Mexico Beach.</span>
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<span itemprop="streetAddress">3102 Highway 98</span>
<span itemprop="addressLocality">Mexico Beach</span>,
<span itemprop="addressRegion">FL</span>
</div>
Phone: <span itemprop="telephone">850-648-4200</span>
</div>

Can't get google to display breadcrumb in search results

I'm trying to get Google to show my breadcrumb in search results by using schema.org's breadcrumb micro data. When I use Google's structured data testing tool, the breadcrumb doesn't show in the search results sample and the following message appears: "The excerpt from the page will show up here. The reason we can't show text from your webpage is because the text depends on the query the user types."
I don't understand that because the URL I'm using doesn't contain a query string (it's http://www.fastfoodnutrition.org/6_r-taco-bell/8511_i-sausage-flatbread-melt-nutrition-facts.html)
Here's my code:
<ol class="breadcrumb" itemscope itemtype="http://schema.org/breadcrumb">
<li><a itemprop="url" href="/6_r-taco-bell/nutrition-facts.html" title="/6_r-taco-bell/nutrition-facts.html"><span itemprop="title">Taco Bell</span></a></li>
<li><a itemprop="url" href="/6_r-taco-bell/269_c-breakfast-nutrition-facts.html" title="/6_r-taco-bell/269_c-breakfast-nutrition-facts.html"><span itemprop="title">Breakfast</span></a></li>
<li>Sausage Flatbread Melt Nutrition Facts</li>
</ol>
Google doesn't recognize them yet, you should use http://data-vocabulary.org/Breadcrumb instead and it will be recognized by the RichSnippets tool as this Google post suggest. So your code would be:
<ol>
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a itemprop="url" href="/6_r-taco-bell/nutrition-facts.html" title="/6_r-taco-bell/nutrition-facts.html">
<span itemprop="title">Taco Bell</span>
</a>
</li>
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a itemprop="url" href="/6_r-taco-bell/269_c-breakfast-nutrition-facts.html" title="/6_r-taco-bell/269_c-breakfast-nutrition-facts.html">
<span itemprop="title">Breakfast</span>
</a>
</li>
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<span itemprop="title">Sausage Flatbread Melt Nutrition Facts</span>
</li>
</ol>

Microdata on list markup not validating with W3C validator

I am brand new to Microdata and I am slowly getting it. But for some reason this does not validate with the W3C validator since I’m putting a <div> in the middle of a <ul>:
<div itemscope itemtype="http://schema.org/BeautySalon">
<ul>
<li>
<b>
<span itemprop="name">foobar and you</span>
</b>
</li>
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<li>
<span itemprop="streetAddress">6969 foobar</span>
</li>
<li>
<span itemprop="addressLocality">Miami Beach</span>,
<span itemprop="addressRegion">FL</span>
<span itemprop="postalCode">33139</span>
</li>
</div>
<li>
<span itemprop="telephone">305 691 6969</span>
</li>
</ul>
</div>
How would I correctly add the
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
and correctly add all the itemprop and still be W3C valid?
ul doesn’t allow div as child, so you can’t use it as container for several li elements. There are various possible solutions.
I think using ul here is not appropriate. But if you want to keep using ul:
It doesn’t seem to make sense that the street address is not in the same list item as the locality/region/postal code. So you might want to put them all in the same list item (and you might also want to use br for postal addresses).
If you want to use b for the name, you could omit the span. Either specify the Microdata on the b or (for consistency) on the li.
If you don’t need a separate element for the telephone number, you could specify the Microdata on the li.
This would give you:
<div itemscope itemtype="http://schema.org/BeautySalon">
<ul>
<li itemprop="name"><b>foobar and you</b></li>
<li itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<span itemprop="streetAddress">6969 foobar</span><br>
<span itemprop="addressLocality">Miami Beach</span>,
<span itemprop="addressRegion">FL</span><br>
<span itemprop="postalCode">33139</span>
</li>
<li itemprop="telephone">305 691 6969</li>
</ul>
</div>
You can use every HTML5 element for Microdata. Re-use your existing markup. Only if you need additional elements for Microdata, add and use div/span (and possibly meta/link).

What is the correct use of schema.org SiteNavigationElement?

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">
Link 1
Link 2
Link 3
</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>Link 1</li> <!-- don’t use the 'url' or 'name' property here! -->
<li>Link 2</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!).
According to Search Engine Land, it's supposed to look like this:
<ul itemscope itemtype="http://www.schema.org/SiteNavigationElement">
<li itemprop="name">
<a itemprop="url" href="#">Link 1</a>
</li>
<li itemprop="name">
<a itemprop="url" href="#">Link 2</a>
</li>
<li itemprop="name">
<a itemprop="url" href="#">Travel Resources</a>
</li>
</ul>
First answer is correct but I'd mix both for (HTML5-)semantic:
<nav itemscope itemtype="http://schema.org/SiteNavigationElement">
<ul>
<li>
<a itemprop="url" href="http://example.com/">
<span itemprop="name">Link 1</span>
</a>
</li>
</ul>
</nav>
<nav role="navigation">
<ul role="menubar" aria-activedescendant="">
<li role="presentation" itemscope itemtype="https://schema.org/SiteNavigationElement">
<a href="" role="menuitem" tabindex="-1" itemprop="url">
<span itemprop="name">Link 1</span>
</a>
</li>
</ul>
</nav>
schema.org/SiteNavigationElement extends WebPageElement and can be used to mark-up links, which would often make good contextual links. You can use this schema for your page menu.
<nav role="navigation" itemscope itemtype="http://schema.org/SiteNavigationElement">
<ul>
<li>
<a href="https://yoursite.com/" title="Link to Home" itemprop="url">
<span itemprop="name">Home</span>
</a>
</li>
<li>
<a href="https://yoursite.com/sample-page" title="Link to sample page" itemprop="url">
<span itemprop="name">sample page</span>
</a>
</li>
</ul>
OP's original question contained a good example of code. none of the answers do though ...
It seems everyone threw in a somewhat random answer ... You can test your schema microdata code using the following official google tool search.google.com/structured-data/testing-tool.
If you run the proposed answers in this tool you will notice that none give you the expected result: a list of SiteNavigationElement with a name & url
Some might argue that a whole menu might be considered a "navigation element" but I think it makes more sense for this denomination to designate a single navigation link. Plus if we use the SiteNavigationElement as a marker for the whole menu we have no way of associating names with URLs in the html.
To achieve this, you need to have each link be encapsulated by an itemscope property and they all need to have their own name and url itemprop (these are singleton as mentioned by #David Harkness, so they have to appear only once per itemprop)
<nav>
<ul>
<li itemscope itemtype="http://schema.org/SiteNavigationElement">
<a itemprop="url" href="http://example.com/link-1">
<span itemprop="name">Link 1</span>
</a>
</li>
<li itemscope itemtype="http://schema.org/SiteNavigationElement">
<a itemprop="url" href="http://example.com/link-2">
<span itemprop="name">Link 2</span>
</a>
</li>
</ul>
</nav>
The code above will yeld two different navigation elements, each with a name and an URL.
Note: the itemprop="url" attribute uses the anchor's href attribute as value
Consider the following code snippet adapted from the page source of habd.as:
<nav itemscope itemtype="https://schema.org/SiteNavigationElement">
<meta itemprop="name" content="Main Menu">
<a itemprop="url" class="active" href="/">habd.as</a>
<a itemprop="url" href="/code/">Code</a>
<a itemprop="url" href="/post/">Posts</a>
<a itemprop="url" href="/site/">Sites</a>
<a itemprop="url" href="/talk/">Talks</a>
</nav>
<nav itemscope itemtype="https://schema.org/SiteNavigationElement">
<meta itemprop="name" content="Utility Menu">
<a itemprop="url" href="/about/">About</a>
<a itemprop="url" href="/contact/">Contact</a>
</nav>
When there are multiple navigations as shown above, use of SiteNavigationElement to group navigation items affords the use of name
such that the grouping itself may be labeled. Labels for individual items within the groups can be obtained using the content of the links themselves.
Therefore, your first example is more correct despite assertions to the contrary.
I think the most elegent solution would be to use the hasPart property.
<nav itemscope="itemscope" itemtype="http://www.schema.org/SiteNavigationElement">
<a itemprop="hasPart" href="/link1.html">Link 1</a>
<a itemprop="hasPart" href="/link2.html">Link 2</a>
<a itemprop="hasPart" href="/link3.html">Link 3</a>
</nav>
Using Google's Structure Data Testing Tool informs that these links are part of the SiteNavigationElement and that Google should follow the links to those items:
Having considered all the above, I came to the following conclusion:
<nav itemscope itemtype="http://schema.org/SiteNavigationElement">
<ul>
<li itemprop="hasPart">
<span itemprop="name">Home</span>
</li>
</nav>
Thus, each <li> is part of the SiteNavigationElement that has the url and name. I think this is the best option.
But do search engines need such redundant markup? They already know that href in is the url, and inside the tag <a>name is the name. What do you think about it?
Here's a quote from a post at Google support site, saying:
We are contemplating to implement Site Navigation Schema
https://schema.org/SiteNavigationElement
Will google respect it and display sitelinks if the schema is there or it will do it own thing anyway?
I sthere a point at all?
This type of top-level does not currently support Google. In fact,
this type does not even have a scope definition. It is unclear whether
this type affects a group, for example, a navigation menu, or only one
link.
This confirms my experience with their rich results test: only breadcrumbs are recognized. Yandex validates my microdata just fine. So SiteNavigationElement on your page seems to be as useless as it is valid.