About the package

rdnb is an R wrapper for the Deutsche Nationalbibliothek (German National Library) API, available at http://www.dnb.de. As the German central archival library, the German National Library is collecting, archiving, bibliographically classifying all German and German-language publications, foreign publications about Germany, translations of German works, and the works of German-speaking emigrants published abroad between 1933 and 1945.

All bibliographic data of the German National Library are provided free of charge and can be freely re-used under “Creative Commons Zero” (CC0 1.0) terms. The metadata and online interfaces are provided with no guarantee of their being continuous, punctual, error-free or complete, or of their not infringing the rights of third parties (e.g. personal rights and copyright).

A personal access token is required for usage and can be requested by sending an e-mail to the Interface Service (schnittstellen-service@dnb.de). The e-mail must include the required catalogue “Catalogue of German National Library (DNB) / Katalog der Deutschen Nationalbibliothek (DNB)” and the access option “via access token / über Zugangscode”.

If you do not want to enter your token for each R session, put the following in your .Renviron or .Rprofile file: DNB_TOKEN=PUTYOURTOKENHERE.

Package install

rdnb is available on CRAN and GitHub. Install from CRAN:

install.packages("rdnb")

To install the development version from GitHub the devtools-package is required.

if(packageVersion("devtools") < 1.6) {
  install.packages("devtools")
}
devtools::install_github("chgrl/rdnb")

Load the package

library(rdnb)
##  
## This is rdnb 0.1-0
##  
## Type changes("rdnb") to see changes/bug fixes, help(rdnb) for documentation
## or citation("rdnb") for how to cite rdnb.
## 

Search the DNB catalogue

rdnb provides two approaches to expose a search. For common search requests use the simple dnb_search function. More complex requests are possible using the dnb_advanced function.

Advanced search - dnb_advanced

dnb_advanced allows for complex requests using the Contextual Query Language (CQL). See the DNB advanced search help pages for available indices and a list of examples.

The following advanced search returns a list of german or english children’s books titled with ‘cat’, excluding titles containing ‘dog’, since the year 2011:

cats <- dnb_advanced("( (tit=katze OR tit=kater NOT tit=hund) OR (tit=cat NOT tit=dog) ) AND jhr>2010 AND mat=books AND (spr=ger OR spr=eng) AND sgt=K", limit="all")
## 
  |                                                                       
  |                                                                 |   0%
  |                                                                       
  |======================================                           |  59%
  |                                                                       
  |=========================================================        |  88%
  |                                                                       
  |=================================================================| 100%
## 341 records found

Utils

Number of records

Use n_rec to get the total number of records found by a request:

n_rec(cats)
## [1] 341