test w3.org/ns script
authorTim L <lebot@rpi.edu>
Mon, 29 Apr 2013 10:20:50 -0400
changeset 6360 0155ba67c4be
parent 6358 efd6cd9b64f2
child 6361 13446fb1c7ca
test w3.org/ns script
namespace/bin/test-w3org.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/namespace/bin/test-w3org.sh	Mon Apr 29 10:20:50 2013 -0400
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+function test_ns {
+   mime="$1"
+   url="$2"
+   goal="$3"
+
+   base=`basename $url`
+   ext='unk'
+   if [   "$mime" == 'text/turtle'         ]; then
+      ext='ttl'
+   elif [ "$mime" == 'application/rdf+xml' ]; then
+      ext='rdf'
+   elif [ "$mime" == 'application/xml'     ]; then
+      ext='xsd'
+   fi
+   curl -sH "Accept: $mime" -L $url > test/$base.$ext
+   diff test/$base.$ext prov.ttl >& /dev/null
+   if [ $? ]; then
+      echo FAIL: $mime from $url does not match $goal
+   else
+      echo PASS: $mime from $url matches $goal
+   fi
+}
+
+#        mime                  url                        diff
+test_ns 'text/turtle'         http://www.w3.org/ns/prov  releases/prov-20130430/prov.ttl
+test_ns 'application/rdf+xml' http://www.w3.org/ns/prov  releases/prov-20130430/prov.owl
+test_ns 'application/xml'     http://www.w3.org/ns/prov  prov.xsd
+echo
+
+test_ns 'text/turtle'         http://www.w3.org/ns/prov-o  prov-o.ttl
+test_ns 'application/rdf+xml' http://www.w3.org/ns/prov-o  prov-o.owl
+echo
+
+test_ns 'text/turtle'         http://www.w3.org/ns/prov-o-inverses  prov-o-inverses.ttl
+test_ns 'application/rdf+xml' http://www.w3.org/ns/prov-o-inverses  prov-o-inverses.owl
+echo
+