Re: The Minimal Set of Attributes for RDFa

On 29 May 2009, at 03:49, Oshani Seneviratne wrote:

> I am trying to figure out an efficient way to determine whether a
> given document has valid RDFa in it or not, without having to parse
> the entire DOM.


ARC2 has an interesting method -- the document is parsed as RDFa if  
any of the following are true:

1. /html@version contains "XHTML+RDFa".
2. Any tag has an xmlns:* attribute (excluding the XHTML namespace).
3. Any tag contains one of these attributes: about, typeof, property.

That said, you should be able to parse any XHTML (and any pre-HTML5  
HTML) using the RDFa processing algorithm and get sensible results  
from it, so determining which documents "are" or "are not" RDFa is  
not usually necessary, except perhaps as an optimisation.

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

Received on Sunday, 31 May 2009 20:25:53 UTC