W3C home > Mailing lists > Public > public-rdfa-wg@w3.org > August 2011

Re: Attempt for a List specification in RDFa (was Re: Suggestions for rdf:List and a value type shorthand)

From: Jeni Tennison <jeni@jenitennison.com>
Date: Fri, 26 Aug 2011 06:51:56 +0100
Cc: public-rdfa-wg <public-rdfa-wg@w3.org>
Message-Id: <A14D213F-C6A6-45D4-B4AD-EFA92178F2FA@jenitennison.com>
To: Ivan Herman <ivan@w3.org>, Niklas Lindström <lindstream@gmail.com>
Ivan, Niklas, others,

On 24 Aug 2011, at 15:57, Ivan Herman wrote:
> I tried to modify my original approach based on the discussion we had:
> http://www.w3.org/2010/02/rdfa/wiki/Lists

As you know, the issue about lists arose from trying to identify what changes might be made that would make it easier for people to combine or switch between microdata and RDFa. If you are going to introduce syntax sugar for rdf:List (which I think you should) then I'd favour something that was easy to map to the microdata over something that wasn't.

The example on the wiki page is:

 <li about="http://www.worldcatlibraries.org/isbn/9780262912423" 
   <span rel="dc:creator" collection>
     <span member>Grigoris Antoniou</span> and
     <span member>Frank van Harmelen</span>

In microdata this would be:

 <li itemid="http://www.worldcatlibraries.org/isbn/9780262912423" 
     <span itemprop=".../creator">Grigoris Antoniou</span> and
     <span itemprop=".../creator">Frank van Harmelen</span>

Going the other way, a microdata example is:

 <section itemscope itemtype="http://example.org/animals#cat">
  <h1 itemprop="name http://example.com/fn">Hedral</h1>
  <p itemprop="desc">Hedral is a male american domestic
  shorthair, with a fluffy <span
  itemprop="http://example.com/color">black</span> fur with <span
  itemprop="http://example.com/color">white</span> paws and belly.</p>
  <img itemprop="img" src="hedral.jpeg" alt="" title="Hedral, age 18 months">

Assuming the http://example.com/color property needed to have a list, this would turn into:

 <section vocab="http://example.org/animals#" typeof="cat">
  <h1 property="name http://example.com/fn">Hedral</h1>
  <p property="desc">Hedral is a male american domestic
  shorthair, with a fluffy <span rel="http://example.com/color" collection><span
  member>black</span> fur with <span
  member>white</span></span> paws and belly.</p>
  <span rel="img"><img src="hedral.jpeg" alt="" title="Hedral, age 18 months">

So the RDFa proposal requires a wrapper element around the items of the list and moves the relationship onto the wrapper element, whereas the microdata one just aggregates the items based on the property.

While I can see the logic of the wrapper element, it does constrain the structure of the HTML. It prevents people from mixing other properties amongst the members of the list (though I struggle to come up with a persuasive example where you'd want to do that; perhaps someone else can think of one).

I guess an alternative that alleviates this would be:

 <li about="http://www.worldcatlibraries.org/isbn/9780262912423" 
   <span property="dc:creator" member>Grigoris Antoniou</span> and
   <span property="dc:creator" member>Frank van Harmelen</span>

This also has the advantage of making it easier to adapt existing RDFa to create lists rather than multiple triples with the same property: you just add the 'member' attribute as required. If a property element didn't have the member attribute:

 <li about="http://www.worldcatlibraries.org/isbn/9780262912423" 
   <span property="dc:creator" member>Grigoris Antoniou</span> and
   <span property="dc:creator">Frank van Harmelen</span>

then I'd suggest it wouldn't be part of the list for that property:

    a bibo:Book ;
    dc:creator ("Grigoris Antoniou") ;
    dc:creator "Frank van Harmelen" ;

I suggest this approach as being easy to use from an author's perspective (particularly an author who isn't used to thinking about lists as a type of resource). I'm not sure how it could be described in processing terms. Perhaps collect a map of property->list for those elements with a 'member' attribute, and when you finish processing the element turn any such maps into triples with the relevant rdf:List.

In short, I think that approaches to expressing lists that use a wrapper element for the list itself are going to be constraining for people to use, particularly when mixed with microdata.


Jeni Tennison
Received on Friday, 26 August 2011 05:52:21 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:05:26 UTC