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

Re: list-expansion in RDFa

From: Ivan Herman <ivan@w3.org>
Date: Sun, 21 Feb 2010 09:39:30 +0100
Message-ID: <4B80F142.2060800@w3.org>
To: Christoph LANGE <ch.lange@jacobs-university.de>
CC: Toby Inkster <tai@g5n.co.uk>, Gregg Kellogg <gregg@kellogg-assoc.com>, RDFa Community <public-rdfa@w3.org>, "public-rdfa-wg@w3.org" <public-rdfa-wg@w3.org>
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>
</ul>

(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
cases...

Ivan

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


[1]
http://dev.w3.org/2004/PythonLib-IH/Doc-pyRdfa/pyRdfa.transform.ContainersCollections-module.html

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
>>> shortcoming.
>>
>> 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
> are:
> 
> * 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:
>   http://www.webont.org/owled/2006/acceptedLong/submission_12.pdf
> 
> 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
> because:
> 
> * 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
> published.
> 
> Cheers,
> 
> Christoph
> 

-- 

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 08:37:01 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 21 February 2010 08:37:02 GMT