Ontology Development Kit (ODK) Crash Course#
Aim: To kickstart your journey into using the ODK, providing the foundations on which further development can be done
Goals: - You understand the what the ODK is and how to use it in ontology development - You are able to handle basic editing of the PREFER ontology using the ODK - You know how to find documentation and help if you need it in the future
Prerequisites#
Download and install GitHub Desktop if you are unfamiliar with git commands.
Download and install Protege. See instructions on how to set up Protege Setup Protege
Install ELK reasoner in protege if your version does not already come with it
Day 1 Agenda#
OBO Community#
Introduction to Ontologies#
Modelling: Logical Axioms & Object Properties
Further reading for modelling:
Understanding existential restrictions through this explainer and this explainer(https://oboacademy.github.io/obook/explanation/existential-restrictions/)
if you want some really indepth modelling tutorial, see FHKB tutorial here)
Ontology Development Kit Basics#
The Ontology Development Kit (ODK) provides a set of standardized, customizable and automatically executable workflows, and packages all required tooling in a single Docker image.
Key Features:
Standardised layout for repos to minimise time finding files.
Standardised workflows which allow users to work with other ontologies without relearning processes.
Dynamic import to allow users to easily mantain terms imported from other ontologies.
Anatomy of an ODK ontology#
All ODK repos have standard file layout. The key files you should know are
src/ontology/ont.yaml- the config file which ODK reads to build your reposrc/ontology/ont-edit.owl- the file that you should edit onsrc/ontology/ont.makefile- custom code that the repo uses that defers from vanilla ODKsrc/ontology/imports/ont.txt- files to add ontology terms to be importedsrc/ontology/profile.txt- configuration of QC reports/checks
Other files will be covered as needed.
Creating your ODK ontology#
Tutorial can be found here - if you already have an ontology and want to migrate it, you can move the terms to the edit file after initialising your ODK ontology.
How to edit in protégé#
Editing a term in protege - remember, let the reasoner do the work!
Day 2 Agenda#
Managing Imports with ODK#
A key function of the ODK is to handle dynamic imports. To avoid clashes in imports, I would recommend using merged imports in the ODK. Here is an example of what you should add to your yaml config file:
import_group:
use_base_merging: TRUE
products:
- id: ro
use_base: TRUE
The ODK maintains a set of ontology shorthands where you can just use the id and add use_base, and it will automatically work. However, in certain cases, you need to define where the mirror is from (where to download the ontology file), ask the ODK to make a base file where a base file is not available, and/or define what the base Internationalized Resource Identifier (IRI) are. Note: IRIs extend traditional URIs by allowing Unicode characters and base IRIs are foundational URL or URI for an ontology, serving as a prefix for all entities (classes, properties, individuals). An example would look like:
- id: bao
mirror_from: http://www.bioassayontology.org/bao/bao_complete.owl
make_base: TRUE
base_irirs:
- http://www.bioassayontology.org/
There are some ontologies (e.g. chebi and NCBITaxon) which are huge, please look at this document for managing such ontologies.
Once you have configured your imports and update your repo using sh run.sh make update_repo, you should see .txt files in your src/ontology/imports folder. To import terms to your ontology, add them into the .txt file, and run sh run.sh make imports/merged_import.owl. This will download the mirrors, extract out terms relavent to what you have added, and merge all subgraphs into merged_import.owl.
From there you can use the imported terms in your edit file.
Hands on Tutorial#
Given that ‘Chardonnay wine’ is a generic names for wines made from Chardonnay (varietal) grapes, add a term for Chardonnay (wine) with an appropriate logical definition.
What does the reasoner classify as Chardonay?
View the relationships (subClassOf axioms) of Chianti (wine). How might these frustrate attempts to classify wines using the pattern you just used to define Chardonnay wine?
Add a term for Rosé wine or orange wine and some terms for specific wines that will be auto-classified under it.
Add an import for the food ontology to the ODK repo, and import
FOODON:00002364and replace wine with the FOODON term for wine
Release Management#
The newer version of ODK utilises GitHub releases rather that uploading everything directly to GitHub. This change was made to deal with ever larger ontologies and the limitations of how much can be hosted on a GitHub repo.
For release management workflow, please utilise the workflow shown in CL documentation and update it for your ontology.