API Reference

A Python frontend to ontologies.

pronto is a Python agnostic library designed to work with ontologies. At the moment, it can parse ontologies in the OBO, OBO Graphs or OWL in RDF/XML format, on either the local host or from an network location, and export ontologies to OBO or OBO Graphs (in JSON format).


Only classes and modules reachable from the top-level package pronto are considered public and are guaranteed stable over Semantic Versioning. Use submodules (other than warnings) at your own risk!


pronto implements proper type checking for most of the methods and properties exposed in the public classes. This reproduces the behaviour of the Python standard library, to avoid common errors. This feature does however increase overhead, but can be disabled by executing Python in optimized mode (with the -O flag). Parsing performances are not affected.

See also

Online documentation for this version of the library on Read The Docs


An abstraction over a \(\mathcal{SHOIN}^\mathcal{(D)}\) ontology.


An ontology storing terms and the relationships between them.

View Layer

The following classes are part of the view layer, and store references to the ontology/entity they were declared in for verification purposes. For instance, this let pronto check that a Synonym type can only be changed for a type declared in the Ontology header.

Because of this reason, none of these classes should be created manually, but obtained from methods of existing Ontology or Entity instances, such as Ontology.get_term to get a new Term.


An entity in the ontology graph.


A relationship, constitute the edges of the ontology graph.


A synonym for an entity, with respect to the OBO terminology.


A term, corresponding to a node in the ontology graph.


A specialized mutable set to store Term instances.

View Collections

The following classes are dedicated collections that are implemented to view a specific field of entities, such as relationships. These types cannot be instantiated directly, but are reachable through the right property on Entity instances.


A dedicated mutable mapping to manage the relationships of an entity.

Model Layer

The following classes are technically part of the data layer, but because they can be lightweight enough to be instantiated directly, they can also be passed to certain functions or properties of the view layer. Basically, these classes are not worth to implement following the view-model pattern so they can be accessed and mutated directly.


A mapping containing metadata about the current ontology.


A human-readable text definition of an entity.


A definition of a subset in an ontology.


A user-defined synonym type.


A property-value which adds a literal annotation to an entity.


A property-value which adds a resource annotation to an entity.


A cross-reference to another document or resource.

Data Layer

The following classes are from the data layer, and store the data extracted from ontology files. There is probably no point in using them directly, with the exception of custom parser implementations.


Internal data storage of Relationship information.


Internal data storage of Synonym information.


Internal data storage of Term information.



The class for all warnings raised by pronto.


Some part of the code is yet to be implemented.


The parsed document contains incomplete or unsound constructs.


The behaviour of the executed code might change in the future.