pyRdfa and the RDFa Test Suite

After the RDFa excitement at the SWD face-to-face last week I
downloaded Ivan's pyRdfa and played around with it a bit on the plane
ride back. In the process I shuffled a few things around and made a
tarball available if anyone wants to take a look:

  http://inkdroid.org/tmp/pyRdfa.tar.gz

Basically all I did was:

- pushed the src down into a pyRdfa directory
- created a setup.py that allows easy distribution on the Python Cheeseshop
- created test.py that runs the tests from the RDFa Test Suite

Implementing the tests was pretty fun, because it executes a SPARQL
query against the test manifest, and then uses the result to
dynamically create a set of unit tests (using python's unittest).
Unfortunately not all the tests pass, and I'm not entirely clear if
this is because of rdflib sparql support or what. Results are below.

I probably should have just sent this privately to Ivan at this
point...but i thought the usage of the manifest might have been
interesting to others.

//Ed

--

test_0001 (test.XhtmlTests) ... ok
test_0002 (test.XhtmlTests) ... ok
test_0003 (test.XhtmlTests) ... ok
test_0004 (test.XhtmlTests) ... FAIL
test_0005 (test.XhtmlTests) ... FAIL
test_0006 (test.XhtmlTests) ... ok
test_0007 (test.XhtmlTests) ... ok
test_0008 (test.XhtmlTests) ... ok
test_0009 (test.XhtmlTests) ... ok
test_0010 (test.XhtmlTests) ... ok
test_0011 (test.XhtmlTests) ... FAIL
test_0012 (test.XhtmlTests) ... FAIL
test_0013 (test.XhtmlTests) ... FAIL
test_0014 (test.XhtmlTests) ... FAIL
test_0015 (test.XhtmlTests) ... ok
test_0016 (test.XhtmlTests) ... ok
test_0017 (test.XhtmlTests) ... FAIL
test_0018 (test.XhtmlTests) ... ok
test_0019 (test.XhtmlTests) ... ok
test_0020 (test.XhtmlTests) ... ok
test_0021 (test.XhtmlTests) ... ok
test_0022 (test.XhtmlTests) ... FAIL
test_0023 (test.XhtmlTests) ... ok
test_0024 (test.XhtmlTests) ... ok
test_0025 (test.XhtmlTests) ... ok
test_0026 (test.XhtmlTests) ... ok
test_0027 (test.XhtmlTests) ... ok
test_0028 (test.XhtmlTests) ... FAIL
test_0029 (test.XhtmlTests) ... FAIL
test_0030 (test.XhtmlTests) ... ok
test_0031 (test.XhtmlTests) ... ok
test_0032 (test.XhtmlTests) ... ok
test_0033 (test.XhtmlTests) ...
/usr/lib/python2.5/site-packages/rdflib-2.4.0-py2.5-linux-i686.egg/rdflib/sparql/bison/SPARQLEvaluate.py:63:
SyntaxWarning: The verbatim interpretation of explicit bnode
identifiers is contrary to (current) DAWG stance
  warnings.warn("The verbatim interpretation of explicit bnode
identifiers is contrary to (current) DAWG stance",SyntaxWarning)
FAIL
test_0034 (test.XhtmlTests) ... ok
test_0035 (test.XhtmlTests) ... ok
test_0036 (test.XhtmlTests) ... ok
test_0037 (test.XhtmlTests) ... ok
test_0038 (test.XhtmlTests) ... ok
test_0039 (test.XhtmlTests) ... ok
test_0040 (test.XhtmlTests) ... ok
test_0041 (test.XhtmlTests) ... ok
test_0042 (test.XhtmlTests) ... ok
test_0043 (test.XhtmlTests) ... ok
test_0044 (test.XhtmlTests) ... ok
test_0045 (test.XhtmlTests) ... ok
test_0046 (test.XhtmlTests) ... FAIL
test_0047 (test.XhtmlTests) ... ok
test_0048 (test.XhtmlTests) ... FAIL
test_0049 (test.XhtmlTests) ... ok
test_0050 (test.XhtmlTests) ... FAIL
test_0051 (test.XhtmlTests) ... FAIL
test_0052 (test.XhtmlTests) ... ok
test_0053 (test.XhtmlTests) ... ok
test_0054 (test.XhtmlTests) ... ok
test_0055 (test.XhtmlTests) ... ok
test_0056 (test.XhtmlTests) ... ERROR

======================================================================
ERROR: test_0056 (test.XhtmlTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ed/projects/pyRdfa/test.py", line 33, in test
    self.assertTrue(sparql_processor.query(sparql), title)
  File "build/bdist.linux-i686/egg/rdflib/sparql/bison/Processor.py",
line 28, in query
    strOrQuery = Parse(strOrQuery, DEBUG)
  File "build/bdist.linux-i686/egg/rdflib/sparql/bison/Processor.py",
line 18, in Parse
    return p.parse(query)
SyntaxError: parse error at line 8, column 2: reached end-of-input,
expecting 'RIGHT_CURLY'

======================================================================
FAIL: test_0004 (test.XhtmlTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ed/projects/pyRdfa/test.py", line 33, in test
    self.assertTrue(sparql_processor.query(sparql), title)
AssertionError: @xml:base

======================================================================
FAIL: test_0005 (test.XhtmlTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ed/projects/pyRdfa/test.py", line 33, in test
    self.assertTrue(sparql_processor.query(sparql), title)
AssertionError: CURIEs

======================================================================
FAIL: test_0011 (test.XhtmlTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ed/projects/pyRdfa/test.py", line 33, in test
    self.assertTrue(sparql_processor.query(sparql), title)
AssertionError: XMLLiteral

======================================================================
FAIL: test_0012 (test.XhtmlTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ed/projects/pyRdfa/test.py", line 33, in test
    self.assertTrue(sparql_processor.query(sparql), title)
AssertionError: @xml:lang

======================================================================
FAIL: test_0013 (test.XhtmlTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ed/projects/pyRdfa/test.py", line 33, in test
    self.assertTrue(sparql_processor.query(sparql), title)
AssertionError: @xml:lang inheritance

======================================================================
FAIL: test_0014 (test.XhtmlTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ed/projects/pyRdfa/test.py", line 33, in test
    self.assertTrue(sparql_processor.query(sparql), title)
AssertionError: @datatype, xsd:integer

======================================================================
FAIL: test_0017 (test.XhtmlTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ed/projects/pyRdfa/test.py", line 33, in test
    self.assertTrue(sparql_processor.query(sparql), title)
AssertionError: Related blanknodes

======================================================================
FAIL: test_0022 (test.XhtmlTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ed/projects/pyRdfa/test.py", line 33, in test
    self.assertTrue(sparql_processor.query(sparql), title)
AssertionError: meta with parent @id

======================================================================
FAIL: test_0028 (test.XhtmlTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ed/projects/pyRdfa/test.py", line 33, in test
    self.assertTrue(sparql_processor.query(sparql), title)
AssertionError: @xml:lang and @datatype

======================================================================
FAIL: test_0029 (test.XhtmlTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ed/projects/pyRdfa/test.py", line 33, in test
    self.assertTrue(sparql_processor.query(sparql), title)
AssertionError: markup stripping with @datatype

======================================================================
FAIL: test_0033 (test.XhtmlTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ed/projects/pyRdfa/test.py", line 33, in test
    self.assertTrue(sparql_processor.query(sparql), title)
AssertionError: simple chaining test with bNode

======================================================================
FAIL: test_0046 (test.XhtmlTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ed/projects/pyRdfa/test.py", line 33, in test
    self.assertTrue(sparql_processor.query(sparql), title)
AssertionError: @instanceof with @rel present, no @href, @resource, or @about

======================================================================
FAIL: test_0048 (test.XhtmlTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ed/projects/pyRdfa/test.py", line 33, in test
    self.assertTrue(sparql_processor.query(sparql), title)
AssertionError: @instanceof with @about and @rel present, no @resource

======================================================================
FAIL: test_0050 (test.XhtmlTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ed/projects/pyRdfa/test.py", line 33, in test
    self.assertTrue(sparql_processor.query(sparql), title)
AssertionError: @instanceof without anything else

======================================================================
FAIL: test_0051 (test.XhtmlTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ed/projects/pyRdfa/test.py", line 33, in test
    self.assertTrue(sparql_processor.query(sparql), title)
AssertionError: @instanceof with a single @property

----------------------------------------------------------------------
Ran 56 tests in 4.364s

FAILED (failures=15, errors=1)

Received on Friday, 12 October 2007 16:39:43 UTC