Skip to content

Turtle Canon

It's turtles all the way down

Codecov main CI main

A tool for canonizing Turtle (.ttl) ontology files.

The domain standardized tool for editing and creating ontologies is Protégé. The Turtle (.ttl) file format is a format based on XML and OWL, which is considered one of the most readable formats for OWL ontology files. However, Protégé writes the order of ontology entities differently depending on the version, this tool mitigates this by running the file through a canonizing parser that ensures the classes are sorted and listed in the same way, always.

The main use case for developing this tool is when developing ontologies utilizing versioning tools such as git, svn or similar, which are single character diff-sensitive.

Install

The tool is written for Python 3.10, so one needs at minimum Python 3.10 installed to run it at this stage. The plan is to make a stand-alone executable for each of the major OS'.

Install via PyPI (stable version, recommended):

python3.10 -m pip install turtle-canon

Install via GitHub (development version):

python3.10 -m pip install git+https://github.com/CasperWA/turtle-canon#egg=turtle-canon

Usage

To run the tool, simply run:

turtle-canon path/to/my_ontology_file.ttl

For more information about the tool and the options available, run turtle-canon --help.
To check the version run turtle-canon --version.

The currently latest stable version is 0.1.0.

This tool is MIT Licensed and copyright © 2021 Casper Welzel Andersen (GitHub, GitLab, website) & SINTEF.