I have a page of name and address search results that I am trying to add Microdata markup to, using Schema.org. It seems to me that names ("familyname" and "givenname") belong to schema.org/people, while the address details (such as "addresscountry") belong to schema.org/PostalAddress.
So I declare schema.org/people at the top of the page, then I bracket the actual names in a schema.org/people reference - it seems that a span
or a div
are equally ignored so that distinction seems unimportant.
When I submit the page to Google it complains like mad that:
Error: Page contains property "familyname" which is not part of the schema. Error: Page contains property "givenname" which is not part of the schema. Error: Page contains property "familyname" which is not part of the schema. Error: Page contains property "givenname" which is not part of the schema.
and similarly testing it with Bing's structured data tool results in the names simply being omitted from what it finds. Anyone have a clue what I might be doing wrong here?
Here's a code snippet. Just ahead of the results table:
<div id="center" itemscope itemtype="http://schema.org/PostalAddress">
and then an extract from the table itself:
<tr><td><div itemprop="familyName" itemscope itemtype="http://schema.org/person">Macdonold</div></td><td><div itemprop="givenName" itemscope itemtype="http://schema.org/person">Carol</div></td><td><span itemprop="addressCountry">Australia</span></td><td><span itemprop="telephone">0439213078</span></td><td><div class="arrow"></div></td></tr>
<tr><td colspan="5"><h4>Additional information</h4>
<ul>
<li>Occupation: <span class="resultdata" itemprop="contactType">Secretary</span></li>
<li>Address: <span class="resultdata" itemprop="streetAddress">324 Coombe Street</span></li>
<li>City: <span class="resultdata" itemprop="addressLocality">Nangwarry</span></li>
<li>State / Region: <span class="resultdata" itemprop="addressRegion">South Australia</span></li>
</ul>
</td></tr>
<tr><td><div itemprop="familyName" itemscope itemtype="http://schema.org/person">Hughes</div></td><td><div itemprop="givenName" itemscope itemtype="http://schema.org/person">Frank</div></td><td><span itemprop="addressCountry">UK</span></td><td><span itemprop="telephone">07369884589</span></td><td><div class="arrow"></div></td></tr>
<tr><td colspan="5"><h4>Additional information</h4>
<ul>
<li>Occupation: <span class="resultdata" itemprop="contactType">Chef</span></li>
<li>Address: <span class="resultdata" itemprop="streetAddress">22 Melrose Place</span></li>
<li>City: <span class="resultdata" itemprop="addressLocality">London</span></li>
<li>State / Region: <span class="resultdata" itemprop="addressRegion">Greater London</span></li>
</ul>
</td></tr>
EDIT: I 'seem' to have solved it by re-ordering the markup around the names. See the following snippet:
<div itemscope itemtype="http://schema.org/person"><span itemprop="familyName"><span itemprop="name">Adam</span></span></div></td><td><div itemscope itemtype="http://schema.org/person"><span itemprop="givenName"><span itemprop="name">Smith</span></span></div>
My reservation about this is it seems so counter intuitive. I have specified for example that the next bit of data will be of type 'familyName', so why do I need to then go on to say this is a 'Name'? It seems like the hierarchical relationship there is back to front. I tried it the other way around and Google wont take it. As it is, Google doesn't complain now, but the marked up structure it reports seems a little crazy, with no linkage between 'Adam' and 'Smith' which seem to be read as two unrelated names.
What I am trying to do ought to be so simple and so basic, and yet I just can't get it to work is one would suppose it should do.