ropensci / rcrossref

R client for various CrossRef APIs
https://docs.ropensci.org/rcrossref
Other
165 stars 21 forks source link

facet=TRUE fails with new REST API #219

Closed njahn82 closed 2 years ago

njahn82 commented 2 years ago

Return all facets not supported by re-launched API #216 :

https://api.crossref.org/journals/1803-2427/works?facet=t

and

https://api.crossref.org/journals/1803-2427/works?facet=*

don't work.

rcrossref::cr_journals('1803-2427', works=TRUE, facet=TRUE)
#> Warning: 500 (server error): /journals/1803-2427/works -
#> clojure.lang.ExceptionInfo: Response Exception qbits.spandex.Response@14c83d70
#> $meta
#> NULL
#> 
#> $data
#> # A tibble: 0 x 0
#> 
#> $facets
#> NULL

Created on 2021-07-28 by the reprex package (v2.0.0)

njahn82 commented 2 years ago

Fixed.

library(rcrossref)
cr_works(query = "lagotto", facet = TRUE)
#> $meta
#>   total_results search_terms start_index items_per_page
#> 1             9      lagotto           0             20
#> 
#> $data
#> # A tibble: 9 × 37
#>   alternative.id container.title created deposited published.print doi   indexed
#>   <chr>          <chr>           <chr>   <chr>     <chr>           <chr> <chr>  
#> 1 10.1046/j.136… Neuropathology… 2003-0… 2021-02-… 2002-03         10.1… 2021-0…
#> 2 <NA>           Journal of Vet… 2010-0… 2021-07-… 2007-05         10.1… 2021-0…
#> 3 10.1111/j.174… Journal of Sma… 2007-0… 2021-07-… 2007-08         10.1… 2021-0…
#> 4 10.1111/age.1… Animal Genetics 2019-0… 2019-11-… 2019-12         10.1… 2021-0…
#> 5 <NA>           Journal of Vet… 2015-0… 2021-07-… 2015-07         10.1… 2021-0…
#> 6 10.1177/03009… Veterinary Pat… 2020-1… 2020-12-… 2020-11         10.1… 2021-0…
#> 7 <NA>           Veterinary Rad… 2013-1… 2021-07-… 2014-05         10.1… 2021-0…
#> 8 10.1177/03009… Veterinary Pat… 2017-0… 2021-01-… 2017-11         10.1… 2021-0…
#> 9 S002199751500… Journal of Com… 2016-0… 2018-09-… 2016-01         10.1… 2021-0…
#> # … with 30 more variables: issn <chr>, issue <chr>, issued <chr>,
#> #   member <chr>, page <chr>, prefix <chr>, publisher <chr>, score <chr>,
#> #   source <chr>, reference.count <chr>, references.count <chr>,
#> #   is.referenced.by.count <chr>, subject <chr>, title <chr>, type <chr>,
#> #   url <chr>, volume <chr>, language <chr>, short.container.title <chr>,
#> #   author <list>, link <list>, license <list>, reference <list>,
#> #   archive <chr>, published.online <chr>, update.policy <chr>, …
#> 
#> $facets
#> $facets$affiliation
#>                                                                                                                               .id
#> 1                                        Department of Equine and Small Animal Medicine; University of Helsinki; Helsinki Finland
#> 2                                                                                             University of Turku, Turku, Finland
#> 3                                                                                       University of Helsinki, Helsinki, Finland
#> 4                                                                                           University of Bern, Bern, Switzerland
#> 5                                                                            Turku PET Centre; University of Turku; Turku Finland
#> 6                                                                   Tierärztliche Praxis für Kleintiere Dortmund‐Kley44149Germany
#> 7                                          Research Programs Unit, Molecular Neurology, University of Helsinki, Helsinki, Finland
#> 8                                                 Institute of Genetics, Vetsuisse Faculty, University of Bern, Bern, Switzerland
#> 9                                               Institute of Genetics, Vetsuisse Faculty University of Bern Bern 3001 Switzerland
#> 10                                      Institute for Pathology University of Veterinary Medicine Hannover Hannover 30559 Germany
#> 11                                                                                  Folkhälsan Research Center, Helsinki, Finland
#> 12                   Epilepsy Unit; Hospital for Children and Adolescents; Helsinki University Central Hospital; Helsinki Finland
#> 13                                                         Epilepsy Unit; Hospital for Children and Adolescents; Helsinki Finland
#> 14                                    Division of Neurological Sciences, Vetsuisse Faculty, University of Bern, Bern, Switzerland
#> 15                                                    Department of Veterinary Morphophysiology; University of Turin; Turin Italy
#> 16                Department of Veterinary Biosciences, Faculty of Veterinary Medicine, University of Helsinki, Helsinki, Finland
#> 17 Department of Veterinary Biosciences and Research Programs Unit; Molecular Neurology; University of Helsinki; Helsinki Finland
#> 18                                         Department of Pathology, University of Veterinary Medicine Hannover, Hannover, Germany
#> 19                                           Department of Molecular Genetics; Folkhälsan Institute of Genetics; Helsinki Finland
#> 20                  Department of Molecular Genetics, Folkhälsan Institute of Genetics, University of Helsinki, Helsinki, Finland
#> 21      Department of Equine and Small Animal Medicine, Faculty of Veterinary Medicine, University of Helsinki, Helsinki, Finland
#> 22                          Department of Companion Animal Clinical Sciences, Norwegian University of Life Sciences, Oslo, Norway
#> 23                                   Department of Clinical Sciences, Swedish University of Agricultural Science, Uppsala, Sweden
#> 24          Department of Biosciences, Faculty of Biological and Environmental Science, University of Helsinki, Helsinki, Finland
#> 25                                                                                  Clinica Neurologica Veterinaria, Milan, Italy
#> 26                                                                        Anicura, Albano Small Animal Hospital, Danderyd, Sweden
#>    V1
#> 1   2
#> 2   1
#> 3   1
#> 4   1
#> 5   1
#> 6   1
#> 7   1
#> 8   1
#> 9   1
#> 10  1
#> 11  1
#> 12  1
#> 13  1
#> 14  1
#> 15  1
#> 16  1
#> 17  1
#> 18  1
#> 19  1
#> 20  1
#> 21  1
#> 22  1
#> 23  1
#> 24  1
#> 25  1
#> 26  1
#> 
#> $facets$license
#>                                                                      .id V1
#> 1                           http://doi.wiley.com/10.1002/tdm_license_1.1  6
#> 2                          https://www.elsevier.com/tdm/userlicense/1.0/  1
#> 3                           https://creativecommons.org/licenses/by/4.0/  1
#> 4                  http://onlinelibrary.wiley.com/termsAndConditions#vor  1
#> 5 http://journals.sagepub.com/page/policies/text-and-data-mining-license  1
#> 6                         http://creativecommons.org/licenses/by-nc/4.0/  1
#> 
#> $facets$`container-title`
#>                                       .id V1
#> 1                    Veterinary Pathology  2
#> 2 Journal of Veterinary Internal Medicine  2
#> 3       Veterinary Radiology & Ultrasound  1
#> 4 Neuropathology and Applied Neurobiology  1
#> 5        Journal of Small Animal Practice  1
#> 6        Journal of Comparative Pathology  1
#> 7                         Animal Genetics  1
#> 
#> $facets$`publisher-name`
#>                 .id V1
#> 1             Wiley  6
#> 2 SAGE Publications  2
#> 3       Elsevier BV  1
#> 
#> $facets$`link-application`
#>                   .id V1
#> 1         text-mining  9
#> 2 similarity-checking  7
#> 
#> $facets$orcid
#>                                    .id V1
#> 1 http://orcid.org/0000-0002-8155-0041  1
#> 2 http://orcid.org/0000-0002-6521-1285  1
#> 3 http://orcid.org/0000-0001-9773-522X  1
#> 4 http://orcid.org/0000-0001-9740-2636  1
#> 
#> $facets$`update-type`
#> Dataframe mit 0 Spalten und 0 Zeilen
#> 
#> $facets$published
#>    .id V1
#> 1 2007  2
#> 2 2020  1
#> 3 2019  1
#> 4 2017  1
#> 5 2016  1
#> 6 2015  1
#> 7 2013  1
#> 8 2002  1
#> 
#> $facets$`funder-name`
#>                         .id V1
#> 1 Svenska Kulturfonden 2018  1
#> 2      Svenska Kulturfonden  1
#> 
#> $facets$archive
#>       .id V1
#> 1 Portico  2
#> 
#> $facets$`type-name`
#>               .id V1
#> 1 Journal Article  9
#> 
#> $facets$`relation-type`
#> Dataframe mit 0 Spalten und 0 Zeilen
#> 
#> $facets$issn
#>                                      .id V1
#> 1  http://id.crossref.org/issn/1544-2217  2
#> 2  http://id.crossref.org/issn/0891-6640  2
#> 3  http://id.crossref.org/issn/0300-9858  2
#> 4  http://id.crossref.org/issn/1939-1676  1
#> 5  http://id.crossref.org/issn/1748-5827  1
#> 6  http://id.crossref.org/issn/1365-2990  1
#> 7  http://id.crossref.org/issn/1365-2052  1
#> 8  http://id.crossref.org/issn/1058-8183  1
#> 9  http://id.crossref.org/issn/0305-1846  1
#> 10 http://id.crossref.org/issn/0268-9146  1
#> 11 http://id.crossref.org/issn/0022-4510  1
#> 12 http://id.crossref.org/issn/0021-9975  1
#> 
#> $facets$source
#>        .id V1
#> 1 Crossref  9
#> 
#> $facets$`journal-issue`
#>   .id V1
#> 1   6  3
#> 2   3  2
#> 3   8  1
#> 4   4  1
#> 5   2  1
#> 6   1  1
#> 
#> $facets$`category-name`
#>                                .id V1
#> 1               General Veterinary  6
#> 2  Pathology and Forensic Medicine  2
#> 3                    Small Animals  1
#> 4             Physiology (medical)  1
#> 5                        Neurology  1
#> 6                        Histology  1
#> 7                         Genetics  1
#> 8                 General Medicine  1
#> 9               Clinical Neurology  1
#> 10      Animal Science and Zoology  1
#> 
#> $facets$assertion
#>         .id V1
#> 1 published  1
#> 2  accepted  1
#> 
#> $facets$`assertion-group`
#>                   .id V1
#> 1 publication_history  1
#> 
#> $facets$`journal-volume`
#>   .id V1
#> 1  57  1
#> 2  55  1
#> 3  54  1
#> 4  50  1
#> 5  48  1
#> 6  29  1
#> 7  28  1
#> 8  21  1
#> 9 154  1
#> 
#> $facets$`funder-doi`
#>                                       .id V1
#> 1 http://dx.doi.org/10.13039/501100007247  1

Created on 2021-08-18 by the reprex package (v2.0.0)