Re: list-expansion in RDFa

On Feb 21, 2010, at 20:19 , Gregg Kellogg wrote:

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

This is exactly what happens in my version...:-)

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

Yes, at present, the <li> of a <ul>/<ol> automatically expands. Actually, in my current approach, the whole mechanism is triggered for <ul>/<ol> only, which is not necessarily good.

I presume that, in a more general case, we would need some extra hints, a bit compared to the parseType feature of RDF/XML, that would identify elements of collections and containers. But I am not 100% sure we can simply piggy back on the current attribute sets. My problem with, eg, your approach of using rdf:li is that that this would suggest that the final RDF graph includes a predicate of the name 'rdf:li'. Which is not the case. There would therefore be a confusion on the usage of the rdf:li CURIE to specify something that is _not_ a URI, but an artifact of RDFa. (Yes, I know that RDF/XML does that, too. And, to be honest, I do not like that either:-(

But we are getting into the details...

Ivan

> 
> Gregg
> 
> 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>
>> </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
>> 
> 


----
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

Received on Monday, 22 February 2010 09:09:13 UTC