W3C home > Mailing lists > Public > public-rdf-in-xhtml-tf@w3.org > May 2008

Re: [RDFa TC] Update

From: Ivan Herman <ivan@w3.org>
Date: Tue, 27 May 2008 09:28:21 +0200
Message-ID: <483BB815.4090504@w3.org>
To: Manu Sporny <msporny@digitalbazaar.com>
Cc: "Hausenblas, Michael" <michael.hausenblas@joanneum.at>, public-rdf-in-xhtml-tf@w3.org
These b...dy xml literals again... And we always fall back to the same 
issue, namely that, although two xml literals may be identical in the 
xml infoset sense or, alternatively, in their canonical xml sense, the 
sparql implementations may not compare these properly.

Manu, I think that (1) what you do on the output is absolutely correct 
(2) the trick with the UNION on the SPARQL side may help in some cases 
but, (3) it may not help in all cases. In other words, the automatic 
testing may fail for all test cases where xml literals are involved and 
we should be prepared to validate those for each implementation 
manually. In which case it might not be really necessary to complicate 
the SPARQL unnecessary

Another example: I have not run my latest version of pyRdfa against the 
tests, I wait for everything to stabilize. But I may have another issue: 
I am not sure whether the generated XML output uses the << ' >> or the 
<< " >> character for the attributes. Both are valid but, for example, 
SPARQler used to fail on the equality (at least in some versions).:-(

Cheers

Ivan

Manu Sporny wrote:
> Hausenblas, Michael wrote:
>> Note that in TC100, TC101, TC102, TC103 I've used the same markup in the
>> SPARQL as in the XHTML (<svg:rect svg:width="200" svg:height="100"/>
>> rather than <svg:rect
>> svg:width="200" svg:height="100"></svg:rect>) as I don't see why this
>> should change. Thoughts?
> 
> I think what you've done is correct, Michael - but it causes a bit of a
> headache for the librdfa parser, which is SAX-based. This is a general
> issue with non-DOM based parsers.
> 
> When the XML parser notifies librdfa's parser that an element has ended,
> there is no way for me to know if the author did this:
> 
> <svg:rect></svg:rect>
> 
> or this:
> 
> <svg:rect />
> 
> or this
> 
> <svg:rect/>
> 
> This means that even though the XML Literal is syntactically correct
> (somebody correct me if I'm wrong, not 100% positive of the previous
> statement), it will fail Test Cases 100-103. librdfa fails Test Cases
> 100-103 right now because of this issue. I -could- tweak librdfa's
> output to generate what the test expects, but I think that wouldn't
> address the issue. I think the Unit Tests need to change and have an
> alternate that they support:
> 
> -------------------------------------------------------------------------
> ASK WHERE {{
>  <http://www.example.org> <http://example.org/rdf/example> "Some text
> here in <strong xmlns=\"http://www.w3.org/1999/xhtml\"
> xmlns:dc=\"http://purl.org/dc/elements/1.1/\"
> xmlns:ex=\"http://example.org/rdf/\"
> xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"
> xmlns:svg=\"http://www.w3.org/2000/svg\">bold</strong> and an svg
> rectangle: <svg:svg xmlns=\"http://www.w3.org/1999/xhtml\"
> xmlns:dc=\"http://purl.org/dc/elements/1.1/\"
> xmlns:ex=\"http://example.org/rdf/\"
> xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"
> xmlns:svg=\"http://www.w3.org/2000/svg\"><svg:rect svg:width=\"200\"
> svg:height=\"100\"/></svg:svg>"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>
> 
> . }
> 
> UNION
> 
> { <http://www.example.org> <http://example.org/rdf/example> "Some text
> here in <strong xmlns=\"http://www.w3.org/1999/xhtml\"
> xmlns:dc=\"http://purl.org/dc/elements/1.1/\"
> xmlns:ex=\"http://example.org/rdf/\"
> xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"
> xmlns:svg=\"http://www.w3.org/2000/svg\">bold</strong> and an svg
> rectangle: <svg:svg xmlns=\"http://www.w3.org/1999/xhtml\"
> xmlns:dc=\"http://purl.org/dc/elements/1.1/\"
> xmlns:ex=\"http://example.org/rdf/\"
> xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"
> xmlns:svg=\"http://www.w3.org/2000/svg\"><svg:rect svg:width=\"200\"
> svg:height=\"100\"></svg:rect></svg:svg>"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>
> .
> }}
> -------------------------------------------------------------------------
> 
> The only change is allowing both alternatives of the XML Literal
> including /> as well as </svg:rect> to successfully pass the test. I'd
> prefer if TCs 100-103 were updated to reflect this realization (unless,
> of course, my understanding of what a "correct" XML Literal is wrong).
> 
> -- manu
> 

-- 

Ivan Herman, W3C Semantic Web Activity Lead
Home: http://www.w3.org/People/Ivan/
PGP Key: http://www.ivan-herman.net/pgpkey.html
FOAF: http://www.ivan-herman.net/foaf.rdf


Received on Tuesday, 27 May 2008 07:28:57 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 May 2008 07:28:59 GMT