FTLocationFactory.pm: Fixed a long-standing issue at "from_string()"
[bioperl-live.git] / Bio / Ontology / PathI.pm
blob2c6f2d01181899315dffce8eaabba63c77d2c43f
2 # BioPerl module for PathI
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Hilmar Lapp <hlapp at gmx.net>
8 # (c) Hilmar Lapp, hlapp at gmx.net, 2003.
9 # (c) GNF, Genomics Institute of the Novartis Research Foundation, 2003.
11 # You may distribute this module under the same terms as perl itself.
12 # Refer to the Perl Artistic License (see the license accompanying this
13 # software package, or see http://www.perl.com/language/misc/Artistic.html)
14 # for the terms under which you may use, modify, and redistribute this module.
16 # THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
17 # WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
18 # MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20 # You may distribute this module under the same terms as perl itself
22 # POD documentation - main docs before the code
24 =head1 NAME
26 Bio::Ontology::PathI - Interface for a path between ontology terms
28 =head1 SYNOPSIS
30 # see documentation of methods and an implementation, e.g.,
31 # Bio::Ontology::Path
33 =head1 DESCRIPTION
35 This is the minimal interface for a path between two terms in
36 an ontology. Ontology engines may use this.
38 Essentially this is a very thin extension of the
39 L<Bio::Ontology::RelationshipI> interface. It basically adds an
40 attribute distance(). For a RelationshipI, you can think of distance as
41 equal to zero (subject == object) or 1 (subject != object).
43 =head1 FEEDBACK
45 =head2 Mailing Lists
47 User feedback is an integral part of the evolution of this and other
48 Bioperl modules. Send your comments and suggestions preferably to
49 the Bioperl mailing list. Your participation is much appreciated.
51 bioperl-l@bioperl.org - General discussion
52 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
54 =head2 Support
56 Please direct usage questions or support issues to the mailing list:
58 I<bioperl-l@bioperl.org>
60 rather than to the module maintainer directly. Many experienced and
61 reponsive experts will be able look at the problem and quickly
62 address it. Please include a thorough description of the problem
63 with code and data examples if at all possible.
65 =head2 Reporting Bugs
67 Report bugs to the Bioperl bug tracking system to help us keep track
68 of the bugs and their resolution. Bug reports can be submitted via
69 the web:
71 https://github.com/bioperl/bioperl-live/issues
73 =head1 AUTHOR - Hilmar Lapp
75 Email hlapp at gmx.net
77 =head1 APPENDIX
79 The rest of the documentation details each of the object methods.
80 Internal methods are usually preceded with a _
82 =cut
85 # Let the code begin...
88 package Bio::Ontology::PathI;
89 use strict;
91 use base qw(Bio::Ontology::RelationshipI);
94 =head2 distance
96 Title : distance
97 Usage : $obj->distance($newval)
98 Function: Get (and set if the implementation allows it) the distance
99 between the two terms connected by this path.
101 Example :
102 Returns : value of distance (a scalar)
103 Args : on set, new value (a scalar or undef, optional)
105 =cut
107 sub distance{
108 return shift->throw_not_implemented();
111 =head1 Bio::Ontology::RelationshipI Methods
113 =cut
115 =head2 subject_term
117 Title : subject_term
118 Usage : $subj = $rel->subject_term();
119 Function: Set/get for the subject term of this Relationship.
121 The common convention for ontologies is to express
122 relationships between terms as triples (subject, predicate,
123 object).
125 Returns : The subject term [Bio::Ontology::TermI].
126 Args :
128 =cut
130 =head2 object_term
132 Title : object_term
133 Usage : $object = $rel->object_term();
134 Function: Set/get for the object term of this Relationship.
136 The common convention for ontologies is to express
137 relationships between terms as triples (subject, predicate,
138 object).
140 Returns : The object term [Bio::Ontology::TermI].
141 Args :
143 =cut
145 =head2 predicate_term
147 Title : predicate_term
148 Usage : $type = $rel->predicate_term();
149 Function: Set/get for the predicate of this relationship.
151 For a path the predicate (relationship type) is defined as
152 the greatest common denominator of all predicates
153 (relationship types) encountered along the path. I.e., if
154 predicate A is-a predicate B, the greatest common
155 denominator for a path containing both predicates A and B is B
157 Returns : The predicate term [Bio::Ontology::TermI].
158 Args :
160 =cut
162 =head2 ontology
164 Title : ontology
165 Usage : $ont = $obj->ontology()
166 Function: Get the ontology that defined this relationship.
167 Example :
168 Returns : an object implementing Bio::Ontology::OntologyI
169 Args :
171 See L<Bio::Ontology::OntologyI>.
173 =cut