I'm tagging a site with Schema.org microdata, and have run into a quandry. I understand that I can define a book and then it's author (I'll use ../ rather than http://schema.org/ for space):
<div itemscope itemtype="../Book">
<span itemprop="name">Charlie and the Chocolate Factory</span>
written by <span itemprop="author">Roald Dahl</span>
</div>
But I'm tagging a page about the author, so I want a way to list his books and say that all these items are written by him, without listing his name over and over again:
<article itemscope itemtype="../Person" id="main">
<h1 itemprop="name">Roald Dahl</h1>
<p>His books included <span itemscope itemtype="../Book">Charlie and the
Chocolate Factory</span> and
<span itemscope itemtype="../Book">James and the Giant Peach</span></p>
</article>
Any ideas? Just putting itemref="main" doesn't help (because I'm trying to give a specific relation, that of author, not just relate these two things generally). Does an empty span element make any sense?:
<span itemscope itemtype="../Book">James and the Giant Peach
<span itemprop="author" itemref="main"></span></span>
UPDATE: I think I've figured this one out, for anyone looking up. You can define an itemprop for an itemscope, to be used later with itemref. So I think the answer is:
<article itemscope itemtype="../Person" itemprop="author" id="main">
<h1 itemprop="name">Roald Dahl</h1>
<p>His books included <span itemscope itemtype="../Book" itemref="main">Charlie
and the Chocolate Factory</span> and
<span itemscope itemtype="../Book" itemref="main">James and the Giant Peach</span>
</article>
Not sure what I'd do if there was more than one itemprop I wanted to link back (Schema.org is full on 2-way relationships with only one of those ways defined) but this solves my particular problem.
UPDATE2 : This has solved my previous problem, but I cannot now embed this within any other itemscopes. So, I want to tag the whole thing as an Article, I can't do it as:
<main itemscope itemtype="../Article">
<article itemscope itemtype="../Person" itemprop="author" id="main">
<h1 itemprop="name">Roald Dahl</h1>
....
</article></main>
Now my itemprop="author" hack is also assigned to the top level Article. Now my code is telling people that Roald Dahl wrote not only the books given, but this article itself!
Any suggestions how to solve this, or a solution to my original problem that doesn't cause this issue?