Skip to content
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

Where are the x_concepts? #302

Open
giuliogcantone opened this issue Nov 21, 2024 · 1 comment
Open

Where are the x_concepts? #302

giuliogcantone opened this issue Nov 21, 2024 · 1 comment
Labels
OpenAlex question Further information is requested

Comments

@giuliogcantone
Copy link

I noticed that fetching for authors or sources does not parse anymore x_concepts.
I know that is deprecated, yet that information is kept in the API, can be restored in the parsed tibble?

@yjunechoe
Copy link
Collaborator

yjunechoe commented Nov 21, 2024

We'd prefer to encourage users to not use deprecated information anymore moving forward (in accordance with OpenAlex's plan), so I doubt we'd bring it back for the default behavior of oa_fetch().

But the option remains available to power users (just at your own risk) via a manual extraction of the x_concepts field from output = "list" and a separate call to concepts2df():

library(openalexR)

authors <- oa_fetch("authors", options = list(sample = 1), output = "list")

library(dplyr)

df <- authors2df(authors) |>
  mutate(x_concepts = lapply(authors, \(x) concepts2df(x$x_concepts)))

colnames(df)
#>  [1] "id"                        "display_name"              "display_name_alternatives"
#>  [4] "relevance_score"           "ids"                       "orcid"                    
#>  [7] "works_count"               "cited_by_count"            "counts_by_year"           
#> [10] "2yr_mean_citedness"        "h_index"                   "i10_index"                
#> [13] "last_known_institutions"   "topics"                    "works_api_url"            
#> [16] "x_concepts"
  
df$x_concepts
#> [[1]]
#> # A tibble: 3 × 4
#>   id                             display_name     wikidata                 level
#>   <chr>                          <chr>            <chr>                    <int>
#> 1 https://openalex.org/C15744967 Psychology       https://www.wikidata.or…     0
#> 2 https://openalex.org/C41008148 Computer science https://www.wikidata.or…     0
#> 3 https://openalex.org/C71924100 Medicine         https://www.wikidata.or…     0

@yjunechoe yjunechoe added question Further information is requested OpenAlex labels Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OpenAlex question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants