ropensci / openalexR

Getting bibliographic records from OpenAlex
https://docs.ropensci.org/openalexR/
Other
91 stars 20 forks source link

OpenAlex Entities change. #124

Closed yhan818 closed 1 year ago

yhan818 commented 1 year ago

Recently OpenAlex has updated its data model (Entities). see https://docs.openalex.org/api-entities/entities-overview vs. the old ones https://web.archive.org/web/20230420135948/https://docs.openalex.org/

For example, Grants and Funders are added. Is there a way to search funders?

It looks to me openAlex API is t here.

yjunechoe commented 1 year ago

Currently, the supported entities are listed in oa_entities():

oa_entities()
#> [1] "works"        "authors"      "venues"       "institutions" "concepts"

The new ones you mention are not yet supported and I suspect it would take some work before they're added. But thanks for raising this!

trangdata commented 1 year ago

Thank you @yhan818 for this push. I have seen funders and grants as new entities but haven't had a chance to add them. Hope to do this sometime this week. For now, you can still construct your own URL and use oa_request to obtain the output list.

Example: get funders located in Canada with more than 100,000 citations:

ca_funders <- oa_request(
  "https://api.openalex.org/funders?filter=country_code:ca,cited_by_count:>100000"
)
trangdata commented 1 year ago

Hi @yhan818 you can now get other entities with the latest version if you install the package from GitHub:

install.packages("remotes")
remotes::install_github("ropensci/openalexR")
library(openalexR)
#> Thank you for using openalexR!
#> To acknowledge our work, please cite the package by calling
#> `citation("openalexR")`.
oa_fetch(identifier = "F4320332161") # Funder
#> # A tibble: 1 × 17
#>   id    displ…¹ altern…² count…³ descr…⁴ homep…⁵ image…⁶ image…⁷ grant…⁸ works…⁹
#>   <chr> <chr>   <list>   <chr>   <chr>   <chr>   <chr>   <chr>     <int>   <int>
#> 1 http… Nation… <tibble> US      medica… https:… https:… https:…  230048  301804
#> # … with 7 more variables: cited_by_count <int>, summary_stats <list>,
#> #   ids <list>, counts_by_year <list>, roles <list>, updated_date <chr>,
#> #   created_date <chr>, and abbreviated variable names ¹​display_name,
#> #   ²​alternate_titles, ³​country_code, ⁴​description, ⁵​homepage_url, ⁶​image_url,
#> #   ⁷​image_thumbnail_url, ⁸​grants_count, ⁹​works_count
oa_fetch(identifier = "P4310311775") # Publisher
#> # A tibble: 1 × 19
#>   id     displ…¹ alter…² hiera…³ paren…⁴ lineage count…⁵ homep…⁶ image…⁷ image…⁸
#>   <chr>  <chr>   <list>    <int> <lgl>   <list>  <list>  <chr>   <chr>   <chr>  
#> 1 https… Elsevi… <chr>         0 NA      <chr>   <chr>   https:… https:… https:…
#> # … with 9 more variables: works_count <int>, cited_by_count <int>,
#> #   summary_stats <list>, ids <list>, counts_by_year <list>, roles <list>,
#> #   sources_api_url <chr>, updated_date <chr>, created_date <chr>, and
#> #   abbreviated variable names ¹​display_name, ²​alternate_titles,
#> #   ³​hierarchy_level, ⁴​parent_publisher, ⁵​country_codes, ⁶​homepage_url,
#> #   ⁷​image_url, ⁸​image_thumbnail_url
oa_fetch(identifier = "S1983995261") # Source
#> # A tibble: 1 × 26
#>   id            issn_l issn     displ…¹ host_…² host_…³ host_o…⁴ works…⁵ cited…⁶
#>   <chr>         <chr>  <list>   <chr>   <chr>   <chr>   <list>     <int>   <int>
#> 1 https://open… 2167-… <tibble> PeerJ   https:… PeerJ,… <tibble>   15175  199053
#> # … with 17 more variables: summary_stats <list>, is_oa <lgl>,
#> #   is_in_doaj <lgl>, ids <list>, homepage_url <chr>, apc_prices <list>,
#> #   apc_usd <int>, country_code <chr>, societies <lgl>,
#> #   alternate_titles <list>, abbreviated_title <chr>, type <chr>,
#> #   x_concepts <list>, counts_by_year <list>, works_api_url <chr>,
#> #   updated_date <chr>, created_date <chr>, and abbreviated variable names
#> #   ¹​display_name, ²​host_organization, ³​host_organization_name, …

Created on 2023-07-19 with reprex v2.0.2