Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Wrapper to DataCite metadata
R
Branch: master
Failed to load latest commit information.
R
inst/ignore switched to using oai instead of older oai-pmh pkg fix #9
man-roxygen started tests, changed import from solr to solrium new pkg name
man added solr_connect params to remainder of dc_* solr fxns
tests started tests, changed import from solr to solrium new pkg name
.Rbuildignore ignore readme.rmd
.gitignore ignore .rhistory file
.travis.yml install oai and solr from github
DESCRIPTION added solr_connect params to remainder of dc_* solr fxns
LICENSE quote all the things description file, bump 99 ver, update license year
NAMESPACE started tests, changed import from solr to solrium new pkg name
README.Rmd fix solr install instructions
README.md fix solr install instructions
rdatacite.Rproj switched to using oai instead of older oai-pmh pkg fix #9

README.md

rdatacite

Build Status codecov.io

rdatacite is an R package that provides programmatic accesses to DataCite metadata via via

Installation

Install oai, it's not on CRAN yet:

devtools::install_github("sckott/oai")

And install a newer version of solr (>= v0.2.4), not yet on CRAN.

Note: If you want to use wt='csv' in dc_*() function calls, you'll need solr package version 0.1.8.99 or greater.

devtools::install_github("ropensci/solr")

Now install rdatacite

devtools::install_github("ropensci/rdatacite")
library('rdatacite')

OAI-PMH

Ping the service

dc_oai_identify()
#>   repositoryName                     baseURL protocolVersion
#> 1   DataCite MDS http://oai.datacite.org/oai             2.0
#>           adminEmail    earliestDatestamp deletedRecord
#> 1 admin@datacite.org 2011-01-01T00:00:00Z    persistent
#>            granularity compression compression.1
#> 1 YYYY-MM-DDThh:mm:ssZ        gzip       deflate
#>                                      description
#> 1 oaioai.datacite.org:oai:oai.datacite.org:12425

List metadata formats

dc_oai_listmetadataformats(id = "56225")
#> $`oai:oai.datacite.org:56225`
#>   metadataPrefix
#> 1         oai_dc
#> 2       datacite
#> 3   oai_datacite
#>                                                        schema
#> 1              http://www.openarchives.org/OAI/2.0/oai_dc.xsd
#> 2 http://schema.datacite.org/meta/nonexistant/nonexistant.xsd
#> 3              http://schema.datacite.org/oai/oai-1.0/oai.xsd
#>                             metadataNamespace
#> 1 http://www.openarchives.org/OAI/2.0/oai_dc/
#> 2      http://datacite.org/schema/nonexistant
#> 3     http://schema.datacite.org/oai/oai-1.0/

List identifiers

dc_oai_listidentifiers(from = '2011-06-01T', until = '2011-07-01T')
#> <ListIdentifiers> 5 X 4 
#> 
#>                   identifier            datestamp setSpec setSpec.1
#> 1 oai:oai.datacite.org:32153 2011-06-08T08:57:11Z     TIB  TIB.WDCC
#> 2 oai:oai.datacite.org:32200 2011-06-20T08:12:41Z     TIB TIB.DAGST
#> 3 oai:oai.datacite.org:32220 2011-06-28T14:11:08Z     TIB TIB.DAGST
#> 4 oai:oai.datacite.org:32241 2011-06-30T13:24:45Z     TIB TIB.DAGST
#> 5 oai:oai.datacite.org:32255 2011-07-01T12:09:24Z     TIB TIB.DAGST

Get records

dc_oai_getrecord(id = "56225")
#> <GetRecord> 1 X 23 
#> 
#>                   identifier            datestamp setSpec setSpec.1
#> 1 oai:oai.datacite.org:56225 2014-06-03T12:03:28Z      BL    BL.ADS
#> Variables not shown: title (chr), creator (chr), publisher (chr), date
#>      (chr), identifier.3 (chr), identifier.1 (chr), identifier.2 (chr),
#>      relation (chr), subject (chr), subject.1 (chr), language (chr), type
#>      (chr), type.1 (chr), format (chr), format.1 (chr), rights (chr),
#>      rights.1 (chr), coverage (chr), coverage.1 (chr)

You can pass in more than one identifier to id parameter.

Search API

This is the API for the same query interface you'd use on the DataCite website.

Search

Search for the term laser

dc_search(q = "laser", fl = c('doi','publicationYear'), rows = 5)
#> Source: local data frame [5 x 2]
#> 
#>                                             doi publicationYear
#> 1 10.15129/B7B3D9A1-1960-4D19-B1FE-9AF0A674B3CD            2015
#> 2                         10.2314/GBV:499941845            2004
#> 3                         10.2314/GBV:667365621            2010
#> 4                         10.2314/GBV:676509665            2011
#> 5                         10.2314/GBV:772538778            2012

Another search: published between 2000 and 2005

dc_search(q = "publicationYear:[2000 TO 2005]", fl = c('doi', 'publicationYear'), rows = 5)
#> Source: local data frame [5 x 2]
#> 
#>               doi publicationYear
#> 1 10.5517/CC96RBK            2005
#> 2 10.5517/CC7S7RZ            2004
#> 3 10.5517/CC7S7S0            2004
#> 4 10.5517/CC7S7T1            2004
#> 5 10.5517/CC7WF1K            2004

Facet

dc_facet(q = "wind", facet.field = 'publisher_facet', facet.limit = 5)
#> $facet_queries
#> NULL
#> 
#> $facet_fields
#> $facet_fields$publisher_facet
#>                                                                   X1    X2
#> 1         PANGAEA - Data Publisher for Earth & Environmental Science 30806
#> 2 Data-Planet™ Statistical Ready Reference by Conquest Systems, Inc.  1102
#> 3                                                        Unpublished   570
#> 4                                           Archaeology Data Service   233
#> 5                          Knowledge Network for Biocomplexity (KNB)   206
#> 
#> 
#> $facet_dates
#> NULL
#> 
#> $facet_ranges
#> NULL

Stats

dc_stats(q = "ecology", stats.field = 'date')
#>                       min            max count missing
#> 1 01-Jan-2007/29-Nov-2010 September 2014  9401    2557

More-like-this

dc_mlt(q = "ecology", mlt.fl = 'title', mlt.count = 2, fl = 'doi')
#> $docs
#> Source: local data frame [10 x 1]
#> 
#>                       doi
#> 1         10.5167/UZH-714
#> 2       10.5167/UZH-76892
#> 3       10.5167/UZH-49216
#> 4         10.5167/UZH-503
#> 5         10.5167/UZH-584
#> 6       10.5167/UZH-61344
#> 7       10.5167/UZH-38402
#> 8       10.5167/UZH-41217
#> 9         10.5167/UZH-402
#> 10 10.13140/2.1.3940.8968
#> 
#> $mlt
#> $mlt$`1710865`
#>                        doi
#> 1 10.7890/ETHZ-A-000467066
#> 2 10.7890/ETHZ-A-000467004
#> 
#> $mlt$`1712990`
#>                         doi
#> 1 10.13140/RG.2.1.3868.5287
#> 2 10.6084/M9.FIGSHARE.15727
#> 
#> $mlt$`1699696`
#>                         doi
#> 1 10.13140/RG.2.1.3868.5287
#> 2 10.6084/M9.FIGSHARE.15727
#> 
#> $mlt$`1695042`
#>                      doi
#> 1 10.5287/BODLEIANDVAJ.2
#> 2 10.5287/BODLEIAN8UGR.2

Meta

  • Please report any issues or bugs.
  • License: MIT
  • Get citation information for rdatacite in R doing citation(package = 'rdatacite')

ropensci

Something went wrong with that request. Please try again.