NEW RDFa Test Suite (XHTML1.1, HTML4 and HTML5)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

NEW RDFa Test Suite (XHTML1.1, HTML4 and HTML5)

Manu Sporny
I spent some time this weekend re-writing the RDFa test harness so that
it would let us test XHTML1.1, HTML4 and HTML5 using a unified set of
tests. This will help us support more languages while reducing the test
writing burden. The old test harness[1] still exists at the old URL.

What this means for developers:

You can now test your RDFa processor against XHTML1.1, HTML4 and HTML5.
The only part that doesn't work are the XMLLiteral tests for HTML4 and
HTML5, but those should be fixed in the next 2-3 weeks. Once they are,
you'll be able to see if your processor is 100% conformant across all
HTML family languages.

General:

The new RDFa test suite is designed to grow as other languages include
RDFa (like HTML4, HTML5, ODF and SVG):

http://rdfa.digitalbazaar.com/test-suite/

Features of this new test harness:

* Allows unified testing of XHTML1.1, HTML4 and HTML5
* Serves documents with the correct Content-Type and document extension,
  for example: http://rdfa.digitalbazaar.com/test-suite/test-cases/0001
* Rewrites the XHTML source and SPARQL query files to proper HTML4 and
  HTML5.

Changes that were made:

* Much of the test harness code (Python and Javascript) was heavily
  modified.
* Many of the SPARQL files needed to refer to the new test suite
  URL, so the test suite URLs changed in the SPARQL queries. We will
  need to verify that I didn't screw anything up when moving everything
  over.

Changes that were not made:

* I still haven't fixed the XMLLiteral tests as some new questions came
  up while working on this update and subsequent updates to librdfa.
  I'll raise some of these issues in a separate e-mail.
* There were no other changes to the SPARQL other than the base URL
  for the test harness.

-- manu

[1] http://rdfa.digitalbazaar.com/rdfa-test-harness/

--
Manu Sporny (skype: msporny, twitter: manusporny)
President/CEO - Digital Bazaar, Inc.
blog: The Pirate Bay and Building an Equitable Culture
http://blog.digitalbazaar.com/2009/08/30/equitable-culture/

Reply | Threaded
Open this post in threaded view
|

Re: NEW RDFa Test Suite (XHTML1.1, HTML4 and HTML5)

Toby Inkster-4
On Sun, 2009-09-20 at 19:00 -0400, Manu Sporny wrote:
> I spent some time this weekend re-writing the RDFa test harness so
> that it would let us test XHTML1.1, HTML4 and HTML5 using a unified
> set of tests.

I've been testing RDF::RDFa::Parser against this test suite. (It was
already passing the ones on the W3C website.) I have a query:

HTML4 and HTML5 include test case 0113, which includes the following:

  <body>
    <span about="#a" property="dc:title"></span>
    <span about="#b" property="dc:title" />
  </body>

And claims that the literals generated from each <span> should be
identical. However, in HTML 4, "/>" does not represent a self-closing
tag. Strictly speaking, if you want to follow the formal SGML SHORTTAG
rules, I believe it's equivalent to this:

  <body>
    <span about="#a" property="dc:title"></span>
    <span about="#b" property="dc:title" >&gt;
  </body>

Though that's invalid because the second <span> element is never closed.
So, strictly following HTML4, the best literal a parser could come up
with would be ">\n  ". Using HTML5 parsing, it would be "\n  ". Either
way, I don't think this test should be included in the HTML test cases.
If it is to be included, "" should not be the literal expected from the
second <span>.

Right now I'm passing all XHTML1 tests, and all but three of the HTML
tests (failing the same three in both HTML4 and HTML5).

--
Toby A Inkster
<mailto:[hidden email]>
<http://tobyinkster.co.uk>


Reply | Threaded
Open this post in threaded view
|

Re: NEW RDFa Test Suite (XHTML1.1, HTML4 and HTML5)

Toby Inkster-4
On Mon, 2009-11-30 at 23:03 +0000, Toby Inkster wrote:
> Right now I'm passing all XHTML1 tests, and all but three of the HTML
> tests (failing the same three in both HTML4 and HTML5).

Last night I spent ages puzzling over why I was failing test 0121 in
HTML4 and HTML5, but not XHTML1, and today it's come to me out of
nowhere.

<p about="http://example.org/">
  <span about="[]" property="dc:title">Test Case 0121</span>
  checks to make sure RDFa processors resolve the empty CURIE correctly.
  <p resource="[]">
    <span property="dc:contributor">Shane McCarron</span>
    contributed to this test.
  </p>
</p>

In HTML, paragraphs cannot be nested. (In XHTML1 this is invalid too,
but well-formed.) Thus, in parsing, the opening of the second paragraph
automatically closes the first paragraph. Thus the above parses as if it
were:

<p about="http://example.org/">
  <span about="[]" property="dc:title">Test Case 0121</span>
  checks to make sure RDFa processors resolve the empty CURIE correctly.
</p>
<p resource="[]">
  <span property="dc:contributor">Shane McCarron</span>
  contributed to this test.
</p>

So the subject of the second triple is the implicit about="" on the
<body> element. So, as far as HTML parsing is concerned, my parser is
right and the test case's SPARQL result is wrong.

Suggestion: replace the second <p> element with <b> or something.

My suggestion to drop test case 0113 from the HTML test suites still
stands too.

As I believe these two test cases in the HTML test suites are erroneous,
I won't be changing my parser to "pass" them. Other than that,
RDF::RDFa::Parser is now passing all the HTML4, HTML5 and XHTML1 tests.

--
Toby A Inkster
<mailto:[hidden email]>
<http://tobyinkster.co.uk>