Developing Python and Rust libraries to improve the ontology ecosystem
Creators: name: Larralde, Martin
Publisher: name: F1000 Research Limited
Year: 2019

description: Ontologies are structures used to describe knowledge in a formal way, by defining entities and the relationships between them. Originally developed by logicians, they became widespread in the bioinformatics community thanks to projects such as the Gene Ontology or the OBO Foundry. They can be used as controlled vocabularies for data repositories or data formats, but the possibility to use <i>reasoners</i> – programs that can infer consequences from ontology assertions – opens the way for more in-depth analyses.<br><br>For historical and technical reasons, there are two languages used to describe most biomedical ontologies: The OWL language, developed as a normative specification by the W3C OWL Working Group as a component of the W3C Semantic Web. It is using RDF triples to model the knowledge graph, consequently supporting several serialization (OWL/XML, OWL/Turtle, OWL/Manchester). Modern reasoners expect OWL ontologies as an input, or intermediate representations like the object model of the Java OWL API. The OBO language, an attempt made by the OBO consortium to address the integration issues that emerged with the growing number of ontologies in the biomedical field. For integration and backward compatibility purposes it has never really been a normative format, and the de-facto standard comes from the OWL API which can has a provisional support for the OBO format.The version 1.4 of the OBO format and language, which is still under development, highly restricts the syntax of OBO files in exchange for an improved compatibility with the OWL language. With this edition, OBO ontologies can be mapped exactly to an equivalent OWL2 document.<br><br>In order to actively support this standardisation effort, we developed <i>fastobo</i>, an efficient, strongly typed and open-source Rust library implementing a parser and an abstract syntax tree for the OBO format version 1.4. It is continuously tested against ontology files released in the OBO foundry. To facilitate the usage of <i>fastobo</i>, transparent Python bindings were also generated and are available publicly to download from PyPI, with a full access to the underlying data structures. We also implemented a subset of the semantic mapping from OBO to OWL, as well as mappings between the OBO and the OBO Graphs format.<br><br>Rust is a low-level language with modern abstractions that has performances comparable to C, strong typing, and a large number of cross-platform and open-source libraries. The strictness offered by a strongly-typed programming language made it possible to use <i>fastobo</i> to identify syntactic issues within several in-development ontologies, including the Evidence Ontology, the Plant Ontology, the Cell Ontology and the Environment Ontology. Most of these issues actually originated in the OWL editor files the OBO were obtained from, but none of the existing conversion tools (ROBOT or owl2obo) were able to detect these errors. The development of the parser also helped mending the development version of the OBO syntax itself.