Skip to main content

An extension for Gavel introducing OWL and FOWL (OWL with FOL annotations) translations as well as related functionality regarding OWL and FOWL ontologies.

Installation

The latest released version can be installed with:

pip install gavel-owl

The latest development version can be installed with:

pip install git+https://github.com/gavel-tool/python-gavel-owl.git@dev

For the development version, you need to install the jar-file manually. This is done by running mvn install in the java directory. Copy the resulting jar-file from java/target/java-1.0-SNAPSHOT.one-jar.jar to src/gavel_owl/jars/api.jar (be sure to use the one-jar-file, not the regular jar-file).

Usage

This plugin extends gavel by two new dialects, owl and fowl. This enables the various features of gavel to be used with owl / fowl ontologies. These functionalities use the java-based OWL-API. Therefore, you have to start the java backend in order to use most owl-based functionalities. The gavel-owl plugin provides a single command to do that:

python -m gavel start-server

After the server has been started successfully, you can translate an existing owl ontology to first-order logic in tptp syntax using:

python -m gavel translate owl tptp your-ontology.owl

You can also submit arguments to fist-order prover Vampire consisting of the translation of a given owl ontology as premises and conjectures formulated in tptp using:

python -m gavel owl-prove your-premises.owl your-conjectures.tptp

In order to translate an owl ontology with first-order annotations into tptp syntax, you can use:

python -m gavel translate fowl tptp your-ontology.owl

The running java backend can be terminated:

python -m gavel stop-server

There are several commands available that can be accessed via:

python -m gavel COMMAND [ARGUMENTS]
  • start-server: starts a subprocess that connects the Python program to its Java components. Other functions such as translate will only run if this connection has been established beforehand. The optional arguments -jp and -pp can be used for custom ports. Otherwise, the default ports will be used. -jp and -pp can be used for all other commands (except prove) analogously.

  • translate: A Gavel function that translates the contents of a given file from one language, e.g. OWL, to another language, e.g. TPTP. If the option –save is used, the translation is stored in the given file, else it is gets displayed in the command line. The following options are avaiable for translate:

    • --clif-properties (only for input dialect fowl) This option accepts arbitrary many IRIs or labels of OWL annotation properties. The values of annotation axioms using these properties will be interpreted as CLIF axioms. If this option is set with no arguments, the tool will not look for any CLIF axioms. If this option is not set, it will default to https://github.com/gavel-tool/python-gavel-owl/clif_annotation as an annotation property.

    • --tptp-properties (only for input dialect fowl) This is analogous to clif-properties. Here, the default value is https://github.com/gavel-tool/python-gavel-owl/tptp_annotation.

    • --shorten-names -n If this flag is set, the short form of IRIs will be used.

    • --readable-names (only for input dialects fowl and owl) This flag replaces IRIs with labels (if available) or shortened IRIs.

    • --no-annotations -a This flag can be set to avoid rendering annotations in the output dialect. For the translation from fowl to tptp, these annotations contain the OWL axiom or FOL annotation the is the origin of the corresponding FOL axioms.

    • --jp (only for input dialects fowl and owl) Sets the Java port for the connection to FOWL’s Java server. This should be the same number used for start-server. The default value is 25333.

    • --pp (only for input dialects fowl and owl) Sets the Python port for the connection to FOWL’s Java server. This should be the same number used for start-server. The default value is 25334.

    • --verbose -v (only for input dialect fowl) If this flag is set, additional information on the translation process will be put in the command line, such as the mapping between OWL entities and FOL names.

    • --save -s This option specifies the path for saving the translation result. If save is not set, the result will be put out to the command line.

    • --save-dol (only for input dialect fowl) This argument can be used to set a path under which to store the DOL-file generated from the annotated ontology.

    • --tptp-input (only for input dialect fowl) Use this argument in combination with one or multiple filenames to add TPTP files to the ontology. The axioms in these files are treated like TPTP annotations.

    • --clif-input (only for input dialect `` fowl``) Similar to --tptp-input, but for CLIF files. CLIF annotations are ignored. Advanced features such as imports or modules are not supported.

  • check-consistency: uses the OWL reasoner Hermit to determine whether a given ontology is consistent or not.

  • owl-prove: takes two arguments, an OWL file and a TPTP file. It uses Vampire to prove the conjectures provided in the TPTP file based on the translation of the OWL file. If the –steps flag is set, it will return the proof steps, otherwise it will only return the reasoner’s result.

  • stop-server: Ends the Java connection established by start-server.

  • prove: a function from Gavel that takes the name of a FOL prover and a TPTP file and returns the prover’s result for the given problem.

  • prove-ontology-entailment: Checks if an OWL ontology can be entailed from another. It returns the result based on OWL reasoning and based on FOL reasoning using the fowl translation.

For further options use:

python -m gavel [COMMAND] --help

Development

To run all the tests run:

tox

Note, to combine the coverage data from all the tox environments run:

Windows

set PYTEST_ADDOPTS=--cov-append
tox

Other

PYTEST_ADDOPTS=--cov-append tox

Changelog

0.0.0 (2020-11-23)

  • First release on PyPI.

Metadata

Release files for gavel-owl 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gavel-owl 0.2.0
File Size Uploaded Provenance Actions
gavel_owl-0.2.0.tar.gz 39.8 kB With provenance Details for gavel_owl-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gavel-owl 0.2.0
File Interpreter ABI Platform Actions
gavel_owl-0.2.0-py2.py3-none-any.whl Python 3, Python 2 none any Details for gavel_owl-0.2.0-py2.py3-none-any.whl

Total release size: 70.8 kB

Release files / gavel_owl-0.2.0.tar.gz

Download URL gavel_owl-0.2.0.tar.gz
Size 39.8 kB
Tags Source
SHA-256 checksum
How to use checksums
bfe2fa24efe8e538aed997fdf4954d41cce21e59a7ae8ffca77ae23f90dc2bce
BLAKE2b-256 checksum
How to use checksums
63ecf28bc4267ddd05281a675b39a52e4a8e75afc6b1f34f79b1ede29bfe79a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 8, 2025.

Transparency log

Release files / gavel_owl-0.2.0-py2.py3-none-any.whl

Download URL gavel_owl-0.2.0-py2.py3-none-any.whl
Size 31.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
a80dddf0a40ea0966306f81b59f766a6b0b5d1dc9c004fcc24fbfdaa9442242d
BLAKE2b-256 checksum
How to use checksums
6772faa6ffc991843a5313bd75bf46bc3e3658f2a18968bfe022fc65bd4b8994
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 8, 2025.

Transparency log

Security for gavel-owl 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for gavel_owl-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 8, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page