1
0
mirror of https://github.com/balkian/gists.git synced 2024-11-24 18:32:27 +00:00
gists/repos/90c0497c0b207812cbbc/specgen.sh

54 lines
1.2 KiB
Bash
Raw Normal View History

2015-06-08 14:43:03 +00:00
#!/bin/bash
if [ $# -lt 1 ]
then
2015-12-10 10:04:27 +00:00
echo "Usage: $0 <ONTO> <FORMAT> <VERSION> <DIR> <NS>"
echo "Example: $0 onto owl latest /tmp/Onto http://example.com/ontologies owl"
exit
2015-06-08 14:43:03 +00:00
else
ONTO=$1
fi
if [ $# -lt 2 ]
then
2015-12-10 10:04:27 +00:00
FORMAT=owl
2015-06-08 14:43:03 +00:00
else
2015-12-10 10:04:27 +00:00
FORMAT=$2
2015-06-08 14:43:03 +00:00
fi
if [ $# -lt 3 ]
then
2015-12-10 10:04:27 +00:00
VERSION=latest
2015-06-08 14:43:03 +00:00
else
2015-12-10 10:04:27 +00:00
VERSION=$3
2015-06-08 14:43:03 +00:00
fi
if [ $# -lt 4 ]
2015-12-10 10:04:27 +00:00
then
DIR=~/Doctorado/Ontologies/$ONTO
else
DIR=$4
fi
if [ $# -lt 5 ]
2015-06-08 14:43:03 +00:00
then
NS=http://www.gsi.dit.upm.es/ontologies/$ONTO/ns#
else
2015-12-10 10:04:27 +00:00
NS=$5
2015-06-08 14:43:03 +00:00
fi
SPECPATH=~/Doctorado/tools/specgen6
echo "Generating docs for $ONTO from: $DIR"
echo "Namespace: $NS"
cp -r $DIR/spec $DIR/spec_backup
rm -rf $VERSION/
mkdir $DIR/spec/$VERSION
2015-12-10 10:04:27 +00:00
python2 $SPECPATH/specgen6.py --indir=$DIR --ns=$NS --prefix=$ONTO --ontofile=$ONTO.$FORMAT --outdir=$DIR/spec/$VERSION --templatedir=$DIR --outfile=index.html
2015-06-08 14:43:03 +00:00
cd $DIR/spec
2015-12-10 10:04:27 +00:00
cp ../$ONTO.$FORMAT $VERSION/
ln -s $ONTO.$FORMAT $VERSION/ns
cp -R ../img $VERSION/
cp ../style.css $VERSION/
rm index.html img style.css ns $ONTO.$FORMAT
2015-06-08 14:43:03 +00:00
ln -s $VERSION/index.html .
2015-12-10 10:04:27 +00:00
ln -s $VERSION/$ONTO.$FORMAT $ONTO.$FORMAT
ln -s $VERSION/$ONTO.$FORMAT ns
ln -s $VERSION/img img
ln -s $VERSION/style.css style.css