[whatwg] Microdata property sharing with itemref
Philip Jägenstedt
philipj at opera.com
Tue Jun 14 02:07:11 PDT 2011
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 & Managing Director</div>
</div>
<!-- more employees -->
</div>
<div id="bio-display" itemscope>
<div class="bio-text" id="GL"><dl>
<dt>Gavin Lawrie: Founder & 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
More information about the whatwg
mailing list