owl-cli

(Version snapshot)

owl-cli is a command line tool for ontology engineering. It targets the Web Ontology Language (OWL 2) and RDF. You can

You can find the source code on Github.

splash

Installation

Requirements

Things you will need to have installed to run owl-cli:

  • Graphviz for the generation of diagrams.

    • Install in Windows (using Chocolatey): choco install graphviz

    • Install in MacOs (using Brew): brew install graphviz

    • Install in Ubuntu/Debian Linux: apt install graphviz

Download and Install owl-cli

Download the pre-built binary for your platform:

icon windows

owl-x86_64-windows-snapshot.exe

icon apple

owl-x86_64-apple-darwin-snapshot

icon linux

owl-x86_64-linux-snapshot

For other platforms or architectures, please use the executable .jar file: owl-cli-snapshot.jar. This requires Java (OpenJDK) 17 or newer.

Rename the binary to owl.exe (Windows) or owl (MacOs/Linux), put it in your favorite directory and add this directory to the PATH environment variable:

  • Windows: setx /M path "%path%;C:\your\path\here\"

  • MacOs/Linux: echo 'export PATH=/your/path/here:$PATH' >> ~/.bashrc; source ~/.bashrc

If using the executable .jar file, the following commands will make the jar available as owl command as well. This works in MacOs and Linux.

curl -L -o ~/.local/share/owl-cli/owl-cli.jar --create-dirs https://github.com/atextor/owl-cli/releases/download/snapshot/owl-cli-snapshot.jar
echo 'function owl() { java -jar ~/.local/share/owl-cli/owl-cli.jar $*; }' >> ~/.bashrc
source ~/.bashrc

After installation, you can use the owl command: See Usage for more information.

Building from Source

Building the executable JAR from source

For building the executable JAR file for owl-cli, you need Java 17. We recommend installation of the GraalVM-based JDK 17 using SDKMAN!.

Run the following commands:

# The following commands install SDKMAN!. If you have it installed already, you can skip it.
curl -sL https://get.sdkman.io | bash
echo sdkman_auto_answer=true > $HOME/.sdkman/etc/config
echo sdkman_auto_selfupdate=true >> $HOME/.sdkman/etc/config
source $HOME/.sdkman/bin/sdkman-init.sh

# Use SDKMAN! to install JDK
sdk install java 17.0.8-graal
sdk use java 17.0.8-graal

# Build the project
git clone https://github.com/atextor/owl-cli.git
cd owl-cli
./gradlew

This will build cli/build/libs/owl-cli-snapshot.jar, which you then can install locally:

mkdir -p ~/.local/share/owl-cli
cp cli/build/libs/owl-cli-snapshot.jar !$/owl-cli.jar
echo 'function owl() { java -jar ~/.local/share/owl-cli/owl-cli.jar $*; }' >> ~/.bashrc
source ~/.bashrc

After that, you can use the owl command: See Usage for more information.

Building the native image (executable binary) from source

For building the owl-cli native binary, GraalVM is used. As Java 15+ source features are used, a JDK 17-based GraalVM version is required. For calling GraalVM’s native-image command, the gradle build relies on the install locations as used by SDKMAN!.

The following instructions assume a BASH shell. On MacOs and Linux this is the default shell; on Windows you would have to use e.g. Git Bash or WSL2.

Also on Windows, you will need to install Microsoft Visual C++. Please follow the GraalVM installation instructions.

Run the following commands:

# The following commands install SDKMAN!. If you have it installed already,
# you can skip it.
# Ubuntu only: SDKMAN! installation requires zip/unzip:
sudo apt-get install zip unzip
# Windows only: SDKMAN! installation requires zip/unzip:
choco install zip
choco install unzip
# Install SDKMAN!
curl -sL https://get.sdkman.io | bash
echo sdkman_auto_answer=true > $HOME/.sdkman/etc/config
echo sdkman_auto_selfupdate=true >> $HOME/.sdkman/etc/config
source $HOME/.sdkman/bin/sdkman-init.sh

# Use SDKMAN! to install JDK
sdk install java 17.0.8-graal
sdk use java 17.0.8-graal
# Use GraalVMs update tool to install the native-image command
gu install native-image

# Ubuntu only: Install build dependencies
sudo apt-get install -y build-essential libz-dev

# Build the project
git clone https://github.com/atextor/owl-cli.git
cd owl-cli
./gradlew nativeImage

This will build cli/build/bin/owl, which you can put anywhere on your PATH.