Re: Microdata itemid and src / href

On Sat, 22 Oct 2011 23:04:28 +0200, Jayson Lorenzen  
<Jayson.Lorenzen@businesswire.com> wrote:

> Sorry to go on and on about this but I just thought (while driving,  
> dangerous) that this situation is an interesting example of of a  
> Vocabulary specific parser behaving differently than a generic parser  
> (that does not know about the Vocabulary). Here is what I mean. Using a  
> generic parser (like Mr. Kellog's)

Both of the following examples are invalid microdata and they don't  
represent the same things. Details inline.

>   <div itemscope="itemscope"  itemtype="http://schema.org/Organization"  
> itemid="http://example.com">
>     <meta itemprop="name" content="Example"/>
>   </div>
>
>    <a itemprop="myCompany" href="http://example.com">

Validator.nu [1] will complain about the <a> element that "The itemprop  
attribute was specified, but the element is not a property of any item."  
The problem is that the <a> element is not a child of the <div>, so it's  
just ignored. Live Microdata [2] gives this JSON output:

{
   "items":[
     {
       "type":"http://schema.org/Organization",
       "id":"http://example.com/",
       "properties":{
         "name":[
           "Example"
         ]
       }
     }
   ]
}

(Note that there is no myCompany property.)

>   <div itemprop="myCompany" itemscope="itemscope"   
> itemtype="http://schema.org/Organization"
>        itemid="http://example.com">
>       <meta itemprop="name" content="Example"/>
>    </div>

Validator.nu will complain that "The itemprop attribute was specified, but  
the element is not a property of any item." The issue here is that there  
is no top-level item, since the outer item has an itemprop attribute.  
Consequently, Live Microdata gives no output, simply noting that "No  
top-level items found."

> Produce the exact same RDF in a generic parser, but completely different  
> results in the Google Rich Snippets Test tool.

It sounds like there are bugs in the microdata parser used. Gregg, can you  
take a look at this?

[1] http://validator.nu/
[2] http://foolip.org/microdatajs/live/
[3]  
http://www.whatwg.org/specs/web-apps/current-work/multipage/microdata.html#top-level-microdata-items

-- 
Philip Jägenstedt
Core Developer
Opera Software

Received on Monday, 24 October 2011 09:27:16 UTC