Bio::DB::BiblioI(3pm)
π Bio::DB::BiblioI π
okay so bestie, this is Bio::DB::BiblioI(3pm) β an interface to a Bibliographic Query Service. Sit down, hydrate, we're doing this. π¦β¨
πΈ VERSION πΈ
version 1.70 β she's current, she's iconic, no cap. π
π SYNOPSIS π
okay so real talk first: this is an interface module. You do not instantiate it, bestie, it's giving abstract art πΌοΈ. You use the Bio::Biblio module instead, like this:
use Bio::Biblio;
my $biblio = Bio::Biblio->new(@args);
β¨ DESCRIPTION β¨
This interface is the whole blueprint for talking to a bibliographic repository β like, how to query it, how to pull citations out of it. That's the vibe. π«Ά
The citations you get back come in XML format, and if you want them as actual perl objects you can convert them using Bio::Biblio::IO. Slay. π
Also, this interface complies β with some simplifications, she's not doing extra credit β with the spec described in the OpenBQS project. Its home page is at http://www.ebi.ac.uk/~senger/openbqs/. iykyk. π
π ATTRIBUTES π
β has_next
Usage : my $is = $biblio->has_next;
Returns : 1 or undef
Args : none
It returns 1 if there's a next citation available in the underlying query collection. Otherwise it returns undef β like, nothing, ghosted, gone. π»
It throws an exception if this object does not represent any query result β see the explanation in method reset_retrieval elsewhere in this document. (Yes bestie, we get there, be patient. π)
β exists
Usage : my $exists = $biblio->exists;
Returns : 1 or undef
Args : none
It returns 1 if the underlying query collection represented by the $biblio object still exists β on the server side, like, remotely. π₯
So here's the situation: if you have a collection ID (maybe you stored it or printed it in a previous session) but you don't have a "Bio::Biblio" object representing it anymore, this is literally how you check whether the collection is still alive:
use Bio::Biblio;
print
Bio::Biblio->new(-collection_id => '1014324148861')->exists;
It throws an exception if this object does not represent any query result β see the explanation in method reset_retrieval elsewhere in this document.
β contains
Usage : my $yes = $biblio->contains ($vocabulary_name, $value);
Returns : 1 or undef
Args : $vocabulary_name defines a vocabulary where to look,
and a $value defines what to look for
It returns 1 if the given controlled vocabulary contains the given value. π―
For example β when you know that a vocabulary "MEDLINE/JournalArticle/properties" contains the value "COUNTRY", you can use it in the find method, like so:
$biblio->find ('United States', 'COUNTRY');
see how that works? obsessed. π
π METHODS π
π¦ get_collection_id
Usage : my $collection_id = $biblio->get_collection_id;
Returns : string identifying a query collection
represented by the $biblio object
Args : none
Every query collection is uniquely identify-able by its collection ID β every single one, no duplicates, main character energy only. π The value you get back can be used to populate another $biblio object, and then you can go access that collection. Cute, right?
π¦ get_count
Usage : my $count = $biblio->get_count;
Returns : integer
Args : none, or a string identifying a query collection
It returns the number of citations in the query collection represented by the calling $biblio object β or, if you pass one, in the collection whose ID is given as an argument. Either way, you're getting a number. π’
π¦ find
Usage : my $new_biblio = $biblio->find ($keywords, $attrs);
my $new_biblio = $biblio->find ('perl', 'abstract');
my $new_biblio = $biblio->find ( [ 'perl', 'Java' ] );
Returns : new Bio::Biblio object representing a new query
collection
Args : $keywords - what to look for (mandatory)
- a comma-delimited list of keywords, or
- an array reference with keywords as elements
$attrs - where to look in (optional)
- a comma-delimited list of attribute names, or
- an array reference with attribute names as elements
This is the main query method, bestie, the moment, the one we've all been waiting for. π
It looks for the $keywords in a default set of attributes β or, if $attrs is given, only in the given attributes.
And here's the slay: because it returns a new Bio::Biblio object, and that new object can be queried again, you can chain several invocations together like the queen you are:
$biblio->find ('Brazma')->find ('Robinson')->get_collection_id;
look at her go. πβοΈπ¨
π¦ reset_retrieval
Usage : $biblio->reset_retrieval;
Returns : nothing
Args : none
It sets an iterator stored in the $biblio object back to its beginning. After this, the retrieval methods has_next, get_next and get_more start iterating the underlying query collection again β from the start, rewound, replayed. π
It throws an exception if this object does not represent any query result (e.i. it does not contain a collection ID). Note that a collection ID is created automatically when this object was returned by afindmethod, or it can be assigned in a constructor using argument-collection_id.
π¦ get_next
Usage : my $citation = $biblio->get_next;
Returns : a citation in an XML format
Args : none
It returns the next available citation from the underlying query collection. β οΈ It throws an exception if there are no more citations β so to avoid that whole situation, use it together with the has_next method, like this:
my $result = $biblio->find ('brazma', 'authors');
while ( $result->has_next ) {
print $result->get_next;
}
It also throws an exception if this object does not represent any query result β see the explanation in reset_retrieval elsewhere in this document.
π¦ get_more
Usage : my $r_citations = $biblio->get_more (5);
Returns : an array reference - each element has a citation
in an XML format
Args : an integer 'how_many' citations to return;
default is 1 - but it is assigned with warning
It returns the next how_many available citations from the underlying query collection. She's chill about it: it does not throw any exception if 'how_many' is more than what's currently available β it simply returns less. Generous. π«Ά However π it does throw an exception if you use it again without calling reset_retrieval first. Rude but fair.
It also throws an exception if this object does not represent any query result β see the explanation in method reset_retrieval elsewhere in this document.
π¦ get_all_ids
Usage : my $r_ids = $biblio->get_all_ids;
Returns : an array reference - each element has
a citation identifier
Args : none
The identifiers of all citations in the underlying query collection get returned. π A usual pattern is to take those ids and then use them in the get_by_id method, like:
my $biblio = $repository->find ('brazma')->find ('robinson');
foreach my $id ( @{ $biblio->get_all_ids } ) {
print $biblio->get_by_id ($id);
}
It throws an exception if this object does not represent any query result β see the explanation in method reset_retrieval elsewhere in this document.
π¦ get_by_id
Usage : my $citation = $biblio->get_by_id ('12368254');
Returns : a citation in an XML format
Args : a citation identifier (PMID for Medline)
It returns a citation β and she does not care whether the citation is or is not in the underlying query collection (of course, it still has to be in the repository, bestie, let's be reasonable π).
π¦ get_all
Usage : my $all = $biblio->get_all;
Returns : a (big) string with all citations in an XML format
Args : none
It returns an XML valid string β which means the individual citations are also surrounded by a "set" XML tag, she's wrapped, she's contained, she's cozy π β representing all citations from the underlying query collection.
Heads up bestie: some servers may limit the number of citations which can be returned by this method. In such a case you need either to refine further your query collection (using thefindmethod) or to retrieve results by iteration (methodshas_next,get_next,get_more).
It throws an exception if this object does not represent any query result β see the explanation in method reset_retrieval elsewhere in this document.
π¦ destroy
Usage : $biblio->destroy;
Returns : nothing
Args : none
It sends a message to the remote server to forget (or free, or destroy β whatever the server chooses to do, honestly it's her call π ) the query collection represented by this object.
It throws an exception if this object does not represent any query collection.
π¦ get_vocabulary_names
Usage : print join ("\n", @{ $biblio->get_vocabulary_names });
Returns : an array reference - each element has a name
of a controlled vocabulary
Args : none
So the controlled vocabularies let you introspect bibliographic repositories β like snooping but make it academic π β and find out what citation resource types (journal and book articles, patents or technical reports, all of that) are provided by the repository, what attributes they have, and eventually what attribute values are allowed.
This method returns the names of all available controlled vocabularies. Those names can then be used in the other methods that deal with vocabularies: contains, get_entry_description, get_all_values, and get_all_entries. Teamwork, babes. π«Ά
π¦ get_entry_description
Usage : $biblio->get_entry_description ($voc_name, $value);
Returns : a string with a desciption
Args : $voc_name defines a vocabulary where to look,
and a $value defines whose description to return
Each vocabulary entry has its value (mandatory attribute), and can have a description (optional attribute, she's flexible β¨). That description might just be a human readable explanation of an attribute, or it can carry a more exact meaning. For example, the server implementation of the bibliographic query service provided by the EBI puts into attribute descriptions the words queryable and/or retrievable to distinguish the role of the attributes. ikr, so organised. π
It throws an exception if either the vocabulary or the value do not exist.
π¦ get_all_values
Usage : $biblio->get_all_values ($vocabulary_name);
Returns : an array reference - each element has a value (scalar)
from the given controlled vocabulary
Args : $vocabulary_name defines a vocabulary whose values
are being returned
It returns all values of the given vocabulary. Every last one. π―
It throws an exception if the vocabulary does not exist.
π¦ get_all_entries
Usage : $biblio->get_all_entries ($vocabulary_name);
Returns : a hash reference - keys are vocabulary values
and values are their descriptions
Args : $vocabulary_name defines a vocabulary whose entries
are being returned
It returns pairs of values and their descriptions for the whole vocabulary β the full package, no crumbs. π
It throws an exception if the vocabulary does not exist.
Here's one way to grab it and print it out:
my $name = 'MEDLINE2005/JournalArticle/properties';
use Data::Dumper;
print Data::Dumper->Dump ( [$biblio->get_all_entries ($name)],
['All entries']);
okay bestie that's where part 1 ends, don't go anywhere, there's more coming πΈ
π FEEDBACK π
Okay bestie, this part is literally just how to talk to us, and we want to hear from you, no cap.
π¬ Mailing lists
Here's the tea: user feedback is a whole integral part of how this module and all the other Bioperl modules grow and evolve. So like, send your comments and suggestions, preferably to the Bioperl mailing list. Your participation? much appreciated π«Ά
bioperl-l@bioperl.org - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
π Support
Hear me out: pls direct your usage questions and support issues to the mailing list:
bioperl-l@bioperl.org
and not straight to the module maintainer, okay? It's giving "don't DM the one person when there's a whole group chat of legends." So many experienced and responsive experts will be able to look at the problem and address it quickly π
And if at all possible, include a thorough description of the problem, with code and data examples. The more context, the faster the slay. β¨
π Reporting bugs
Found a bug? Iconic of you, honestly. Report it to the Bioperl bug tracking system so we can keep track of all the bugs and their resolutions β it's a whole vibe check for quality, fr fr. Bug reports can be submitted via the web:
https://redmine.open-bio.org/projects/bioperl/
βοΈ LEGAL βοΈ
βοΈ Authors
Martin Senger <martin.senger@gmail.com>
Β©οΈ Copyright and License
This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself.
And that's a wrap on Bio::DB::BiblioI(3pm), bestie! π This lil' page you just read was generated by perl v5.36.0 on 2023-02-14 β yeah, Valentine's Day, because this module loves you back π Go forth, query those bibliographies, and remember: read the docs, respect the license, and email the mailing list before you email the maintainer. Periodt. ππ¦
π¦ where this page comes from
- debian trixie: libbio-biblio-perl 1.70-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libbio-biblio-perl 1.70-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libbio-biblio-perl 1.70-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libbio-biblio-perl 1.70-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms