premis v2.0 and schema munging
In an effort to get a better understanding of PREMIS after reading about the v2.0 release, I dug around for 5 minutes looking for a way to convert an XML Schema to RelaxNG. The theory being that the compact syntax of RelaxNG would be easier to read than the XSD.
I ended up with a little hack suggested here to chain together the rngconv from the Multi-Schema Validator and James Clarke’s Trang, which oddly can’t read an XSD as input.
#!/bin/bash for i in $* do BN=$(basename $i .xsd) java -jar /opt/rngconv/rngconv.jar ${i} > /tmp/${BN}.rng java -jar /opt/trang/trang.jar -I rng -O rnc /tmp/${BN}.rng ${BN}.rnc done
The resulting RelaxNG can be seen here. As you can see I’m not sure it helps much…but it’s a start I guess. I’m interested in looking at what it might take to sublimate an PREMIS RDF vocabulary (hopefully just RDFS?) out of the XSD, mainly because I *think* parts of the vocabulary could prove useful in OAI-ORE resource maps.
July 21st, 2008 at 8:38 pm
Trang is intended to produce a conversion that’s isomorphic to the original, whereas the MSV produces a conversion that’s equivalent only in effect. Nobody has written an isomorphism-preserving input module for XSD; I suspect that if James considered it too hard, nobody else has wanted to bother trying. Jing uses Xerces directly for XSD validation, bypassing the RNG engine altogether.
July 28th, 2008 at 6:29 am
[...] inkdroid beep beep « premis v2.0 and schema munging [...]