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

[whatwg] multiple itemtypes in microdata?

From: Philip Jägenstedt <philipj@opera.com>
Date: Wed, 29 Jun 2011 17:35:57 +0200
Message-ID: <op.vxuf97g2sr6mfa@kirk>
On Tue, 28 Jun 2011 19:53:02 +0200, Ian Hickson <ian at hixie.ch> wrote:

> On Tue, 28 Jun 2011, Philip J?genstedt wrote:
>> On Mon, 27 Jun 2011 07:53:53 +0200, John Giannandrea <jgiann at google.com>
>> wrote:
>> >
>> > In the user feedback from the schema.org proposal, which uses
>> > microdata as its syntax, we have seen several use cases that would
>> > seem to require multiple itemtypes per itemscope.
>> >
>> > Currently the microdata spec only allows one itemtype which defines
>> > the meaning of the vocabulary for subsequent itemprops.
>> >
>> > Allowing an arbitrary list of itemtypes would not be desirable because
>> > then a user agent would have to have knowledge of the type
>> > vocabularies in order to parse the page.
>>
>> Nothing needs to be known about the vocabulary in order to handle
>> itemtype currently, at least if by "user agent" you mean browsers and
>> the DOM API. In other words, allowing multiple types wouldn't be a
>> problem here.
>
> That depends how multiple types are done. If all the non-URL properties
> are assumed to be those defined by the first type, then it's fine. But if
> you want to be able to use terms from either vocabulary, you'd need
> vocabulary knowledge to be able to preprocess the data, which would be
> counter to microdata's design goals.
>
> (For example, suppose you have types A and B and A defined property  
> 'foo'.
> You have:
>
>   <div itemscope itemtype="A B">
>     <span itemprop="foo">...</span>
>   </div>
>
>   <div itemscope itemtype="B A">
>     <span itemprop="foo">...</span>
>   </div>
>
> If type "B" later has a property "foo" defined as well, the meaning of
> existing pages changes, as does the necessary processing for generic
> processors that just want to tag each item with unambiguous properties
> (e.g. the vocabulary-agnostic Microdata to RDFa conversion algorithm).

(s/RDFa/RDF/)

Indeed, multiple types doesn't work at all if you want to mix different  
types. I was assuming that the use case was to extend types, kind of like  
http://schema.org/Person/Governor. However, it doesn't work all that well  
even in that case, since there's no way to know which type is the  
extension of the other and which properties exist only on the extended  
type.

-- 
Philip J?genstedt
Core Developer
Opera Software
Received on Wednesday, 29 June 2011 08:35:57 UTC

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