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.


for i in $*
  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

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.