Perl extension for converting pubmed bibliographic data to ris
use RefDB::Pubmed; my $infile = "-"; my $pm = new RefDB::Pubmed; $pm->in($infile); while ((my $set = $pm->next_pubmed_set())) { $set->parse_pmset(); $set->convert_pmset(); $set->dump_pmset_as_ris(); }
RefDB::Pubmed allows one to convert Pubmed/Medline bibliographic data to the \s-1RIS\s0 format understood by RefDB and most other bibliographic software. Data can be provided as a string or they can be read from a file/stream.
Send bug reports, questions, and comments to the refdb-users mailing list at:
For list information and archives, please visit:
http://lists.sourceforge.net/lists/listinfo/refdb-users
Markus Hoenicka, [email protected]
This module is part of the RefDB package, a reference manager and bibliography tool for markup languages. Please visit http://refdb.sourceforge.net for further information.
This helper package defines methods to deal with a Pubmed dataset
Title : new
Usage : $set = new PMset();
Function: Creates a new PMset object
Title : parse_pmset
Usage : $set->parse_pmset();
Function: parses the raw tagged Pubmed data
Title : convert_pmset()
Usage : $set->convert_pmset()
Function: Converts the parsed data to \s-1RIS\s0 data
Title : dump_pmset_as_ris
Usage : $set->dump_pmset_as_ris()
Function: Dumps the data as a valid \s-1RIS\s0 set
Title : dump_pmset_as_pm
Usage : $set->dump_pmset_as_pm()
Function: dumps the parsed data as a Pubmed set. The result differs from the input in that each tag with its associated data is always in a single line whereas the input data may contain continued lines w/o a tag. You can use this function to normalize the Pubmed tagged data.
Title : _convert_tag
Usage : $self->_convert_tag($key, $string);
Function: Converts a Pubmed tag line to \s-1RIS\s0 and adds the result to a list
Argument: string containing the tag, something like '\s-1KW\s0 - '
string containing the data associated with the tag
Title : _split_mesh
Usage : $self->_split_mesh($string);
Function: splits a Pubmed \s-1MH\s0 line into one or more \s-1RIS\s0 \s-1KW\s0 lines
Argument: string containing the data associated with the \s-1MH\s0 tag
Title : set_print_unmapped
Usage : $pm->set_print_unmapped\|(1)
Function: switch on or off printing of unmapped Pubmed tags
Argument: 0 (zero) to switch off or non-zero to switch on
Title : set_converter
Usage : $pm->set_converter(\*(L"from_enc\*(R", \*(L"to_enc\*(R")
Function: creates the iconv character encoding converter to be used
Arguments: from_enc, to_enc: the encoding of the source data and of the output data, respectively
Title : add_raw_line
Usage : $set->add_raw_line($_)
Function: adds a raw Pubmed line to the internal list
Argument: string containing a full Pubmed line
This package defines functions to deal with collections of Pubmed datasets
Title : new
Usage : $pm = new RefDB::Pubmed();
Function: Creates a new Pubmed object
Title : in
Usage : $pm->in($filename)
Function: Opens a file or input stream for reading
Returns : A filehandle or undef if the stream could not be opened
Argument: The path of a file or the name of an input stream
Title : string
Usage : $pm->string($string)
Function: Accepts an input string for parsing
Returns : 1 if Pubmed data, 0 if not Argument: A string containing input data
Title : next_pubmed_set
Usage : $pm->next_pubmed_set()
Function: Reads the next Pubmed dataset
Returns : A PMset containing the raw Pubmed tagged data, or undef if no data available
Title : set_print_unmapped
Usage : $pm->set_print_unmapped\|(1)
Function: switch on or off printing of unmapped Pubmed tags
Argument: 0 (zero) to switch off or non-zero to switch on
Title : set_encodings
Usage : $pm->set_encodings(\*(L"from_enc\*(R", \*(L"to_enc\*(R")
Function: set encodings of input and output data
Argument: from_enc, to_enc according to \*(L"man iconv_open\*(R"