Bio::O...ngineI(3pm)
π Bio::Ontology::OntologyEngineI π
okay bestie, gather round, because this is the manual page for Bio::Ontology::OntologyEngineI from the Bioperl docs (User Contributed Perl Documentation, section 3pm) β and it's lowkey one of the most important little interfaces in the whole ontology corner of the codebase. no cap.
β¨ NAME β¨
Bio::Ontology::OntologyEngineI β the interface that any minimal Ontology implementation should satisfy π«Ά
β¨ SYNOPSIS β¨
# see documentation of methods
that's it. that's the synopsis. the methods are the moment. π
πΈ DESCRIPTION πΈ
So this whole page is describing the bare minimum interface an ontology query engine is expected to provide. It is very intentional about what it does not say: it never explicitly claims the ontology is a DAG, and it never demands that the ontology be a vocabulary. Instead it just tries to generically say what should be accessible (queriable) about an ontology. it's giving "we don't do assumptions here." β¨
The whole point is to let different implementations exist for different purposes β which means they're allowed to differ on which operations are efficient and which are not, and on how much extra richness they pile on top of this minimalistic set of methods. Go check the modules in the Bio::Ontology namespace to find out which implementations actually exist. At the time of writing, there's a SimpleOntologyEngine (which does not use Graph.pm), and a Graph.pm-based implementation in SimpleGOEngine. π
Also important: ontology parsers in Bio::OntologyIO are required to return an implementation of this interface. no implementation, no deal. π
π¦ FEEDBACK π¦
π¬ Mailing Lists
User feedback is literally an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list β your participation is much appreciated, fr fr.
bioperl-l@bioperl.org - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
π«Ά Support
Please direct usage questions and support issues to the mailing list:
bioperl-l@bioperl.org
...rather than to the module maintainer directly. There are so many experienced and responsive experts on there who can look at your problem and quickly address it. If at all possible, please include a thorough description of the problem along with code and data examples. the more detail, the better the slay. π
π Reporting Bugs
Report bugs to the Bioperl bug tracking system so we can keep track of the bugs and their resolution. Bug reports can be submitted via the web:
https://github.com/bioperl/bioperl-live/issues
π AUTHOR - Peter Dimitrov π
Email dimitrov@gnf.org
π APPENDIX π
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _. iykyk. π
π add_term
Title : add_term
Usage : add_term(TermI term): TermI
Function: Adds TermI object to the ontology engine term store
Example : $oe->add_term($term)
Returns : its argument.
Args : object of class TermI.
π add_relationship
Title : add_relationship
Usage : add_relationship(RelationshipI relationship): RelationshipI
Function: Adds a relationship object to the ontology engine.
Example :
Returns : Its argument.
Args : A RelationshipI object.
π add_relationship_type
Title : add_relationship_type
Usage : add_relationship_type(scalar,OntologyI ontology)
Function: Adds a relationshiptype object to the ontology engine.
Example :
Returns : 1 on success, undef on failure
Args : The name(scalar) of the relationshiptype, and the OntologyI
it is to be added to.
π get_relationship_type
Title : get_relationship_type
Usage : get_relationship_type(scalar): RelationshipTypeI
Function: Get a relationshiptype object from the ontology engine.
Example :
Returns : A RelationshipTypeI object.
Args : The name (scalar) of the RelationshipTypeI object desired.
π get_relationships
Title : get_relationships
Usage : get_relationships(TermI term): RelationshipI
Function: Retrieves all relationship objects from this ontology engine,
or all relationships of a term if a term is supplied.
Example :
Returns : Array of Bio::Ontology::RelationshipI objects
Args : None, or a Bio::Ontology::TermI compliant object for which
to retrieve the relationships.
π get_predicate_terms
Title : get_predicate_terms
Usage : get_predicate_terms(): TermI
Function:
Example :
Returns :
Args :
yes bestie, the Function, Example, Returns and Args are genuinely empty here. that's the canon, don't come for me. π
π get_child_terms
Title : get_child_terms
Usage : get_child_terms(TermI term, TermI predicate_terms): TermI
Function: Retrieves all child terms of a given term, that satisfy a
relationship among those that are specified in the second
argument or undef otherwise. get_child_terms is a special
case of get_descendant_terms, limiting the search to the
direct descendants.
Example :
Returns : Array of TermI objects.
Args : First argument is the term of interest, second is the list
of relationship type terms.
π get_descendant_terms
Title : get_descendant_terms
Usage : get_descendant_terms(TermI term, TermI rel_types): TermI
Function: Retrieves all descendant terms of a given term, that
satisfy a relationship among those that are specified in
the second argument or undef otherwise.
Example :
Returns : Array of TermI objects.
Args : First argument is the term of interest, second is the list
of relationship type terms.
π get_parent_terms
Title : get_parent_terms
Usage : get_parent_terms(TermI term, TermI predicate_terms): TermI
Function: Retrieves all parent terms of a given term, that satisfy a
relationship among those that are specified in the second
argument or undef otherwise. get_parent_terms is a special
case of get_ancestor_terms, limiting the search to the
direct ancestors.
Example :
Returns : Array of TermI objects.
Args : First argument is the term of interest, second is the list
of relationship type terms.
π get_ancestor_terms
Title : get_ancestor_terms
Usage : get_ancestor_terms(TermI term, TermI predicate_terms): TermI
Function: Retrieves all ancestor terms of a given term, that satisfy
a relationship among those that are specified in the second
argument or undef otherwise.
Example :
Returns : Array of TermI objects.
Args : First argument is the term of interest, second is the list
of relationship type terms.
π get_leaf_terms
Title : get_leaf_terms
Usage : get_leaf_terms(): TermI
Function: Retrieves all leaf terms from the ontology. Leaf term is a
term w/o descendants.
Example : @leaf_terms = $obj->get_leaf_terms()
Returns : Array of TermI objects.
Args :
π get_root_terms
Title : get_root_terms
Usage : get_root_terms(): TermI
Function: Retrieves all root terms from the ontology. Root term is a
term w/o ancestors.
Example : @root_terms = $obj->get_root_terms()
Returns : Array of TermI objects.
Args :
π Factory for relationships and terms π
π relationship_factory
Title : relationship_factory
Usage : $fact = $obj->relationship_factory()
Function: Get (and set, if the implementation supports it) the object
factory to be used when relationship objects are created by
the implementation on-the-fly.
Example :
Returns : value of relationship_factory (a Bio::Factory::ObjectFactory
compliant object)
Args :
π term_factory
Title : term_factory
Usage : $fact = $obj->term_factory()
Function: Get (and set, if the implementation supports it) the object
factory to be used when term objects are created by
the implementation on-the-fly.
Example :
Returns : value of term_factory (a Bio::Factory::ObjectFactory
compliant object)
Args :
π§ Decorator Methods π§
okay so these methods come with a default implementation that uses the abstract methods defined for this interface. It might not be very efficient β so if you're an implementor, you are encouraged to override these methods if you can provide more efficient implementations. bestie, if you can make it faster, please do. it's giving main character energy. π₯
π get_all_terms
Title : get_all_terms
Usage : get_all_terms: TermI
Function: Retrieves all terms from the ontology.
This is more a decorator method. We provide a default
implementation here that loops over all root terms and gets
all descendants for each root term. The overall union of
terms is then made unique by name and ontology.
We do not mandate an order here in which the terms are
returned. In fact, the default implementation will return
them in unpredictable order.
Engine implementations that can provide a more efficient
method for obtaining all terms should definitely override
this.
Example : @terms = $obj->get_all_terms()
Returns : Array of TermI objects.
Args :
β οΈ heads up: no order is mandated for the returned terms, and the default implementation hands them back in an unpredictable order. don't build anything on top of an ordering that isn't promised. π
π find_terms
Title : find_terms
Usage : ($term) = $oe->find_terms(-identifier => "SO:0000263");
Function: Find term instances matching queries for their attributes.
An implementation may not support querying for arbitrary
attributes, but can generally be expected to accept
-identifier and -name as queries. If both are provided,
they are implicitly intersected.
Example :
Returns : an array of zero or more Bio::Ontology::TermI objects
Args : Named parameters. The following parameters should be recognized
by any implementation:
-identifier query by the given identifier
-name query by the given name
and that's where part 1 wraps, bestie β there's more coming, don't go anywhere π
π Experimental API method proposals π
okay so real talk bestie β ontologies are a brand new domain in bioperl, and ngl we are not sure yet what we're gonna want to do on and with ontologies in which situation. π
Everything from here on downwards is purely API description, written to solicit comment and feedback. The chance of any of it actually being implemented already? very slim. like, don't hold your breath, babe.
Disclaimer: As long as an API method stays in this section, it is subject to change β possibly even radical change, or complete deletion. If it's not implemented yet (and most likely it isn't), implement yourself at your own risk. π
So that's the disclaimer, periodt. But the reason the API description is here is to solicit feedback. Please feel encouraged to share your opinion, no matter what it is. (A notable difference of this API method to others is that there is actually no working code behind it β so the defense line is non-existent for practical purposes. come at us, we can't fight back π )
common_ancestor_path
- Title :
common_ancestor_path - Usage : (literally nothing yet β it's blank, bestie π)
- Function β Get the paths from two terms
AandBto termC, such that there is no other termDto whichAandBwould have a shorter path, provided there is a termCto which bothAandBare connected by a path.- Note that the path to the common ancestor between
AandAexists, has distancezero, and predicate"identity". β¨ - The search for the common ancestor
Ccan be further constrained by supplying a predicate term. If supplied, the predicates of the two paths(A,C)and(B,C)must have a common ancestor identical to the predicate, or that has a path to the predicate. π¦
- Note that the path to the common ancestor between
- Example : (also blank, iconic of it πΈ)
- Returns β The path of the first term to the common ancestor in scalar context, and both paths in list context. Paths are
Bio::Ontology::PathIcompliant objects. π - Args β The two terms (
Bio::Ontology::TermIobjects), and optionally a constraining common predicate (Bio::Ontology::TermIobject). The latter may also be given as a scalar, in which case it is treated as a boolean that, ifTRUE, means that the two paths must have identical predicates in order to be returned. π
and that's a wrap on this one, bestie π«Ά this page is from perl v5.32.1, dated 2021-08-15, and it's the Bio::O...ngineI(3pm) manual page β go forth and file feedback, mwah ππ
π¦ where this page comes from
- debian bookworm: libbio-perl-perl 1.7.8-1 Β· Perl
- debian trixie: libbio-perl-perl 1.7.8-1 Β· Perl
- ubuntu jammy: libbio-perl-perl 1.7.8-1 Β· Perl
- ubuntu noble: libbio-perl-perl 1.7.8-1 Β· Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms