Skip to main content

Ontology Development Kit Core

Project description

Ontology Development Kit Core

This project provides the core functionality of the Ontology Development Kit as a standalone Python package (odk-core).

Namely, it provides:

  • the odk script to seed and update a ODK-managed repository;
  • the template files used to seed a ODK-managed repository.

Installation

Unless they wish to use a “native ODK environment” (see below), most users will not need to manually install this package. Instead, they will use it through one of the Docker images provided by the ODK project – those images will include the odk-core package and its odk script.

The package can definitely be used independently of the Docker images though. For that, it can be installed as any other Python packages, either from PyPI:

$ python -m pip install odk-core

or from a release tarball

$ curl -L -O https://github.com/INCATools/odkcore/releases/download/odkcore-X.Y.Z/odk_core-X.Y.Z.tar.gz
$ tar xf odk_core-X.Y.Z.tar.gz
$ python -m pip install ./odk_core-X.Y.Z

Setting up a native ODK environment

Installing the odk-core package as shown above will automatically install all the Python packages required to run the odk script (e.g. to seed or update a ODK-managed repository).

In addition, installing the package with the workflows “extra” (as in pip install odk-core[workflows] will also install all the Python packages that are required by some of the standard ODK workflows as implemented in the src/ontology/Makefile generated Makefile.

Non-Python tools need to be installed separately and made available in the PATH. The various tools used by ODK workflows are:

Lastly, the environment must also provide some ROBOT plugins. They must be made available in a $ODK_RESOURCES_DIR/robot/plugins directory, where ODK_RESOURCES_DIR is a variable exported into the environment. The plugins used by ODK workflows are:

When using the ODK through one of the Docker images, all those requirements are automatically met. When not using the Docker images, it is the user’s responsibility to ensure they are met, before ODK workflows can be run. The odk script provides a command to help with that:

$ odk install /path/to/my/env

That command will initialise the /path/to/my/env directory as a “native ODK environment”, containing all the tools and ROBOT plugins mentioned above (except GNU Make and the JRE, which are always expected to be already available on the system).

To use the newly initialised environment, source the bin/activate-odk-environment.sh script:

$ . /path/to/my/env/bin/activate-odk-environment.sh

The current shell is then ready to run ODK workflows.

Note that ODK native environments are only supported for the following platforms:

  • GNU/Linux x86_64,
  • macOS x86_64,
  • and macOS arm64.

Developing ODK-Core

ODK-Core is managed with the UV project manager. Type checking is ensured through Mypy, and linting and formatting through Ruff.

Set up the development environment with:

$ uv sync --dev --extra workflows

from within the project’s checked out repository. The --extra workflows is optional, but using it will make it easier to use the same environment to also run (and therefore test) the ODK-generated workflows.

To test seeding a ODK repository:

$ uv run odk seed -C config.yaml -g [other seeding options...]

Note the -g option, which instructs the seeding process not to try building a first release in the newly seeded repository (trying to build a release would likely fail, unless you happen to have the tools mentioned in the previous section already available in your PATH).

The previous command assumed that you are in the directory where ODK-Core was checked out. To run a odk command from anywhere else, use UV’s --project option:

$ uv --project /path/to/odk-core run odk seed -C config.yaml -g [...]

I’d recommend setting up an alias like:

$ alias odk-dev="uv --project /path/to/odk-core run odk"

so that you can use odk-dev from anywhere, e.g. try seeding a repository with:

$ odk-dev seed -g -C config.yaml [...]

To be able to test running a ODK workflow, instead of merely seeding a ODK repository, first create a native ODK environment, then activate it:

$ odk-dev install /my/test/env
$ . /my/test/env/bin/activate-odk-environment.sh

It is then possible to seed a repository without skipping the building of the initial release, and more generally to run any workflow within the newly seeded repository:

$ odk-dev seed -C config.yaml [...]
$ cd target/<myont>/src/ontology
$ make clean refresh-imports

Copying

The ODK Core is free software, published under the same 3-clause BSD license as the original ODK. See the LICENSE file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

odk_core-0.1.3.tar.gz (80.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

odk_core-0.1.3-py3-none-any.whl (95.8 kB view details)

Uploaded Python 3

File details

Details for the file odk_core-0.1.3.tar.gz.

File metadata

  • Download URL: odk_core-0.1.3.tar.gz
  • Upload date:
  • Size: 80.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Slackware","version":"15.0","id":"stable","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for odk_core-0.1.3.tar.gz
Algorithm Hash digest
SHA256 bc7c60c3d6a79e3c4ebe2f02f2ad3a416e5b7bfef8b0e3e4a37dea0f0918f13c
MD5 1a2f9beb472ff353234fb0409196e99a
BLAKE2b-256 f4d6c4fd6edd5dd5c0397de08fe2ec2e3565553aaa921d9c8c236c0bd0b6de9f

See more details on using hashes here.

File details

Details for the file odk_core-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: odk_core-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 95.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Slackware","version":"15.0","id":"stable","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for odk_core-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d86ee5a0f6b47c6953e2b4b2b011540470c595ea8a53281cb8aad6d9533b2d82
MD5 0bfd10a1df0e1cd65d45ce5624a14df7
BLAKE2b-256 2ac476c2d895d370ac8fbb6c4a95f0ed111806155e9ff25cca92dcf570cc62c3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page