2 # This module is licensed under the same terms as Perl itself. You use,
3 # modify, and redistribute it under the terms of the Perl Artistic License.
8 Bio::IdentifiableI - interface for objects with identifiers
12 # to test this is an identifiable object
14 $obj->isa("Bio::IdentifiableI") ||
15 $obj->throw("$obj does not implement the Bio::IdentifiableI interface");
19 $object_id = $obj->object_id();
20 $namespace = $obj->namespace();
21 $authority = $obj->authority();
22 $version = $obj->version();
23 # Gets authority:namespace:object_id
24 $lsid = $obj->lsid_string();
25 # Gets namespace:object_id.version
26 $ns_string = $obj->namespace_string();
30 This interface describes methods expected on identifiable objects, i.e.
31 ones which have identifiers expected to make sense across a number of
32 instances and/or domains. This interface is modeled after pretty much
33 ubiquitous ideas for names in bioinformatics being
35 databasename:object_id.version
45 The object will also work with LSID proposals which adds the concept of an
46 authority, being the DNS name of the organisation assigning the namespace.
47 See L<http://lsid.sourceforge.net/>.
49 Helper functions are provided to make useful strings:
51 lsid_string - string complying to the LSID standard
53 namespace_string - string complying to the usual convention of
54 namespace:object_id.version
60 User feedback is an integral part of the evolution of this and other
61 Bioperl modules. Send your comments and suggestions preferably to one
62 of the Bioperl mailing lists. Your participation is much appreciated.
64 bioperl-l@bioperl.org - General discussion
65 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
69 Please direct usage questions or support issues to the mailing list:
71 I<bioperl-l@bioperl.org>
73 rather than to the module maintainer directly. Many experienced and
74 reponsive experts will be able look at the problem and quickly
75 address it. Please include a thorough description of the problem
76 with code and data examples if at all possible.
80 Report bugs to the Bioperl bug tracking system to help us keep track
81 the bugs and their resolution. Bug reports can be submitted via the
84 https://github.com/bioperl/bioperl-live/issues
86 =head1 AUTHOR - Ewan Birney
88 Email birney@ebi.ac.uk
92 package Bio
::IdentifiableI
;
96 use base
qw(Bio::Root::RootI);
98 =head1 Implementation Specific Functions
100 These functions are the ones that a specific implementation must
106 Usage : $string = $obj->object_id()
107 Function: a string which represents the stable primary identifier
108 in this namespace of this object. For DNA sequences this
109 is its accession_number, similarly for protein sequences
117 $self->throw_not_implemented();
123 Usage : $version = $obj->version()
124 Function: a number which differentiates between versions of
125 the same object. Higher numbers are considered to be
126 later and more relevant, but a single object described
127 the same identifier should represent the same concept
135 $self->throw_not_implemented();
142 Usage : $authority = $obj->authority()
143 Function: a string which represents the organisation which
144 granted the namespace, written as the DNS name for
145 organisation (eg, wormbase.org)
153 $self->throw_not_implemented();
160 Usage : $string = $obj->namespace()
161 Function: A string representing the name space this identifier
162 is valid in, often the database name or the name
163 describing the collection
171 $self->throw_not_implemented();
175 =head1 Implementation optional functions
177 These functions are helper functions that are provided by
178 the interface but can be overridden if so wished
183 Usage : $string = $obj->lsid_string()
184 Function: a string which gives the LSID standard
185 notation for the identifier of interest
195 return $self->authority.":".$self->namespace.":".$self->object_id;
200 =head2 namespace_string
202 Title : namespace_string
203 Usage : $string = $obj->namespace_string()
204 Function: a string which gives the common notation of
205 namespace:object_id.version
210 sub namespace_string
{
213 return $self->namespace.":".$self->object_id .
214 (defined($self->version()) ?
".".$self->version : '');