0

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.

unor
  • 92,415
  • 26
  • 211
  • 360
Frankie
  • 596
  • 3
  • 24

3 Answers3

1

There is no http://schema.org/people.

There is no http://schema.org/person. You probably mean http://schema.org/Person (Schema.org URIs are case-sensitive).

There is no property familyName defined for PostalAddress. With Microdata, the familyName property can only be used for Person items. That’s why Google gives you these errors.

When you want to link PostalAddress and Person, you have to use Person’s address property: PersonaddressPostalAddress. Schema.org doesn’t provide any other suitable property, and Microdata doesn’t offer a mechanism for reverse properties.

If your HTML doesn’t allow a certain nesting structure, you could use Microdata’s itemref attribute.


In your example markup, you have created several Person items for a single person. You shouldn’t do that on the same page.

So instead of your markup (taking the first tr from your example):

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

You might want to use something like this:

<tr itemscope itemtype="http://schema.org/Person">
  <td itemprop="familyName">Macdonold</td>
  <td itemprop="givenName">Carol</td>
  <td itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
    <span itemprop="addressCountry" itemscope itemtype="http://schema.org/Country">
      <span itemprop="name">Australia</span>
    </span>
  </td>
  <td itemprop="telephone">0439213078</td>
</tr>

Additional properties for the PostalAddress (which may appear anywhere on the same page) can be added by using the itemref attribute on the td element, e.g.:

<tr itemscope itemtype="http://schema.org/Person">
  <!-- … -->
  <td itemprop="address" itemscope itemtype="http://schema.org/PostalAddress" itemref="address-1">
    <!-- … -->
  </td>
  <!-- … -->
</tr>
<!-- … -->
<tr>
  <td itemprop="streetAddress" id="address-1">324 Coombe Street</td>
</tr>
Community
  • 1
  • 1
unor
  • 92,415
  • 26
  • 211
  • 360
0

I've seen the same error message when attempting to use the familyName and givenName properties for a person instead of name. My personal feeling is that it's just a glitch in Google's testing tool and in the real world, they should be able to understand the markup just fine. But just to be on the safe side, you can try marking up the name in this way, if your page structure allows it:

<div itemscope itemtype="http://schema.org/person">
<span itemprop="name"><span itemprop="familyName">Adam</span>
</td><td><span itemprop="givenName">Smith</span></span></div>
daviddeering
  • 819
  • 1
  • 7
  • 9
0

I think that rather that deem it a Google glitch, it's a reflection of the paucity of development. In other words it seems probable that this is a highly immature protocol, rather than a bugged one. In my application first names and surnames are presented in a table, which makes sense in it's context. This invites me to either start and end a Div tag that breaks table data (RD) boundaries, so creating bad html, or starting and ending a div within the scope of a TD element, once for the first name, and again for the second, even though they are parts of the same 'name'. This unavoidably creates the 'machine readable' impression that there are two 'names', with no way for the author to convey the truth that they are the same entity. Instead, you tell Google (or any other consumer of microdata) that you have a first entity that has a name, specifically a forename, and a second entity that has a name, specifically a familyname. There exists no way to have microdata convey the sense that these are the same entity; at least not when you present such data in a tabular manner. I feel this is quite a shocking basic omission, but then, what do I know. In short, for the forseeable future, microdata and tabular data do not play well together.

Frankie
  • 596
  • 3
  • 24