gjhiggins/rdflib — Issue #78: RDFa Parser Update
Author: gjhiggins
Created: 2011-10-19 01:13:39+00:00
State: open
Labels: Component-Parser, Milestone-Release2.5, Priority-Medium, Type-Enhancement

Originally filed by lindstr...@gmail.com on 2009-08-06T23:09:24

The RDFa Parser has been replaced by integrated pyRdfa code (we have permission to do so by Ivan
Herman). The previous parser was quite old and didn't conform to the recommendation. (I also got
an ok by Elias Torres who made the initial implementation.)

I have completed an initial integration of this and committed it to trunk (rev 1691). These are the
changes in short:

* Removed "rdflib/syntax/parsers/RDFaParser.py".
* Added new new "rdflib/syntax/parsers/rdfa/" *package* (new RDFaParser in "__init__.py").
* Adapted "rdflib/plugin.py" to use new parser.

The code is mostly verbatim copied from pyRdfa, with some minor cleanup and documentation
adaptation. This may need further work (doc format, code conventions), but that might be better to
do in a coordinated effort (to encompass more parts in need of cleanup)?

Tests have been adapted:

* Removed old "test/test_rdfa.py" and "test/{ntriples,rdfdiff}.py" (only used by old test).
* Emptied current "test/rdfa" and added a new test module along with a subdir for a copy of the
W3C RDFa testsuite.

Furthermore: the class "IsomorphicTestableGraph" has been moved from
"test_sparql/BisonSPARQLParser/test.py" to a new module "rdflib.graphutils", and renamed to
"IsomorphicGraph". Does anyone have a better name and/or location for that?

(.. Note: IsomorphicGraph is currently used to make up for sparql bugs which cause some tests to
fail where they should not. As of this change, all rdfa tests pass.)

(.. Also note that the "BisonSPARQLParser/test.py" didn't work before and still doesn't.)

I would like to have this change reviewed.