Usage

Although the package is called owl-cli, the command you invoke is called owl.

You can call the built-in overview of commands and arguments via --help:

Usage:

Usage: owl [-v] [--help] [--version] [COMMAND]

Description:

Command line tool for ontology engineering

Options:
      --help      Show short help
  -v, --verbose   Specify multiple -v options to increase verbosity,
                  e.g. use `-v`, `-vv` or `-vvv` for more details
      --version   Show current version
Commands:
  ...

Other than the general help, you give one argument, the command, which will take its own arguments, for example:

owl diagram --format png

Commands that take ontology files as an input support all formats that are supported by OWL API, notably RDF/Turtle, RDF/XML, OWL/XML and OWL Functional Syntax.

diagram Command

The diagram command takes an OWL ontology as input and generates an automatically layouted diagram for it in the SVG or PNG format. This is implemented by mapping the ontology’s axioms into a graph description in the Graphviz language, which is passed to its dot layouting engine. Attributes such as fonts can be customized using arguments.

As no standardized graphical notation for OWL exists, the diagram notation used here is described in detail on a separate page: Diagram Notation.

General Usage

General usage: owl diagram [options] input [output], where input can be either an ontology file or - (which means: read from standard in) and output can be either an ontology file or - (which means: write to standard out). If output is not given, the output filename is the input filename with its file extension changed, e.g. myontology.ttl → myontology.svg. If input is - and output is not given, the output is set to standard out.

Options

Table 1. diagram Command Options
Option Description Default Notes

--direction

Diagram layout direction

left_to_right

Possible Values: [top_to_bottom, left_to_right]

--dotbinary

Path to dot binary

dot

By default, dot is searched for in your $PATH

--fontname

Default font

Verdana

--fontsize

Default font size

12

--format

Output file format

svg

Possible Values: [png, svg]

--nodefontname

Font for nodes

Verdana

--nodefontsize

Font size for nodes

Verdana

--nodemargin

The margin to render inside of nodes

0.05,0.0

See the Graphviz documentation for more information

--nodeshape

Node shape

box

See the Graphviz documentation for more information

--nodestyle

Node style

rounded

See the Graphviz documentation for more information

Example Usage

Simple invocation with default arguments:

# Will create myontology.svg
owl diagram myontology.ttl

Invocation where the output is specified as standard out and piped to convert to create a different format:

owl diagram myontology.ttl - | convert - myontology.jpg

Invocation where an ontology is downloaded, some terms are filtered and then piped to owl diagram:

curl http://www.ontologydesignpatterns.org/cp/owl/partof.owl | \
grep -v 'comment|cpannotation|versionInfo' | owl diagram - partof.svg