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).
Caution
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!
Note
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). The time to parse an OBO file is
reduced by about 60% in optimized mode.
Ontology¶
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 respects to the OBO terminology. |
|
A term, corresponding to a node in the ontology graph. |
|
A specialized mutable set to store |
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 |
|
Internal data storage of |
|
Internal data storage of |