Re: RDFa Lite and typeof influence

Hi Alex,

On Fri, Apr 20, 2012 at 2:43 PM, Alex Milowski <alex@milowski.com> wrote:

> I've been exploring what can be expressed using only RDFa Lite and I
> keep running into a fragile bit of markup that I find disturbing.  The
> results of a small change in the markup on the triples is dramatic.
>
> Consider this example:
>
> <html xmlns="http://www.w3.org/1999/xhtml" vocab="
> http://www.example.org/O/">
> <head><title>typeof test</title></head>
> <body>
> <div typeof="A">
> <div property="part" typeof="B">
> <p property="name">value</p>
> <p>other text</p>
> </div>
> </div>
> </body>
> </html>
>
> the triples are:
>
> <>      <http://www.w3.org/ns/rdfa#usesVocabulary>      <
> http://www.example.org/O/>
> <_:1>   <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>       <
> http://www.example.org/O/A>
> <_:1>   <http://www.example.org/O/part> <_:2>
> <_:2>   <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>       <
> http://www.example.org/O/B>
> <_:2>   <http://www.example.org/O/name> "value"
>
> Now, if you remove (by mistake?) the second @typeof=B attribute, you
> get these triples:
>
> <>      <http://www.w3.org/ns/rdfa#usesVocabulary>      <
> http://www.example.org/O/>
> <_:1>   <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>       <
> http://www.example.org/O/A>
> <_:1>   <http://www.example.org/O/part> " value other text "
> <_:1>   <http://www.example.org/O/name> "value"
>
> So, a simple change causes the @property=part to be interpreted in a
> very different way as the object becomes a blank node.


I'm not sure how a processor would know otherwise whether the object is a
value or a whole new resource, you need a way to specify both of these
features somehow. yes, as Gregg indicated, it's the same behavior you get
in microdata. Likewise in HTML, forgetting to close elements can
dramatically change your DOM tree and the rendering of your page.


> Similarly, if
> you add an 'about' attribute on the same element (e.g. <div
> about="#foo" property=part" typeof="B">), you won't get the blank
> node.
>

RDFa Lite was change to use @resource instead of @about for this reason.
@about is an advanced attribute and I would not recommended to use it
unless you know what you're doing. Just use @resource.

Steph.


>
> I looked at the current RDFa Lite specification and it doesn't say
> much about the dramatic influence the "typeof" attribute has over the
> triples generated.  I'm not sure there is much about that in RDFa COre
> 1.1 either.
>
> --
> --Alex Milowski
> "The excellence of grammar as a guide is proportional to the paucity of the
> inflexions, i.e. to the degree of analysis effected by the language
> considered."
>
> Bertrand Russell in a footnote of Principles of Mathematics
>
>

Received on Friday, 20 April 2012 20:01:08 UTC