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 5612 00d5a120fc88
permissions -rwxr-xr-x
minor updates to address dong's comments
     1 #!/bin/bash
     2 #
     3 #3> <>
     4 #3> a prov:Plan;
     5 #3> rdfs:seeAlso <http://www.w3.org/2011/prov/wiki/PIL_OWL_Ontology#Steps_taken_for_CR>;
     6 #3> prov:wasAttributedTo <http://tw.rpi.edu/instances/TimLebo> .
     7 
     8 #   ~ ~ ~ ~ ~ ~~ 
     9 # MANUAL STEP: edit MMDD in ProvenanceOntology.owl on local copy.
    10 # MANUAL STEP: hg push ProvenanceOntology.owl
    11 # MANUAL STEP: rerun ./prepare on aquarius to generate:
    12 #   http://aquarius.tw.rpi.edu/prov-wg/inverses.ttl
    13 #   (b/c it uses http://dvcs.w3.org/hg/prov/file/tip/ontology/ProvenanceOntology.owl)
    14 #   ~ ~ ~ ~ ~ ~~ 
    15 
    16 # The previous publish date, so we can refer back to it as a previous version.
    17 pTYPE='PR'
    18 pYYYY=2012
    19 pMM=03
    20 pDD=12
    21 
    22 # The current publish date.
    23 TYPE='REC'
    24 YYYY=2013
    25 MM=04    # Be sure to set these within ProvenanceOntology.owl, too...
    26 DD=30    # Be sure to set these within ProvenanceOntology.owl, too...
    27 
    28 if [ ! -e releases/$TYPE-prov-o-$YYYY$MM$DD/ns ]; then
    29    mkdir -p releases/$TYPE-prov-o-$YYYY$MM$DD/ns
    30 fi
    31 
    32 #
    33 # prov
    34 #
    35 cp ProvenanceOntology.owl releases/$TYPE-prov-o-$YYYY$MM$DD/ns/prov-o.owl
    36 cp ProvenanceOntology.owl releases/$TYPE-prov-o-$YYYY$MM$DD/ns/prov-o-$YYYY$MM$DD.owl
    37 
    38 rapper -q -g -o turtle ProvenanceOntology.owl > prov-o.ttl
    39 
    40 cp prov-o.ttl releases/$TYPE-prov-o-$YYYY$MM$DD/ns/prov-o.ttl
    41 cp prov-o.ttl releases/$TYPE-prov-o-$YYYY$MM$DD/ns/prov-o-$YYYY$MM$DD.ttl
    42 
    43 #
    44 # inverses
    45 #
    46 versionIRI='2012MMDD' # These two are hard-coded into http://aquarius.tw.rpi.edu/prov-wg/inverses.ttl
    47 previous='prov-o-inverses-2012mmdd'
    48 used='http://www.w3.org/ns/prov-o-2012MMDD'
    49 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
    50 cp components/inverses.ttl components/inverses-$YYYY$MM$DD.ttl
    51 cp components/inverses.ttl releases/$TYPE-prov-o-$YYYY$MM$DD/ns/prov-o-inverses.ttl
    52 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'
    53 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
    54 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
    55 
    56 echo releases/$TYPE-prov-o-$YYYY$MM$DD/ns
    57 ls -l releases/$TYPE-prov-o-$YYYY$MM$DD/ns
    58 
    59 echo hg add components/inverses-$YYYY$MM$DD.ttl releases/$TYPE-prov-o-$YYYY$MM$DD
    60 echo hg commit -m \"provo releases/$TYPE-prov-o-$YYYY$MM$DD\"
    61 echo hg push