Re: RDFa Lite and typeof influence

On Apr 20, 2012, at 11:43 AM, Alex Milowski 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.  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.

RDFa 1.1 Lite is pretty quite about this, but of course, it's intended to be a terse simple document. RDFa Core 1.1 says the following in 8.1.1.3 (Typing resources with @typeof)

[[[
Finally, @typeof also has the additional feature of creating a new context for statements, in case no other attributes define any. 
]]]

Basically, @typeof is similar to the combination of @itemscope and @itemtype in microdata. If you leave it out, in the absense of something else defining a resource, it can certainly have profound impacts.

BTW, do you have a public distiller endpoint? We should add your distiller to the RDFa Test Suite and into the tools section, if you feel you're sufficiently far along in your development.

Gregg

> -- 
> --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:53:42 UTC