W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2011

[whatwg] Microdata property sharing with itemref

From: Philip Jägenstedt <philipj@opera.com>
Date: Tue, 14 Jun 2011 11:07:11 +0200
Message-ID: <op.vw1599fqsr6mfa@kirk>
A question came up in the Schema.org discussion group today:

http://groups.google.com/group/schemaorg-discussion/browse_thread/thread/69b733066ae7aaaa?pli=1

The question was how to fix http://www.2gc.co.uk/a2gc-people to link  
together properties that were in different parts of the document into a  
single item. The answer is of course to use itemref, here simplified even  
further to illustrate:

<div itemscope itemtype="http://schema.org/Organization">
   <p itemprop="name">2GC Active Management</p>
   <div class="photogrid">
     <div class="photoitem" itemprop="employees" itemscope  
itemtype="http://schema.org/Person" itemref="GL">
       <img itemprop="image" src="/images/GJGL.jpg" alt="Gavin Lawrie -  
Managing Director">
       <div itemprop="name">Gavin Lawrie</div>
       <div itemprop="jobTitle">Founder &amp; Managing Director</div>
     </div>
     <!-- more employees -->
   </div>

   <div id="bio-display" itemscope>
     <div class="bio-text" id="GL"><dl>
       <dt>Gavin Lawrie: Founder &amp; Managing Director</dt>
       <dd itemprop="description">Gavin is ...</dd>
     </dl></div>
     <!-- more employees -->
   </div>
</div>


The ugly: <div id="bio-display" itemscope>. That itemscope is there only  
to prevent the description property of the Person from applying to the  
organization, and does so because the algorithm to crawl the properties of  
an item stops at itemscope. This is a silly hack, because it is not an  
item, and I don't expect many people would find this solution even if they  
knew about the problem.

Have others encountered this problem and how did you deal with it?

Should we have yet another property like "itemunscope" that stops the  
crawl algorithm but does not create a new item?

Could we tweak the validity definitions so that this kind of thing would  
cause validators to complain, or should we leave it completely to  
vocabulary-specific validators to spot this kind of thing? (They can't if  
they operate on the microdata level and not DOM level, which I think they  
should.)

Sorry for the lack of solutions in this mail, but I though it was worth  
raising anyway.

(One idea of mine that was discussed some time ago was to only let each  
property belong to one item, letting items steal each others properties by  
use of itemref. Even though it would solve this particular problem, it is  
quite weird and was rightfully rejected.)

-- 
Philip J?genstedt
Core Developer
Opera Software
Received on Tuesday, 14 June 2011 02:07:11 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:06 UTC