Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I combine two itemscopes to describe a single item?

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.

like image 586
haydenmuhl Avatar asked Dec 02 '11 20:12

haydenmuhl


1 Answers

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>
like image 131
Nate B Avatar answered Nov 11 '22 12:11

Nate B