-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
friendly wrappers for simple queries #242
Comments
You can use cr_works to get parsed metadata by DOI and select the fields. library(rcrossref)
rcrossref::cr_works(filter = list(doi="10.1007/s10479-023-05251-3"),
select = c("title", "issued", "author"))
#> $meta
#> total_results search_terms start_index items_per_page
#> 1 1 NA 0 20
#>
#> $data
#> # A tibble: 1 × 3
#> issued title author
#> <chr> <chr> <list>
#> 1 2023-03-01 RETRACTED ARTICLE: Prescriptive analytics applications in… <tibble>
#>
#> $facets
#> NULL Created on 2024-06-12 with reprex v2.1.0 You can also select columns after getting the data. library(rcrossref)
req <- rcrossref::cr_works(dois = "10.1007/s10479-023-05251-3")
req[["data"]][,c("title", "issued", "author")]
#> # A tibble: 1 × 3
#> title issued author
#> <chr> <chr> <list>
#> 1 RETRACTED ARTICLE: Prescriptive analytics applications in sus… 2023-… <tibble> Created on 2024-06-12 with reprex v2.1.0 To check if a DOI exists, check the agency. library(rcrossref)
rcrossref::cr_agency("10.1007/s10479-023-05251-3")
#> $DOI
#> [1] "10.1007/s10479-023-05251-3"
#>
#> $agency
#> $agency$id
#> [1] "crossref"
#>
#> $agency$label
#> [1] "Crossref" Created on 2024-06-12 with reprex v2.1.0 I will look into how to discover retracted articles with Crossref. I don't think I will support the other suggested data validation functions because they are not supported by the Crossref API. |
cr_cn(dois="10.4230/DagRep.5.1.96")
#> [1] "@article{https://doi.org/10.4230/dagrep.5.1.96,\n doi = {10.4230/DAGREP.5.1.96},\n url = {https://drops.dagstuhl.de/entities/document/10.4230/DagRep.5.1.96},\n author = {Greco, Salvatore and Klamroth, Kathrin and Knowles, Joshua D. and Rudolph, Günter},\n keywords = {multiple criteria decision making, evolutionary multiobjective optimization},\n language = {en},\n title = {Understanding Complexity in Multiobjective Optimization (Dagstuhl Seminar 15031)},\n publisher = {Schloss Dagstuhl – Leibniz-Zentrum für Informatik},\n year = {2015},\n copyright = {Creative Commons Attribution 3.0 Germany license}\n}\n"
cr_works(filter = list(doi="10.4230/DagRep.5.1.96"))
#> $meta
#> total_results search_terms start_index items_per_page
#> 1 0 NA 0 20
#> $data
#> # A tibble: 0 × 0
#> $facets
#> NULL |
Basically, I have a large database of bibtex entries: https://iridia-ulb.github.io/references/
|
A query like:
returns lots of data. It would be nice to have friendly wrappers for simple queries that only return the data queried as an R list:
or to check that a doi actually exists:
or to check that it matches some given data:
or to check that a paper is retracted or not (https://www.crossref.org/documentation/principles-practices/best-practices/versioning/#00327):
Ideally, this should not require having "bibtex" installed:
returns:
The text was updated successfully, but these errors were encountered: