diff --git a/README.md b/README.md index aac19ea2..07c13317 100644 --- a/README.md +++ b/README.md @@ -1,43 +1,22 @@ + # gist upper enterprise ontology This repository has the raw files that we use to build the release files. If you just want the release files then you can download them from our [website](https://www.semanticarts.com/gist). ## Prerequisites to build the output files -You must have `java` installed for the serializer to work. See JRE Installation instructions -[here](https://jdk.java.net/). +1. You must have `java` installed for the serializer to work. See JRE Installation instructions [here](https://jdk.java.net/). +1. You must also install the [ontology toolkit](https://github.com/semanticarts/ontology-toolkit), which also requires [Python](https://www.python.org/downloads/) 3.6 or greater. -## To release (Windows) +## To release -To generate a folder suitable for ZIP-ing up and releasing Gist: +1. To generate a folder suitable for ZIP-ing up and releasing Gist, run -1. Make sure you edit `version.txt` and put in the desired version number with -**no leading nor trailing spaces** + `onto_tool bundle -v version bundle.yaml` -1. From this folder, run the `bundle.bat` script (double-click or run from command line). It will + where `` is a [semantic version](https://semver.org/), e.g. `9.2.0`. It will serialize the OWL, and create a ZIP-able folder containing everything needed for a web -download. The folder will have a name like `gist8.0.0_webDownload` +download. The folder will have a name like `gist_webDownload`. You can override +this by adding `-v output ` to the command. 1. ZIP up the resulting folder and put it where we host our downloads. - -## Serializer tool - -You can also run the `serialize` tool manually to format RDF OWL files to our standard format. - -Examples: - -Call it without arguments to show usage, e.g.: - - C:\dev\gist> tools\serialize.bat - - Serialize tool - - usage: serialize somefile.owl - e.g.: serialize gistAddress.owl - - -Call it with an argument to serialize the specified file in place (overwrites the file!), e.g.: - - C:\dev\gist> tools\serialize.bat OntologyFiles\gistAddress.owl - 1 file(s) copied. - serializing OntologyFiles\gistAddress.owl diff --git a/bundle.bat b/bundle.bat deleted file mode 100644 index 16bdd627..00000000 --- a/bundle.bat +++ /dev/null @@ -1,40 +0,0 @@ -@echo off -REM Bundle releasable files into a folder for web download - -setlocal -set DIR=%~dp0 -set TOOLSDIR=%DIR%\tools - -REM Get version number from one place. -for /f "delims=" %%v in ('type version.txt') do set VERSION=%%v - -REM Create a distribution directory -cd OntologyFiles -set ZIPDIR=..\gist%VERSION%_webDownload -mkdir %ZIPDIR% - -REM Standardize the owl files' format -for %%f in (*.owl) do call %TOOLSDIR%\serialize %%f - -REM Add version number to distribution's .OWL file names -for %%f in (*.owl) do copy %%f %ZIPDIR%\%%~nf%VERSION%%%~xf - -REM Inject version number into OWL file IRIs -for %%f in (%ZIPDIR%\*.owl) do call %TOOLSDIR%\versionize %VERSION% %%f - -REM Inject version number into catalog file -copy bundle-catalog-v001.xml %ZIPDIR%\catalog-v001.xml -call %TOOLSDIR%\versionize %VERSION% %ZIPDIR%\catalog-v001.xml - -REM Include the license file & Release notes in the download -copy ..\LICENSE.txt %ZIPDIR% -copy ReleaseNotes.txt %ZIPDIR% - -REM Create a deprecated items directory for the distribution -set DEPDIR=%ZIPDIR%\Deprecated -mkdir %DEPDIR% - -REM Move select items into deprecation directory -move %ZIPDIR%\gistDeprecated*.owl %DEPDIR% - -pause diff --git a/tools/sed.exe b/tools/sed.exe deleted file mode 100644 index 75ffba78..00000000 Binary files a/tools/sed.exe and /dev/null differ diff --git a/tools/serialize.bat b/tools/serialize.bat deleted file mode 100644 index a54cee01..00000000 --- a/tools/serialize.bat +++ /dev/null @@ -1,25 +0,0 @@ -@echo off - -REM serialize an owl file -setlocal - -set DIR=%~dp0 - -if "%1" == "" goto :usage - -set FILE=%1 -set TMPFILE=%1.bak -copy %FILE% %TMPFILE% -echo serializing %FILE% - -java -jar %DIR%/rdf-toolkit.jar -tfmt rdf-xml -sdt explicit -dtd -ibn -s %TMPFILE% -t %FILE% && del %TMPFILE% - -goto :eof - -:usage -echo. 1>&2 -echo Serialize tool 1>&2 -echo. 1>&2 -echo usage: %~n0 somefile.owl 1>&2 -echo e.g.: %~n0 gistAddress.owl 1>&2 -echo. 1>&2 diff --git a/tools/serialize.sh b/tools/serialize.sh deleted file mode 100755 index b8d635b9..00000000 --- a/tools/serialize.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash -# serialize.sh -# Reserializes one or more OWL files into a standard format using rdf-toolkit. - -usage() { - scriptname=`basename "$0"` - echo Formats OWL files into a standard format. Operates on a single file, all files in a directory, or a set of files specified with a wildcard. - echo Usage: $scriptname [ file \| directory \| wildcard expression ] - echo Examples: - echo $scriptname ./OntologyFiles/gistAddress.owl - echo $scriptname ../OntologyFiles - echo "$scriptname ../OntologyFiles/*.owl" -} - -serialize_file() { - file=$1 - # Require '.owl' extension. rdf-toolkit throws exceptions on non-RDF input. - # Avoid the exceptions on the '.txt' and '.xml' files stored in ../OntologyFiles. - # Later improvement: check actual file format rather than file extension. - # Should also extend to other RDF formats such as Turtle. - filename=`basename "$file"` - ext=${filename##*.} - if [ $ext != 'owl' ] ; then - echo Skipping file $file. - return - fi - echo Reserializing $file into a standard format. - tmp=$file.bak - cp $file $tmp - java -jar ./rdf-toolkit.jar -tfmt rdf-xml -sdt explicit -dtd -ibn -s $tmp -t $file - rm $tmp -} - -serialize_directory() { - dir=$1 - for file in $dir/*; do - serialize_file $file - done -} - -args=("$@") - -# Check for at least one arg -if [ ${#args[@]} -lt 1 ] ; then - usage - exit -fi - -if [ ${#args[@]} -eq 1 ] ; then - file=$1 - if [ -f $file ] ; then - serialize_file $file - elif [ -d $file ]; then - # Remove a trailing slash (for printing filenames). - file=${file%/} - serialize_directory $file - fi -else - for i in "${args[@]}"; do - serialize_file $i - done -fi - -echo Done! diff --git a/tools/versionize.bat b/tools/versionize.bat deleted file mode 100644 index ad7d7799..00000000 --- a/tools/versionize.bat +++ /dev/null @@ -1,27 +0,0 @@ -@echo off - -REM Versionize an owl file -setlocal - -set DIR=%~dp0 - -if "%2" == "" goto :usage - -set FILE=%2 -set VERSION=%1 -set TMPFILE=%FILE%.bak -copy %FILE% %TMPFILE% - -echo versionizing %FILE% to version %VERSION% - -%DIR%\sed.exe "s/X.x.x/%VERSION%/g" %TMPFILE% > %FILE% && del %TMPFILE% - -goto :eof - -:usage -echo. 1>&2 -echo Versionize tool 1>&2 -echo. 1>&2 -echo usage: %~n0 versionNumber somefile.owl 1>&2 -echo e.g.: %~n0 9.0.0 gistAddress.owl 1>&2 -echo. 1>&2 diff --git a/tools/versionize.sh b/tools/versionize.sh deleted file mode 100755 index b05d75d1..00000000 --- a/tools/versionize.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash -# versionize.sh -# Versionizes one or more OWL files. - -usage() { - scriptname=`basename "$0"` - echo Versionizes OWL files. Operates on a single file, all files in a directory, or a set of files specified with a wildcard. - echo Usage: $scriptname versionNumber [ file \| directory \| wildcard expression ] - echo Examples: - echo $scriptname 9.0.0 ../OntologyFiles/gistAddress.owl - echo $scriptname 9.0.0 ../OntologyFiles - echo "$scriptname 9.0.0 ../OntologyFiles/*.owl" -} - -versionize_file() { - version=$1 - # Remove a trailing slash - file=${2%/} - echo Versioning $file to $version - # For in-place substitution, Mac requires sed -i '' where - # Linux uses just -i; the version below works on both. - sed -i.bak "s/X.x.x/$version/g" $file - rm $file.bak -} - -versionize_directory() { - version=$1 - dir=$2 - for file in $dir/*; do - versionize_file $version $file - done -} - -args=("$@") - -# Check for at least two args -if [ ${#args[@]} -lt 2 ] ; then - usage - exit -fi - -version=$1 - -if [ ${#args[@]} -eq 2 ] ; then - file=$2 - if [ -f $file ] ; then - versionize_file $version $file - elif [ -d $file ]; then - # Remove a trailing slash (for printing filenames). - file=${file%/} - versionize_directory $version $file - fi -else - for i in "${args[@]:1}"; do - versionize_file $version $i - done -fi - -echo Done! diff --git a/version.txt b/version.txt deleted file mode 100644 index 47da986f..00000000 --- a/version.txt +++ /dev/null @@ -1 +0,0 @@ -9.1.0