#!/bin/bash
#+
#   TITLE:          buildP2O.shtxt
#   VERSION:        1-001
#   FACILITY:       bash script to define  a convenience command
#                   in the login file
#   AUTHOR(S):      Hlaszny, Edit PhD (+36 30 3116516, edithlaszny@gmail.com)
#   SUPERVISED BY:  -
#   CREATION DATE:  15-JUN-2024
#
#   ENVIRONMENT:    HW Model Name iMac, MacOS Monterey, 12.5.1
#
#   DESIGN ISSUE:
#                   The script starts the JAR-file owl2gen.jar
#                   to generate a PRINCE2 ontology. You can define
#                   alias in your default login shell script as
#
#                   alias bp2=". whereThisScriptIsatored/buildP2O.sh"
#
#                   $1 : the default directory name, where the
#                        the following files should exist
#
#                        P2_headerTemplate.owl  -  the default OWL geader
#                        P2_classStructure.txt  -  tab-indented OWL class names
#                        P2_tripletDefs.txt     -  triplet definitions
#
#   MODIFICATION HISTORY:
#       date        modified by
#       15-JUN-2024 Hlaszny   1-001 first draw
#-
if [ -e owl2gen.jar ]
then
    #+
    #   if the JAR file exists...
    #-
    java -jar owl2gen.jar  $1 $2
else
    #+
    #   otherwise
    #-
    echo  "There is no owl2gen.jar to run in the directory"
    echo  "Your current directory is `pwd`"
    echo  "    You must ensure that the following files exist"
    echo  "    in your current directory where you issue this"
    echo  "    command (it's an alias in your login file):"
    echo  "    "
    echo  "    P2_headerTemplate.owl     -  the default OWL geader"
    echo  "    P2_classStructure.txt     -  tab-indented OWL class names"
    echo  "    P2_DisjointClassDefs.txt  -  tab-indented disjoint class names"
    echo  "    P2_tripletDefs.txt        -  triplet definitions"
fi
