[whatwg] RDFa is to structured data, like canvas is to bitmap and SVG is to vector

Toby A Inkster mail at tobyinkster.co.uk
Sun Jan 18 15:29:17 PST 2009


Dan Brickley wrote:

> ... I guess the fact that @property is supposed to be CURIE-only  
> isn't a
> problem with parsers since this can be understood as a CURIE with  
> no (or
> empty) substitution token.

Actually, most RDFa parsers will break if full URIs are used in RDFa  
attributes: in RDFa all CURIEs need a prefix which is a string of  
zero or more alphanumeric characters, dashes and hyphens followed by  
a colon (and yes, the empty string is allowed - but it is permanently  
bound to <http://www.w3.org/1999/xhtml/vocab#>). The proposed  
recommendation (IIRC, that's the current status) for CURIEs *does*  
actually allow for unprefixed CURIES, but RDFa enforces extra  
conditions. (As it was published before the CURIE spec, which is a  
spin-off of RDFa.)

A suggestion I've heard for using full URIs is:

	<html xmlns:http="http:">
	  <title property="http://purl.org/dc/terms/title">Foo</title>
	</html>

Which should theoretically work according to the reference algorithm  
in the RDFa syntax document, however it does (I believe) break the  
XML Namespaces spec. (Though that wouldn't be a problem if an  
alternative, non-xmlns, syntax were adopted for CURIE prefix  
binding.) It wouldn't surprise me if a few RDFa parsers had issues  
with this caused by the front-end XML parser they use.

So RDFa, as it is currently defined, does need a CURIE binding  
mechanism. XML namespaces are used for XHTML+RDFa 1.0, but given that  
namespaces don't work in HTML, an alternative mechanism for defining  
them is expected, and for consistency would probably be allowed in  
XHTML too - albeit in a future version of XHTML+RDFa, as 1.0 is  
already finalised. (I don't speak for the RDFa task force as I am not  
a member, but I would be surprised if many of them disagreed with me  
strongly on this.)

Back to when I said "most RDFa parsers will break if full URIs are  
used in RDFa attributes". The Perl library RDF::RDFa::Parser doesn't,  
so if you want to do any testing with full URIs, it can be found on  
CPAN. Full URIs are a pain to type though - I certainly prefer using  
CURIEs.

-- 
Toby A Inkster
<mailto:mail at tobyinkster.co.uk>
<http://tobyinkster.co.uk>






More information about the whatwg mailing list