Re: Issue with PyRDFa and Test Case #100 (v3): XMLLiteral with explicit namespace

Manu,

as far as I know these are identical. And this has nothing to do with 
SPARQL, this is purely an RDF/XML quirk. The parseType="Literal" is just 
a shorthand for the generation of a literal of type XMLLiteral. Ie, by 
the time this gets to SPARQL, the difference should evaporate...

See

http://www.w3.org/TR/rdf-syntax-grammar/#section-Syntax-XML-literals

I used this abbreviation in pyRdfa because, at least in my view, the 
output becomes more readable. That is all.


Ivan

Manu Sporny wrote:
> I think there might be an issue with PyRDFa or librdfa? I don't know
> enough about the nuances of RDF/XML to know if this is a problem with
> one or the other, or if there are two different ways of expressing the
> same XML Literal.
> 
> If you look at librdfa's output for TC100:
> http://rdfa.digitalbazaar.com/librdfa/rdfa2rdf.py?uri=http://www.w3.org/2006/07/SWD/RDFa/testsuite/xhtml1-testcases/0100.xhtml
> 
> and PyRDFa's output for TC100:
> http://www.w3.org/2007/08/pyRdfa/extract?uri=http://www.w3.org/2006/07/SWD/RDFa/testsuite/xhtml1-testcases/0100.xhtml
> 
> you will notice that librdfa puts a @datatype on the XML Literal in the
> RDF/XML and PyRDFa puts a @parseType on the XML Literal.
> 
> Are those equivalent? If so, how do you test for @parseType in SPARQL?
> (info: You can't just leave the datatype off of the SPARQL query - it
> doesn't seem to work.)
> 
> ------------------------------------------------------------------
> 
> Per our discussion and resolution on 5/29:
> 
>    RESOLUTION: Add valid cases of XML Literals as requested by
>    implementers to TC 100-103 and add comments to tell other
>    implementors that the tests may fail due to XML Literal issues.
> 
> The following SPARQL returns TRUE for librdfa and FALSE for PyRDFa.
> 
> ====================== Test Case 100 =============================
> 
> ---------------------Test Case 100 XHTML--------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
> "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
> <html 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">
>  <head profile="http://www.w3.org/1999/xhtml/vocab#
> http://www.w3.org/2005/10/profile">
>   <title>Test 0100</title>
>  </head>
>   <body>
>    <div about="http://www.example.org">
>       <h2 property="ex:example" datatype="rdf:XMLLiteral">Some text here
> in <strong>bold</strong> and an svg rectangle: <svg:svg><svg:rect
> svg:width="200" svg:height="100"/></svg:svg></h2>
>  </div>
>   </body>
> </html>
> -----------------------------------------------------------------
> 
> ---------------------Test Case 100 SPARQL -----------------------
> # Some parsers may generate XML Literals that differ from the ones
> # shown below. The only requirement for XML Literal tests is that
> # the RDF graph that is generated is equivalent to the one expressed
> # in the XHTML (preservation of whitespace and namespaces that are
> # utilized in the XML Literal).
> 
> 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:rect></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:svg=\"http://www.w3.org/2000/svg\">bold</strong> and an svg
> rectangle: <svg:svg xmlns=\"http://www.w3.org/1999/xhtml\"
> xmlns:svg=\"http://www.w3.org/2000/svg\"><svg:rect svg:height=\"100\"
> svg:width=\"200\"/></svg:svg>"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>
>  .
> }
> }
> -----------------------------------------------------------------
> 
> -- 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 Monday, 9 June 2008 08:36:42 UTC