W3C home > Mailing lists > Public > public-rdfa@w3.org > February 2010

Re: list-expansion in RDFa

From: Gregg Kellogg <gregg@kellogg-assoc.com>
Date: Sun, 21 Feb 2010 14:19:33 -0500
To: Ivan Herman <ivan@w3.org>
CC: Christoph LANGE <ch.lange@jacobs-university.de>, Toby Inkster <tai@g5n.co.uk>, RDFa Community <public-rdfa@w3.org>, "public-rdfa-wg@w3.org" <public-rdfa-wg@w3.org>
Message-ID: <12B02D05-A71B-438F-9B4A-948634C0CCA9@kellogg-assoc.com>
I like the typeof="rdf:List" syntax for linked-list generation, this would also allow the specification of "rdf:Seq" along with "rdf:Bag" and "rdf:Alt", which could interpret the <li> children as rdf:li and expand to rdf:_n sequences.

We might want an explicit way to identify sub-elements as list items, in the case of non-HTML or alternate child elements. I'm currently to do <li rel="rdf:_1">. <li rel="rdf:li"> should perform expansion, and in the case of HTML, a child <li> should implicitly expand to rdf:_n or get linked in with rdf:first/rdf:rest if the parent container is set to rdf:List.


On Feb 21, 2010, at 12:39 AM, Ivan Herman wrote:

I think we should definitely _not_ reinvent lists in RDFa. From an RDF
point of view RDFa is "just" another RDF serialization, and it it not
its task to introduce new notions. Whatever solution we chose should
rely on the existing terms (and it is not our job, in the RDFa world, to
get into the discussion of the relative merits of lists and sequences;
that is a valid discussion but not here...).

Back to the original issue: I did play with this issue in pyRdfa and I
did implement an extension for this. My basic approach was to have a
'transformer' that would take the DOM tree and transform it into a
(possibly meaningless) XHTML for the purpose of RDFa processing. In
other words, this would not modify the processing steps of the core RDFa
specification (which is complicated enough as it is) but would
nevertheless (Ben Adida coined, at some point, the term hGRDDL for such
'preprocssing' steps).

The code is a bit convoluted but only for those who want to implement
it, it is transparent to the user. There is a rough documentation of it
in[1]. The bottom line is that a List could be encoded by

<ul typeof="rdf:List">
 <li>first, text element of a list</li>
 <li about="URITOALISTELEMENT">something here</li>

(I am sure the code is full of bugs, though...)

Just food for thoughts.

Caveat: the choice of elements (ol or ul, and the li-s) is specific to
HTML. I'm not sure what this would mean for a generic XML version... We
could of course say that any element can be defined as rdf:List and all
direct children are then the list elements, but there might be corner


P.S. All that being said we should careful to set up the right priority
for things that we may want to add to RDFa1.1


On 2010-2-20 13:31 , Christoph LANGE wrote:
2010-02-20 01:19 Toby Inkster <tai@g5n.co.uk>:
On Fri, 2010-02-19 at 15:12 -0500, Gregg Kellogg wrote:
However, the inability to reasonably serialize RDF lists in RDFa is a

Serialising rdf:Lists in RDFa is ugly, ugly, ugly.

I agree that they are ugly, but sometimes you can't do without them.  Or how
_would_ one encode what Gregg meant to express?  I still think that RDF lists
are the most “standard” way of doing so.  So why not add the data structure
support known from RDF/XML to RDFa?

Or otherwise, we could give definitive recommendations on how to solve this
common problem, without always reinventing the wheel.  Two common patterns

* giving every list item a numeric “index”-like property
* reinventing linked lists without using rdf:first|rdf:rest.  This has e.g.
 been done here:

A third way might be to say:  We do not _want_ to introduce (ordered) lists
into RDFa, because the order can always be derived by looking into the X(HT)ML
document that holds the RDFa annotations.  But that would be problematic

* sometimes you process the RDF extracted from RDFa and no longer have access
 to the original X(HT)ML document
* encoding order directly in RDF is machine-friendlier than making reasoners
 look up order in X(HT)ML
* the fact that in XML _everything_ is ordered might give the false expression
 that non-list-like RDFa annotations also have an “ordered” semantics.

That said, rdf:Lists have few uses outside OWL ontologies.

I would render that more precisely to “outside the RDF representation of OWL
ontologies”.  And the fact that RDF lists are internally used to represent
certain OWL constructors in RDF unfortunately makes RDF's list vocabulary
“special” for OWL reasoners, which is why one cannot use RDF lists in ABox
data that _use_ an OWL ontology.  And that's why the above-mentioned paper was




Ivan Herman, W3C Semantic Web Activity Lead
Home: http://www.w3.org/People/Ivan/
mobile: +31-641044153
PGP Key: http://www.ivan-herman.net/pgpkey.html
FOAF   : http://www.ivan-herman.net/foaf.rdf
vCard  : http://www.ivan-herman.net/HermanIvan.vcf
Received on Sunday, 21 February 2010 19:20:29 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:04:45 UTC