W3C home > Mailing lists > Public > public-rdfa-wg@w3.org > April 2012

RDFa Lite and typeof influence

From: Alex Milowski <alex@milowski.com>
Date: Fri, 20 Apr 2012 11:43:17 -0700
Message-ID: <CABp3FNKKdt5YWs7Unu+Z4N_2s39L4wfbC8QAO3JB6=h3EiMyHw@mail.gmail.com>
To: W3C RDFWA WG <public-rdfa-wg@w3.org>
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.  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.

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 18:43:47 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 27 April 2012 04:55:20 GMT