A basic RDF XML validation stylesheet

By James Carlyle. I've put together a basic XSLT 1.0 stylesheet to validate RDF in XML. It has been tested against all the simple negative tests in the W3C RDF test suite. It produces no output for all the positive tests (i.e. it finds them all valid), and produces output for all the negative tests (i.e. it finds them all invalid). The output from the stylesheet looks something like this: # ERROR <rdf:ID rdf:resource="http://example.org/node2"/> # ERROR rdfms-rdf-names-use/error013.rdf : ID is forbidden as a property element name. There is a simple error message (taken from the test case) and a snippet of the original document to help provide some context. The checks are specified using XPath expressions. If I've misunderstood the RDF/XML syntax specifications, these will be incorrect or insufficient, so please email me if you think they could be improved. The motivation for this work was to improve the capabilities of the XML to NTriples stylesheet that I wrote last year. At the time I said that it had no validation tests and that they could be added either in the same stylesheet or in a separate one. I decided to separate the validation into a preprocess step in order not to muddy the already complex NTriples stylesheet further, and to allow use as a standalone item. There are some further details (and a link to the stylesheet itself) on the Semantic Planet Wiki here.

Comments

No comments yet.

Leave a comment

Sorry, the comment form is closed at this time.