Re: RDFa in HTML vs XHTML

On Nov 11, 2011, at 1:19 PM, Jeni Tennison wrote:

> Gregg, Ivan,
> 
> Can you clarify what the relationship is between the XHTML+RDFa 1.1 spec and the HTML+RDFa 1.1 spec?

AFAIK, they are pretty much equivalent; one is published by the RDFWAWG and other other by HTMLWG due to historical reasons. The HTML+RDFa spec may go on to add some additional meaning to <time> and <data> tags, but this is still under discussion.

> HTML5 makes the distinction between the HTML DOM and its serialisations into HTML or XHTML syntax [1] and the polyglot spec talks about how to make a document that will generate the same DOM when interpreted as HTML or as XHTML [2].
> 
> Is it the case that a polyglot document with embedded RDFa might be interpreted differently based on whether it's served as text/html or as application/xhtml+xml? If so, under what circumstances would it generate different data?

The only possible difference I could see would be in treatment of XMLLiteral values, but I'm not sure what might cause this to be interpreted differently. RDFa is about attribute, which are in no namespace, so it should be pretty independent of the content type.


> Is there a way of creating polyglot RDFa documents that will be interpreted in the same way? What restrictions does that place on RDFa markup?

One area that could be different is if HTML is not well-formed and is interpreted as XML. If parsed by a forgiving HTML parser, this could give a different interpretation than if it is parsed as XML. For example:

<div about="">
  <p property="rdf:value" typeof="">A paragraph.
  <p property="rdf:value" typeof="">Another paragraph.
</div>

Because the paragraphs aren't closed, it would be possible if parsing as a SAX document that different RDF would be generated. This might be:

<> rdf:value [ rdf:value []].

where the intent was

<> rdf:value [], [] .

An HTML parser should create a DOM that results in the later interpretation. Best advice is to use well-formed XHTML when generating documents, whether they're served as text/html or application/xhtml+xml.

Do you have another potential use case that might be ambiguous?

> Thanks for any insight you can give on this,
> 
> Jeni
> 
> [1] http://dev.w3.org/html5/spec/Overview.html#html-vs-xhtml
> [2] http://dev.w3.org/html5/html-xhtml-author-guide/
> -- 
> Jeni Tennison
> http://www.jenitennison.com
> 

Received on Friday, 11 November 2011 21:39:18 UTC