bug 2549; fixed small bug in Bio::Taxon which doesn't catch -common_name
[bioperl-live.git] / Bio / Ontology / PathI.pm
blob9b2375023af44f2fe71afadb6bace24c66c40232
1 # $Id$
3 # BioPerl module for PathI
5 # Cared for by Hilmar Lapp <hlapp at gmx.net>
7 # (c) Hilmar Lapp, hlapp at gmx.net, 2003.
8 # (c) GNF, Genomics Institute of the Novartis Research Foundation, 2003.
10 # You may distribute this module under the same terms as perl itself.
11 # Refer to the Perl Artistic License (see the license accompanying this
12 # software package, or see http://www.perl.com/language/misc/Artistic.html)
13 # for the terms under which you may use, modify, and redistribute this module.
15 # THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
16 # WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
17 # MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19 # You may distribute this module under the same terms as perl itself
21 # POD documentation - main docs before the code
23 =head1 NAME
25 Bio::Ontology::PathI - Interface for a path between ontology terms
27 =head1 SYNOPSIS
29 # see documentation of methods and an implementation, e.g.,
30 # Bio::Ontology::Path
32 =head1 DESCRIPTION
34 This is the minimal interface for a path between two terms in
35 an ontology. Ontology engines may use this.
37 Essentially this is a very thin extension of the
38 L<Bio::Ontology::RelationshipI> interface. It basically adds an
39 attribute distance(). For a RelationshipI, you can think of distance as
40 equal to zero (subject == object) or 1 (subject != object).
42 =head1 FEEDBACK
44 =head2 Mailing Lists
46 User feedback is an integral part of the evolution of this and other
47 Bioperl modules. Send your comments and suggestions preferably to
48 the Bioperl mailing list. Your participation is much appreciated.
50 bioperl-l@bioperl.org - General discussion
51 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
53 =head2 Reporting Bugs
55 Report bugs to the Bioperl bug tracking system to help us keep track
56 of the bugs and their resolution. Bug reports can be submitted via
57 the web:
59 http://bugzilla.open-bio.org/
61 =head1 AUTHOR - Hilmar Lapp
63 Email hlapp at gmx.net
65 =head1 APPENDIX
67 The rest of the documentation details each of the object methods.
68 Internal methods are usually preceded with a _
70 =cut
73 # Let the code begin...
76 package Bio::Ontology::PathI;
77 use strict;
79 use base qw(Bio::Ontology::RelationshipI);
82 =head2 distance
84 Title : distance
85 Usage : $obj->distance($newval)
86 Function: Get (and set if the implementation allows it) the distance
87 between the two terms connected by this path.
89 Example :
90 Returns : value of distance (a scalar)
91 Args : on set, new value (a scalar or undef, optional)
93 =cut
95 sub distance{
96 return shift->throw_not_implemented();
99 =head1 Bio::Ontology::RelationshipI Methods
101 =cut
103 =head2 subject_term
105 Title : subject_term
106 Usage : $subj = $rel->subject_term();
107 Function: Set/get for the subject term of this Relationship.
109 The common convention for ontologies is to express
110 relationships between terms as triples (subject, predicate,
111 object).
113 Returns : The subject term [Bio::Ontology::TermI].
114 Args :
116 =cut
118 =head2 object_term
120 Title : object_term
121 Usage : $object = $rel->object_term();
122 Function: Set/get for the object term of this Relationship.
124 The common convention for ontologies is to express
125 relationships between terms as triples (subject, predicate,
126 object).
128 Returns : The object term [Bio::Ontology::TermI].
129 Args :
131 =cut
133 =head2 predicate_term
135 Title : predicate_term
136 Usage : $type = $rel->predicate_term();
137 Function: Set/get for the predicate of this relationship.
139 For a path the predicate (relationship type) is defined as
140 the greatest common denominator of all predicates
141 (relationship types) encountered along the path. I.e., if
142 predicate A is-a predicate B, the greatest common
143 denominator for a path containing both predicates A and B is B
145 Returns : The predicate term [Bio::Ontology::TermI].
146 Args :
148 =cut
150 =head2 ontology
152 Title : ontology
153 Usage : $ont = $obj->ontology()
154 Function: Get the ontology that defined this relationship.
155 Example :
156 Returns : an object implementing Bio::Ontology::OntologyI
157 Args :
159 See L<Bio::Ontology::OntologyI>.
161 =cut