---
name: "RefDB::Pubmed"
section: "3pm"
platform: "linux"
package: "librefdb-perlmod-perl"
version: "1.2-2"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/RefDB::Pubmed"
---

# RefDB::Pubmed(3pm)

Perl extension for converting Pubmed bibliographic data to RIS

## NAME

RefDB::Pubmed - Perl extension for converting Pubmed bibliographic data to RIS

## SYNOPSIS

```
  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();
  }
```

## DESCRIPTION

RefDB::Pubmed allows one to convert Pubmed/Medline bibliographic data to the RIS 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.

## FEEDBACK

Send bug reports, questions, and comments to the refdb-users mailing list at:

refdb-users@lists.sourceforge.net

For list information and archives, please visit:

http://lists.sourceforge.net/lists/listinfo/refdb-users

## AUTHOR

Markus Hoenicka, markus@mhoenicka.de

## SEE ALSO

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.

## PMSet package

This helper package defines methods to deal with a Pubmed dataset

### new

Title   : new

Usage   : `$set` = new *PMset()*;

Function: Creates a new PMset object

### parse\_pmset

Title   : parse\_pmset

Usage   : `$set`-\>*parse\_pmset()*;

Function: parses the raw tagged Pubmed data

### convert\_pmset

Title   : *convert\_pmset()*

Usage   : `$set`-\>*convert\_pmset()*

Function: Converts the parsed data to RIS data

### dump\_pmset\_as\_ris

Title   : dump\_pmset\_as\_ris

Usage   : `$set`-\>*dump\_pmset\_as\_ris()*

Function: Dumps the data as a valid RIS set

### dump\_pmset\_as\_pm

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.

### \_convert\_tag

Title   : \_convert\_tag

Usage   : `$self`-\>\_convert\_tag($key, `$string`);

Function: Converts a Pubmed tag line to RIS and adds the result to a list

Argument: string containing the tag, something like 'KW  - '\
           string containing the data associated with the tag

### \_split\_mesh

Title   : \_split\_mesh

Usage   : `$self`-\>\_split\_mesh($string);

Function: splits a Pubmed MH line into one or more RIS KW lines

Argument: string containing the data associated with the MH tag

### set\_print\_unmapped

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

### set\_converter

Title   : set\_converter

Usage   : `$pm`-\>set\_converter("from\_enc", "to\_enc")

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

### add\_raw\_line

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

## Pubmed package

This package defines functions to deal with collections of Pubmed datasets

### new

Title   : new

Usage   : `$pm` = new *RefDB::Pubmed()*;

Function: Creates a new Pubmed object

### in

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

### string

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

### next\_pubmed\_set

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

### set\_print\_unmapped

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

### set\_encodings

Title   : set\_encodings

Usage   : `$pm`-\>set\_encodings("from\_enc", "to\_enc")

Function: set encodings of input and output data

Argument: from\_enc, to\_enc according to "man iconv\_open"
