W3C home > Mailing lists > Public > public-rdfa-wg@w3.org > February 2012

Test #0198 is invalid in RDFa 1.1

From: Ivan Herman <ivan@w3.org>
Date: Tue, 7 Feb 2012 16:10:13 +0100
To: W3C RDFWA WG <public-rdfa-wg@w3.org>
Message-Id: <83F2F36F-53AC-4C2C-A8A2-9C576E72CB59@w3.org>
The test looks as follows:

<html 
prefix="foaf: http://xmlns.com/foaf/0.1/ 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>

The corresponding SPARQL says:

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, that is not what RDFa 1.1 generates. Indeed, the RDFa processor sets the xmlns declarations in the XML Literal _only for the XML namespaces_ and not for the values of the @prefix statements. This is said in step 11 of the processing rules. Ie, the generated XML Literal is

@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

<http://www.example.org/me#mark> a foaf:Person;
    foaf:firstName "Mark";
    foaf:name "<span property=\"foaf:firstName\">Mark</span> <span property=\"foaf:surname\">Birbeck</span>"^^rdf:XMLLiteral;
    foaf:surname "Birbeck" .


We _could_ change the rules for the XML Literal part to include the @prefix declarations, too, but at some point we decided not to. I do not remember what were the exact reasons, I must admit, but I am not keen on reopening a technical issue. In any case, I think this test should not be used for RDFa 1.1.

However, the test's real goal is to check that the processor goes 'down' the XML tree to generate Mark's name and surname. A possibility would be to modify the test and use xmlns instead of prefix, but that then the test should be disabled in HTML5.

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 Tuesday, 7 February 2012 15:10:59 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:05:30 UTC