Skip to content
Damion Dooley edited this page Jan 16, 2025 · 14 revisions

To edit FoodOn

The /src/ontology/foodon-edit.owl is the main OWL file to be edited using Protege or by hand. Files in /src/ontology/imports/ folder that can be edited by hand are the Ontofox specification files (ending in .txt) which prepare the import of terms from other OBOFoundry.org ontologies into the corresponding [ontology]_import.owl files.

Currently: To build (regenerate) the FoodOn release files

  1. Open a linux terminal and cd to the FoodOn github repo's /src/ontology/ folder
  2. type "make" to generate the /src/ontology/foodon.owl file. This also updates any /imports/ .owl files based on changes to their [ontology]_ontofox.txt specification files - according to a list given in the Makefile file.
  3. type "make prepare_release" to generate the root folder foodon.owl file and copy all the /src/imports/ .owl files to the main /imports/ folder.

The ELK reasoner is run as part of this, but to run that separately and manually take care of any equivalency duplications etc, run:

make reason

Build via ODK:

An upgrade to FoodOn's ancient ODK configuration is coming. As ODK recommends, it and the build are usually run inside Docker. In this build system a new suite of quality control tests is performed and an error report generated. The OBO Dashboard pays attention to a number of these items. The latest ODK documentation is at: https://ontology-development-kit.readthedocs.io/_/downloads/en/latest/pdf/, and a training oriented documentation is in the OBO Academy under the ODK section, e.g. odk-setup.

For those installing Docker here are a few tips:

For Mac users, to install Docker on your own computer for your own use only you may find this convenient: https://docs.docker.com/desktop/setup/install/mac-install/#install-from-the-command-line

It appears that after installing desktop docker for all users, one can go back and entice it to run for just one user via:

/Applications/Docker.app/Contents/MacOS/install --user=<userid>

If you run Docker Desktop and activate the ODK container, then if on a terminal command line you type "docker" and that program is not found, then some sym-linking may be required such as:

# Add Docker Desktop for Mac (docker) export PATH="$PATH:/Applications/Docker.app/Contents/Resources/bin/"

Encountering bad RDF datatype literal values

If when running make or when running "robot" directly you encounter obscure robot OWLAPI errors such as "java.lang.IllegalArgumentException: URI is not absolute", without enough indication about where this URI is located, then install Apache jena and use the "riot" command to validate an owl/xml version of foodon-edit.owl. (For Mac users, to install riot, use "> brew install jena"). In Protege, save a copy of foodon-edit.ofn (which is in rdf/xml syntax) or foodon-merged.ofn to an owl/xml syntax as foodon-validate.owl :

riot -v --validate foodon-validate.owl

If riot complains with an error: "JAXP00010001: The parser has encountered more than "64000" entity expansions in this document; this is the limit imposed by the JDK.", then adjust the "entityExpansionLimit" parameter, and rerun:

export JVM_ARGS="$JVM_ARGS -DentityExpansionLimit=250000"

or prepend the call

JVM_ARGS="$JVM_ARGS -DentityExpansionLimit=2500000" riot --set ttl:entityExpansionLimit=0 --validate ../../foodon.owl

After a successful make build, you can test that robot is able to read genepio correctly via:

robot convert -i foodon-merged.owl -o foodon.json

TO DO: Explain /src/ontology/imports/robot/ files and their parent.