- From: Ben Adida <ben@adida.net>
- Date: Mon, 09 Jul 2007 12:30:03 -0700
- To: RDFa <public-rdf-in-xhtml-tf@w3.org>, SWD WG <public-swd-wg@w3.org>
Hi all, It appeared, at the last telecon, that the state of @rel in RDFa is not well understood. That's not surprising, because it turns out we haven't fully explored all the edge cases! I've tried to resolve the edge cases, and, to make things simple, I'm going to present the resulting parsing rules, and explain *afterwards* what the possible contention might be: RULES - @rel can appear on any element, where it indicates the predicate of a triple. - All values are considered, with rel="foo" interpreted as a local concept, except for special reserved words rel="next" which means rel="xhtml:next". - @rel can take multiple space-separated values, in which case the rules apply for each such value in the same way. - when @rel appears with an @href, @href indicates the object of the triple. - when @rel appears WITHOUT an @href, the object of the triple is a bnode associated with that element, except if the element has an @id, which makes the subject the URI of that ID. (Note how @about does not play a role here in object resolution... since it is the subject! That's the point of contention we address later.) - all contained statements default to having as subject the object of the @rel triple, whether it is a bnode, a URI indicated by @id, or the URI of the @href if there is one. - @class (or whatever it ends up being) and other attributes that may generate triples (e.g. @role), on the same element as @rel, have, as subject, the object of the @rel triple, *ignoring any potential @about on the same element*. Examples: ========= 1) <div rel="foaf:topic" class="cal:Vevent"> <span property="cal:dtstart">2007-07-07</span> </div> yields <> foaf:topic [rdf:type cal:Vevent ; cal:dtstart "2007-07-07"] . 2) <div about="#foo" rel="foaf:topic" class="cal:Vevent"> <span property="cal:dtstart">2007-07-07</span> </div> yields <#foo> foaf:topic [rdf:type cal:Vevent ; cal:dtstart "2007-07-07"] . 3) (assuming @href can go anywhere) <div about="#foo" rel="foaf:topic" href="#event_0" class="cal:Vevent"> <span property="cal:dtstart">2007-07-07</span> </div> yields <#foo> foaf:topic <#event_0> . <#event_0> rdf:type cal:Vevent ; cal:dtstart "2007-07-07" . THE POINT of CONTENTION The point of contention may be that, when one adds @rel, it effectively *changes* what @class applies to, overriding the @about. I believe that makes sense, since it's overriding the @about for all contained statements already, and we said that @class was syntactic sugar for a contained rdf:type declaration. But it's important to understand this detail! So, when you say: <div about="#foo" class="cal:Vevent"> you mean <#foo> rdf:type cal:Vevent . but when you say <div about="#foo" class="cal:Vevent" rel="foaf:topic"> you mean <#foo> foaf:topic [rdf:type cal:Vevent] . There are other ways to resolve this contention, but I think this is the only consistent one: @about is overridden by the object of the @rel for all contained statements, and the object of the @rel is affected only by @href and @id. -Ben
Received on Monday, 9 July 2007 19:30:15 UTC