ontology/bin/stage-owl.sh
author Paul Groth <p.t.groth@vu.nl>
Fri, 07 Jun 2013 20:21:19 +0200
changeset 6412 600c6fd1fdb4
parent 6324 9540c6adfb0d
permissions -rwxr-xr-x
minor updates to address dong's comments
#!/bin/bash
#
#3> <>
#3> a prov:Plan;
#3> rdfs:seeAlso <http://www.w3.org/2011/prov/wiki/PIL_OWL_Ontology#Steps_taken_for_CR>;
#3> prov:wasAttributedTo <http://tw.rpi.edu/instances/TimLebo> .

#   ~ ~ ~ ~ ~ ~~ 
# MANUAL STEP: edit MMDD in ProvenanceOntology.owl on local copy.
# MANUAL STEP: hg push ProvenanceOntology.owl
# MANUAL STEP: rerun ./prepare on aquarius to generate:
#   http://aquarius.tw.rpi.edu/prov-wg/inverses.ttl
#   (b/c it uses http://dvcs.w3.org/hg/prov/file/tip/ontology/ProvenanceOntology.owl)
#   ~ ~ ~ ~ ~ ~~ 

# The previous publish date, so we can refer back to it as a previous version.
pTYPE='PR'
pYYYY=2012
pMM=03
pDD=12

# The current publish date.
TYPE='REC'
YYYY=2013
MM=04    # Be sure to set these within ProvenanceOntology.owl, too...
DD=30    # Be sure to set these within ProvenanceOntology.owl, too...

if [ ! -e releases/$TYPE-prov-o-$YYYY$MM$DD/ns ]; then
   mkdir -p releases/$TYPE-prov-o-$YYYY$MM$DD/ns
fi

#
# prov
#
cp ProvenanceOntology.owl releases/$TYPE-prov-o-$YYYY$MM$DD/ns/prov-o.owl
cp ProvenanceOntology.owl releases/$TYPE-prov-o-$YYYY$MM$DD/ns/prov-o-$YYYY$MM$DD.owl

rapper -q -g -o turtle ProvenanceOntology.owl > prov-o.ttl

cp prov-o.ttl releases/$TYPE-prov-o-$YYYY$MM$DD/ns/prov-o.ttl
cp prov-o.ttl releases/$TYPE-prov-o-$YYYY$MM$DD/ns/prov-o-$YYYY$MM$DD.ttl

#
# inverses
#
versionIRI='2012MMDD' # These two are hard-coded into http://aquarius.tw.rpi.edu/prov-wg/inverses.ttl
previous='prov-o-inverses-2012mmdd'
used='http://www.w3.org/ns/prov-o-2012MMDD'
curl -s http://aquarius.tw.rpi.edu/prov-wg/inverses.ttl | sed "s/$versionIRI/$YYYY$MM$DD/g" | sed "s/$previous/prov-o-inverses-$pYYYY$pMM$pDD/g" > components/inverses.ttl
cp components/inverses.ttl components/inverses-$YYYY$MM$DD.ttl
cp components/inverses.ttl releases/$TYPE-prov-o-$YYYY$MM$DD/ns/prov-o-inverses.ttl
rapper -q -g -o rdfxml-abbrev components/inverses.ttl > releases/$TYPE-prov-o-$YYYY$MM$DD/ns/prov-o-inverses.owl -I 'http://www.w3.org/ns/prov-o-inverses'
cp releases/$TYPE-prov-o-$YYYY$MM$DD/ns/prov-o-inverses.owl releases/$TYPE-prov-o-$YYYY$MM$DD/ns/prov-o-inverses-$YYYY$MM$DD.owl
cp releases/$TYPE-prov-o-$YYYY$MM$DD/ns/prov-o-inverses.ttl releases/$TYPE-prov-o-$YYYY$MM$DD/ns/prov-o-inverses-$YYYY$MM$DD.ttl

echo releases/$TYPE-prov-o-$YYYY$MM$DD/ns
ls -l releases/$TYPE-prov-o-$YYYY$MM$DD/ns

echo hg add components/inverses-$YYYY$MM$DD.ttl releases/$TYPE-prov-o-$YYYY$MM$DD
echo hg commit -m \"provo releases/$TYPE-prov-o-$YYYY$MM$DD\"
echo hg push