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 · 3 comments
Open

Where are the x_concepts? #302

giuliogcantone opened this issue Nov 21, 2024 · 3 comments
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
@giuliogcantone
Copy link
Author

I noticed that while authors2df parses x_concepts, sources2d doesn't. Even processing a source entity by authors2df does not parse x_concepts.

@yjunechoe
Copy link
Collaborator

I noticed that while authors2df parses x_concepts, sources2d doesn't. Even processing a source entity by authors2df does not parse x_concepts.

I'm not sure that I follow (a reprex would help here). I'll just note that I see a couple Source objects are returning empty x_concepts fields, presumably because OpenAlex is starting to roll out the field's removal as part of its deprecation process.

# PubMed
s1 <- oa_fetch(identifier = "S4306525036", output = "list")
s1$x_concepts
#> list()

# DOAJ
s2 <- oa_fetch(identifier = "S4306401280", output = "list")
s2$x_concepts
#> list()

IMO {openalexR} can't do much here for a deprecated feature that's unstable and unmaintained from the API's end like this.

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