Subtle namespace difference with RDFa+HTML5 for XML Literals...

Test #198:

<!DOCTYPE html>
<html 
xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>
  <head>
	<title>Test 0198</title>
	<base href="http://www.example.org/me" />
</head>
<body>
      <div id="mark" about="#mark" typeof="foaf:Person">
        <h2 property="foaf:name" datatype="rdf:XMLLiteral"><span 
property="foaf:firstName">Mark</span> <span 
property="foaf:surname">Birbeck</span></h2>
      </div>
 </body>
</html>

With a SPARQL request:

ASK WHERE {
 <http://www.example.org/me#mark> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
 <http://www.example.org/me#mark> <http://xmlns.com/foaf/0.1/name>
 "<span property=\"foaf:firstName\" xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:foaf=\"http://xmlns.com/foaf/0.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">Mark</span> <span property=\"foaf:surname\" xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:foaf=\"http://xmlns.com/foaf/0.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">Birbeck</span>"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .
 <http://www.example.org/me#mark> <http://xmlns.com/foaf/0.1/firstName> "Mark" .
 <http://www.example.org/me#mark> <http://xmlns.com/foaf/0.1/surname> "Birbeck" .
}

However. While it is o.k. to have the rdf and foaf namespaces copied into the generated XML Literal, the  xmlns="http://www.w3.org/1999/xhtml" is actually incorrect. In the case of XHTML1 this namespace indeed appears in the file, can therefore be copied into the XMLLiteral, ie, that test is o.k. for XHTML1+RDFa, that namespace does *not* appear for HTML5, ie, it should not be added to the XML Literal.

We can create a separate test for HTML5+RDFa, doing the same but with a different SPARQL. On the other hand, in view of the controversial nature of the xmlns usage in HTML5, I would probably be o.k. to remove it from the HTML5 branch altogether.

I am not sure about XHTML5. Does the namespace appears for that one? If so, it is fine to have it for that one...

Ivan



----
Ivan Herman, W3C Semantic Web Activity Lead
Home: http://www.w3.org/People/Ivan/
mobile: +31-641044153
FOAF: http://www.ivan-herman.net/foaf.rdf

Received on Friday, 9 March 2012 16:32:36 UTC