Skip to content

Commit

Permalink
update readme, vigenttes
Browse files Browse the repository at this point in the history
  • Loading branch information
sckott committed Dec 3, 2017
1 parent 2dc5854 commit 060a480
Show file tree
Hide file tree
Showing 8 changed files with 239 additions and 296 deletions.
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ rcrossref 0.3.4
### NEW FEATURES

* Added new function `crosscite()` to work with the
[Citeproc service](http://crosscite.org/citeproc/) (#60)
Citeproc service (http://crosscite.org/citeproc/) (#60)

### BUG FIXES

Expand Down
2 changes: 1 addition & 1 deletion R/rcrossref-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' @section Crossref APIs:
#' rcrossref interacts with the main Crossref metadata search API at
#' <https://github.com/CrossRef/rest-api-doc/blob/master/rest_api.md>,
#' the old metadata search API at <http://search.labs.crossref.org/>, their
#' the old metadata search API at http://search.labs.crossref.org/, their
#' DOI Content Negotiation service at
#' <http://citation.crosscite.org/docs.html>, and
#' the \emph{Text and Data Mining} project <http://tdmsupport.crossref.org/>
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ R interface to various CrossRef APIs
## CrossRef documentation

* Crossref API: [https://github.com/CrossRef/rest-api-doc/blob/master/rest_api.md](https://github.com/CrossRef/rest-api-doc/blob/master/rest_api.md)
* Crossref [metadata search API](http://search.labs.crossref.org/)
* Crossref metadata search API (http://search.labs.crossref.org/)
* CrossRef [DOI Content Negotiation](http://citation.crosscite.org/docs.html)
* Text and Data Mining [TDM](http://tdmsupport.crossref.org/)

Expand Down
223 changes: 106 additions & 117 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ R interface to various CrossRef APIs
## CrossRef documentation

* Crossref API: [https://github.com/CrossRef/rest-api-doc/blob/master/rest_api.md](https://github.com/CrossRef/rest-api-doc/blob/master/rest_api.md)
* Crossref [metadata search API](http://search.labs.crossref.org/)
* Crossref metadata search API (http://search.labs.crossref.org/)
* CrossRef [DOI Content Negotiation](http://citation.crosscite.org/docs.html)
* Text and Data Mining [TDM](http://tdmsupport.crossref.org/)

Expand Down Expand Up @@ -81,10 +81,6 @@ cat(cr_cn(dois = "10.1126/science.169.3946.635", format = "bibtex"))

```r
cr_cn(dois = "10.6084/m9.figshare.97218", format = "bibentry")
#> Boettiger C (2012). "Regime shifts in ecology and evolution (PhD
#> Dissertation)." doi: 10.6084/m9.figshare.97218 (URL:
#> http://doi.org/10.6084/m9.figshare.97218), <URL:
#> https://doi.org/10.6084/m9.figshare.97218>.
```

## Citation count
Expand All @@ -94,7 +90,7 @@ Citation count, using OpenURL

```r
cr_citation_count(doi = "10.1371/journal.pone.0042793")
#> [1] 13
#> [1] 17
```

## Search Crossref metadata API
Expand All @@ -108,23 +104,24 @@ The following functions all use the [CrossRef API](https://github.com/CrossRef/r
cr_funders(query = "NSF")
#> $meta
#> total_results search_terms start_index items_per_page
#> 1 8 NSF 0 20
#>
#> 1 9 NSF 0 20
#>
#> $data
#> # A tibble: 8 × 6
#> # A tibble: 9 x 6
#> id location
#> <chr> <chr>
#> 1 100000179 United States
#> 2 501100000930 Australia
#> 3 100000001 United States
#> 4 100003187 United States
#> 5 100008367 Denmark
#> 6 501100004190 Norway
#> 7 100006445 United States
#> 8 501100001809 China
#> 1 100006445 United States
#> 2 100003187 United States
#> 3 501100008982 Sri Lanka
#> 4 100008367 Denmark
#> 5 501100004190 Norway
#> 6 100000179 United States
#> 7 501100000930 Australia
#> 8 100000001 United States
#> 9 501100001809 China
#> # ... with 4 more variables: name <chr>, alt.names <chr>, uri <chr>,
#> # tokens <chr>
#>
#>
#> $facets
#> NULL
```
Expand All @@ -136,13 +133,13 @@ cr_funders(query = "NSF")
cr_agency(dois = '10.13039/100000001')
#> $DOI
#> [1] "10.13039/100000001"
#>
#>
#> $agency
#> $agency$id
#> [1] "crossref"
#>
#>
#> $agency$label
#> [1] "CrossRef"
#> [1] "Crossref"
```

### Search works (i.e., articles)
Expand All @@ -152,22 +149,20 @@ cr_agency(dois = '10.13039/100000001')
cr_works(filter = c(has_orcid = TRUE, from_pub_date = '2004-04-04'), limit = 1)
#> $meta
#> total_results search_terms start_index items_per_page
#> 1 688862 NA 0 1
#>
#> 1 1078355 NA 0 1
#>
#> $data
#> # A tibble: 1 × 29
#> alternative.id container.title created deposited
#> <chr> <chr> <chr> <chr>
#> 1 1142 Regional Environmental Change 2017-03-29 2017-03-29
#> # ... with 25 more variables: DOI <chr>, funder <list>, indexed <chr>,
#> # ISBN <chr>, ISSN <chr>, issued <chr>, license_date <chr>,
#> # license_URL <chr>, license_delay.in.days <chr>,
#> # license_content.version <chr>, link <list>, member <chr>,
#> # prefix <chr>, publisher <chr>, reference.count <chr>, score <chr>,
#> # source <chr>, subject <chr>, title <chr>, type <chr>,
#> # update.policy <chr>, URL <chr>, assertion <list>, author <list>,
#> # `clinical-trial-number` <list>
#>
#> # A tibble: 1 x 26
#> container.title created deposited
#> <chr> <chr> <chr>
#> 1 Journal of Materials Chemistry B 2015-01-13 2017-11-12
#> # ... with 23 more variables: DOI <chr>, indexed <chr>, ISSN <chr>,
#> # issue <chr>, issued <chr>, member <chr>, page <chr>, prefix <chr>,
#> # publisher <chr>, reference.count <chr>, score <chr>, source <chr>,
#> # subject <chr>, title <chr>, type <chr>, update.policy <chr>,
#> # URL <chr>, volume <chr>, abstract <chr>, assertion <list>,
#> # author <list>, funder <list>, link <list>
#>
#> $facets
#> NULL
```
Expand All @@ -178,15 +173,13 @@ cr_works(filter = c(has_orcid = TRUE, from_pub_date = '2004-04-04'), limit = 1)
```r
cr_journals(issn = c('1803-2427','2326-4225'))
#> $data
#> # A tibble: 2 × 16
#> alternative.id container.title created deposited funder indexed ISBN
#> <chr> <chr> <chr> <chr> <list> <chr> <chr>
#> 1 <NULL>
#> 2 <NULL>
#> # ... with 9 more variables: ISSN <chr>, issued <chr>, link <list>,
#> # publisher <chr>, subject <chr>, title <chr>, assertion <list>,
#> # author <list>, `clinical-trial-number` <list>
#>
#> # A tibble: 2 x 3
#> ISSN publisher
#> <chr> <chr>
#> 1 1805-4196,1803-2427 De Gruyter Open Sp. z o.o.
#> 2 2326-4225 American Scientific Publishers
#> # ... with 1 more variables: title <chr>
#>
#> $facets
#> NULL
```
Expand All @@ -198,30 +191,23 @@ cr_journals(issn = c('1803-2427','2326-4225'))
cr_licenses(query = 'elsevier')
#> $meta
#> total_results search_terms start_index items_per_page
#> 1 17 elsevier 0 20
#>
#> 1 22 elsevier 0 20
#>
#> $data
#> # A tibble: 17 × 2
#> URL
#> <chr>
#> 1 http://creativecommons.org/licenses/by-nc-nd/3.0/
#> 2 http://creativecommons.org/licenses/by-nc-nd/4.0/
#> 3 http://creativecommons.org/licenses/by/3.0/
#> 4 http://creativecommons.org/licenses/by/4.0
#> 5 http://creativecommons.org/licenses/by/4.0/
#> 6 http://doi.wiley.com/10.1002/tdm_license_1
#> 7 http://doi.wiley.com/10.1002/tdm_license_1.1
#> 8 http://journals.iucr.org/services/copyrightpolicy.html
#> 9 http://journals.iucr.org/services/copyrightpolicy.html#TDM
#> 10 http://onlinelibrary.wiley.com/termsAndConditions
#> 11 http://www.acm.org/publications/policies/copyright_policy#Background
#> 12 http://www.bioone.org/page/resources/researchers/rights_and_permissions
#> 13 http://www.elsevier.com/open-access/userlicense/1.0/
#> 14 http://www.elsevier.com/tdm/userlicense/1.0/
#> 15 http://www.emeraldinsight.com/page/tdm
#> 16 http://www.springer.com/tdm
#> 17 © 2012, Elsevier Inc., All Rights Reserved. Figure 8, part (B) (images of H
#> # ... with 1 more variables: work.count <int>
#> # A tibble: 22 x 2
#> URL work.count
#> <chr> <int>
#> 1 http://aspb.org/publications/aspb-journals/open-articles 1
#> 2 http://creativecommons.org/licenses/by-nc-nd/3.0/ 12
#> 3 http://creativecommons.org/licenses/by-nc-nd/4.0/ 7
#> 4 http://creativecommons.org/licenses/by-nc/4.0/ 1
#> 5 http://creativecommons.org/licenses/by/3.0/ 1
#> 6 http://creativecommons.org/licenses/by/4.0 1
#> 7 http://creativecommons.org/licenses/by/4.0/ 1
#> 8 http://doi.wiley.com/10.1002/tdm_license_1 157
#> 9 http://doi.wiley.com/10.1002/tdm_license_1.1 2166
#> 10 http://journals.iucr.org/services/copyrightpolicy.html 10
#> # ... with 12 more rows
```

### Search based on DOI prefixes
Expand All @@ -231,7 +217,7 @@ cr_licenses(query = 'elsevier')
cr_prefixes(prefixes = c('10.1016','10.1371','10.1023','10.4176','10.1093'))
#> $meta
#> NULL
#>
#>
#> $data
#> member name
#> 1 http://id.crossref.org/member/78 Elsevier BV
Expand All @@ -245,7 +231,7 @@ cr_prefixes(prefixes = c('10.1016','10.1371','10.1023','10.4176','10.1093'))
#> 3 http://id.crossref.org/prefix/10.1023
#> 4 http://id.crossref.org/prefix/10.4176
#> 5 http://id.crossref.org/prefix/10.1093
#>
#>
#> $facets
#> list()
```
Expand All @@ -258,17 +244,17 @@ cr_members(query = 'ecology', limit = 5)
#> $meta
#> total_results search_terms start_index items_per_page
#> 1 18 ecology 0 5
#>
#>
#> $data
#> # A tibble: 5 × 48
#> id
#> <int>
#> 1 7052
#> 2 6933
#> 3 7278
#> 4 7745
#> 5 9167
#> # ... with 47 more variables: primary_name <chr>, location <chr>,
#> # A tibble: 5 x 48
#> id primary_name
#> <int> <chr>
#> 1 336 Japanese Society of Microbial Ecology
#> 2 1950 Journal of Vector Ecology
#> 3 2080 The Japan Society of Tropical Ecology
#> 4 2467 Ideas in Ecology and Evolution
#> 5 3732 Japan Association for Landscape Ecology
#> # ... with 46 more variables: location <chr>,
#> # last_status_check_time <date>, total.dois <chr>, current.dois <chr>,
#> # backfile.dois <chr>, prefixes <chr>,
#> # coverge.affiliations.current <chr>, coverge.funders.backfile <chr>,
Expand Down Expand Up @@ -302,7 +288,7 @@ cr_members(query = 'ecology', limit = 5)
#> # flags.deposits.funders.backfile <chr>,
#> # flags.deposits.update.policies.current <chr>,
#> # flags.deposits.licenses.current <chr>, names <chr>, tokens <chr>
#>
#>
#> $facets
#> NULL
```
Expand All @@ -314,24 +300,24 @@ cr_members(query = 'ecology', limit = 5)

```r
cr_r()
#> [1] "10.1007/s10841-016-9867-9"
#> [2] "10.1016/b978-1-4557-3383-5.00008-7"
#> [3] "10.1515/9783110953527-fm"
#> [4] "10.1007/bf01571686"
#> [5] "10.1002/chin.201027234"
#> [6] "10.1002/9780470872864.ch23"
#> [7] "10.1090/s0273-0979-1992-00325-7"
#> [8] "10.1016/j.ejphar.2007.05.027"
#> [9] "10.1111/j.1538-7836.2005.01695.x"
#> [10] "10.1109/wisnet.2012.6172160"
#> [1] "10.2210/pdb4ut7/pdb"
#> [2] "10.1108/vjikms-01-2016-0002"
#> [3] "10.7251/ghte1410087p"
#> [4] "10.1111/j.1467-8292.1953.tb01215.x"
#> [5] "10.1093/jnci/djh130"
#> [6] "10.1061/40743(142)19"
#> [7] "10.1016/j.apradiso.2013.11.126"
#> [8] "10.1007/s00066-014-0720-3"
#> [9] "10.1021/jp9818176"
#> [10] "10.1016/j.enbuild.2003.10.013"
```

You can pass in the number of DOIs you want back (default is 10)


```r
cr_r(2)
#> [1] "10.1007/bf02256554" "10.2307/3467745"
#> [1] "10.1016/s0950-5601(54)80052-9" "10.1016/s0020-7292(12)61466-0"
```

## Get full text
Expand All @@ -346,37 +332,37 @@ out <-
cr_works(filter = list(has_full_text = TRUE,
license_url = "http://creativecommons.org/licenses/by/3.0/"))
(dois <- out$data$DOI)
#> [1] "10.1093/ecam/nem168" "10.1016/j.mri.2010.09.002"
#> [3] "10.1016/j.stem.2009.11.001" "10.1016/j.cellsig.2011.08.019"
#> [5] "10.1016/j.physletb.2011.09.006" "10.1155/2008/424320"
#> [7] "10.1155/2008/496467" "10.1155/2008/345478"
#> [9] "10.1155/2009/730902" "10.1155/2009/625469"
#> [11] "10.1155/2008/195873" "10.1016/j.physletb.2011.09.011"
#> [13] "10.1016/j.dnarep.2012.04.002" "10.1016/j.meegid.2008.11.006"
#> [15] "10.1016/j.physletb.2011.09.010" "10.4061/2010/478746"
#> [17] "10.4061/2010/348919" "10.1016/j.adhoc.2012.03.013"
#> [19] "10.1155/2011/124595" "10.1016/j.molcel.2007.09.005"
#> [1] "10.1016/s0370-2693(01)01481-2" "10.1016/s0370-2693(01)01478-2"
#> [3] "10.1016/s0370-2693(01)01480-0" "10.1016/s0370-2693(01)01482-4"
#> [5] "10.1016/s0370-2693(01)01488-5" "10.1016/s0370-2693(01)01490-3"
#> [7] "10.1016/s0370-2693(01)01492-7" "10.1016/s0370-2693(01)01465-4"
#> [9] "10.1016/s0370-2693(01)01442-3" "10.1016/s0370-2693(01)01418-6"
#> [11] "10.1016/s0370-2693(01)01395-8" "10.1016/s0370-2693(01)01426-5"
#> [13] "10.1016/s0370-2693(01)01415-0" "10.1016/s0370-2693(01)01425-3"
#> [15] "10.1016/s0370-2693(01)01410-1" "10.1016/s0370-2693(01)01419-8"
#> [17] "10.1016/s0370-2693(01)01420-4" "10.1016/s0370-2693(01)01427-7"
#> [19] "10.1016/s0370-2693(01)01282-5" "10.1016/s0370-2693(01)01424-1"
```

From the output of `cr_works` we can get full text links if we know where to look:


```r
do.call("rbind", out$data$link)
#> # A tibble: 39 × 4
#> # A tibble: 40 x 4
#> URL
#> <chr>
#> 1 http://downloads.hindawi.com/journals/ecam/2010/174726.pdf
#> 2 http://api.elsevier.com/content/article/PII:S0730725X10002742?httpAccept=te
#> 3 http://api.elsevier.com/content/article/PII:S0730725X10002742?httpAccept=te
#> 4 http://api.elsevier.com/content/article/PII:S1934590909005748?httpAccept=te
#> 5 http://api.elsevier.com/content/article/PII:S1934590909005748?httpAccept=te
#> 6 http://api.elsevier.com/content/article/PII:S0898656811002658?httpAccept=te
#> 7 http://api.elsevier.com/content/article/PII:S0898656811002658?httpAccept=te
#> 8 http://api.elsevier.com/content/article/PII:S0370269311010689?httpAccept=te
#> 9 http://api.elsevier.com/content/article/PII:S0370269311010689?httpAccept=te
#> 10 http://downloads.hindawi.com/journals/ijmms/2008/424320.pdf
#> # ... with 29 more rows, and 3 more variables: content.type <chr>,
#> 1 http://api.elsevier.com/content/article/PII:S0370269301014812?httpAccept=te
#> 2 http://api.elsevier.com/content/article/PII:S0370269301014812?httpAccept=te
#> 3 http://api.elsevier.com/content/article/PII:S0370269301014782?httpAccept=te
#> 4 http://api.elsevier.com/content/article/PII:S0370269301014782?httpAccept=te
#> 5 http://api.elsevier.com/content/article/PII:S0370269301014800?httpAccept=te
#> 6 http://api.elsevier.com/content/article/PII:S0370269301014800?httpAccept=te
#> 7 http://api.elsevier.com/content/article/PII:S0370269301014824?httpAccept=te
#> 8 http://api.elsevier.com/content/article/PII:S0370269301014824?httpAccept=te
#> 9 http://api.elsevier.com/content/article/PII:S0370269301014885?httpAccept=te
#> 10 http://api.elsevier.com/content/article/PII:S0370269301014885?httpAccept=te
#> # ... with 30 more rows, and 3 more variables: content.type <chr>,
#> # content.version <chr>, intended.application <chr>
```

Expand All @@ -400,8 +386,11 @@ if (!requireNamespace("crminer")) {
```r
library(crminer)
(links <- crm_links(dois[1]))
#> $pdf
#> <url> http://downloads.hindawi.com/journals/ecam/2010/174726.pdf
#> $xml
#> <url> https://api.elsevier.com/content/article/PII:S0370269301014812?httpAccept=text/xml
#>
#> $plain
#> <url> https://api.elsevier.com/content/article/PII:S0370269301014812?httpAccept=text/plain
```

Then use those URLs to get full text
Expand All @@ -415,7 +404,7 @@ crm_pdf(links)
#> Created: 2014-03-26
```

See also [fulltext](https://github.com/ropensci/fulltext) for getting scholarly text
See also [fulltext](https://github.com/ropensci/fulltext) for getting scholarly text
for text mining.


Expand Down
2 changes: 1 addition & 1 deletion inst/vign/crossref_vignette.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ knitr::opts_chunk$set(
comment = "#>",
warning = FALSE,
message = FALSE,
cache = TRUE
cache = FALSE
)
```

Expand Down
Loading

0 comments on commit 060a480

Please sign in to comment.