TL;DR: Don't do it :)
First, note that itemref loops are invalid and will not produce sane
output, so there's no point in deliberately creating such loops.
Still, here is one such example:
<div itemscope>
<div id="a" itemprop="a" itemscope itemref="b"></div>
<div id="b" itemprop="b" itemscope itemref="a"></div>
</div>
(The example you gave isn't a loop, because the md_me doesn't have an
itemprop attribute.)
How to deal with loops created by itemref was changed very recently.
Now, if you create such loops, you'll get a property value "ERROR" in
JSON, see this example:
--
Philip Jägenstedt
<div itemscope>
<div id="a" itemprop="a" itemscope itemref="b"></div>
<div id="b" itemprop="b" itemscope itemref="a"></div>
</div>(The example you gave isn't a loop, because the md_me doesn't have an
itemprop attribute.)
In your first mail there were two examples. The first is invalid
because it creates an "about" property on "address" which then in turn
has another "address" property. However, I was looking at the second
of your examples, so let's focus on that.
When you use itemref, everything behaves just as if the itemref'd
element were a child element of the itemscope'd element itself. Thus,
these two are equivalent:
<div itemscope itemref="other"></div>
<div id="other" itemprop="fooItem" itemscope>
<div itemprop="fooProp">foo</div>
</div>
<div itemscope>
<div itemprop="fooItem" itemscope>
<div itemprop="fooProp">foo</div>
</div>
</div>
If that much is clear, consider what this means:
<div itemscope>
<div itemscope>
<div itemprop="fooProp">foo</div>
</div>
</div>
Because the inner itemscope'd element does not have an itemprop
attribute, it has no relation to the outer item. They're simply
independent items. This follows from the definition of a top-level:
"An item is a top-level microdata item if its element does not have an
itemprop attribute." [1]
In other words, because <div id="md_me" itemscope
itemtype="http://schema.org/Person"> does not have an itemprop
attribute, it does not become an item of <meta itemprop="about"
itemscope itemtype="http://schema.org/Person" itemref="md_me" />
As you can see, it's quite hard to create an itemref loop that does
anything useful. That all good, because it's invalid and nobody should
do it :)
[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/microdata.html#top-level-microdata-items
--
Philip Jägenstedt
2011/7/14 黃耀賢 (Yau-Hsien Huang) <g9414002.pccu.edu.tw@gmail.com>:
In your first mail there were two examples. The first is invalid
because it creates an "about" property on "address" which then in turn
has another "address" property. However, I was looking at the second
of your examples, so let's focus on that.
When you use itemref, everything behaves just as if the itemref'd
element were a child element of the itemscope'd element itself. Thus,
these two are equivalent:
<div itemscope itemref="other"></div>
<div id="other" itemprop="fooItem" itemscope>
<div itemprop="fooProp">foo</div>
</div>
<div itemscope>
<div itemprop="fooItem" itemscope>
<div itemprop="fooProp">foo</div>
</div>
</div>If that much is clear, consider what this means:
<div itemscope>
<div itemscope>
<div itemprop="fooProp">foo</div>
</div>
</div>Because the inner itemscope'd element does not have an itemprop
attribute, it has no relation to the outer item. They're simply
independent items. This follows from the definition of a top-level:
"An item is a top-level microdata item if its element does not have an
itemprop attribute." [1]In other words, because <div id="md_me" itemscope
itemtype="http://schema.org/Person"> does not have an itemprop
attribute, it does not become an item of <meta itemprop="about"
itemscope itemtype="http://schema.org/Person" itemref="md_me" />
As you can see, it's quite hard to create an itemref loop that does
anything useful. That all good, because it's invalid and nobody should
do it :)[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/microdata.html#top-level-microdata-items
--
Philip Jägenstedt
In other words, because <div id="md_me" itemscope
itemtype="http://schema.org/Person"> does not have an itemprop
attribute, it does not become an item of <meta itemprop="about"
itemscope itemtype="http://schema.org/Person" itemref="md_me" />
[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/microdata.html#top-level-microdata-items
--
Philip Jägenstedt
OK, I was just pointing out that something seems to be wrong, by all
means test away!
(However, http://schema.org/docs/extension.html does not say that you
can add arbitrary properties, only extend them on the form
musicGroupMember/leadVocalist)
Yes, that's also fine. As far as I can tell, everything I've written
so far is correct. I certainly haven't said that *any* element
referred to with itemref must have an itemprop attribute, because that
is incorrect.
Perhaps I have completely misunderstood what you were actually asking.
If by "recursive microdata" you mean itemref loops, the only way that
could happen is if both items in the loop have both itemscope
(obviously) and itemprop (because otherwise they can't be properties
of another item and therefore not be part of a loop).
>> As you can see, it's quite hard to create an itemref loop that does
>> anything useful. That all good, because it's invalid and nobody should
>> do it :)
>>
>> [1]
>> http://www.whatwg.org/specs/web-apps/current-work/multipage/microdata.html#top-level-microdata-items
>>
>
> Yes, I tried the recursive notation. But I did not said "it's OK to write
> a recursive metadata." OK?
>
> Stop fool people about the ID itemref-ed must be some itemprop.
> The draft or specification never say it. If it's true, microdata will be not
> flexible such as a person got spondylitis.
Calm down and please be less rude, I am only doing my best to
understand and answer your questions. No one is actively trying to
fool anyone, at worst there is honest misunderstanding.
--
Philip Jägenstedt