-
Notifications
You must be signed in to change notification settings - Fork 21
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
How to query by Topic? #273
Comments
I can replicate this and my impression is that OpenAlex is still rolling out Topics as a filter. So for Works objects, I see that you can now filter by Topics (vs. Concepts):
But for Authors, there's only a filter by Concepts and it's still marked as to-be deprecated:
I suspect this will resolve itself with time |
Thank you for responding so quickly and on the weekend! Sorry, I was going crazy trying to find a solution. |
No worries! This was good to check. For what it's worth I see the library(dplyr)
concepts_CS <- oa_fetch(
entity = "concepts",
search = "Computer Science"
) %>%
filter(level == 0) %>%
pull(id)
concepts_CS
#> [1] "https://openalex.org/C41008148"
oa_fetch(
x_concepts.id = concepts_CS,
entity = "authors",
verbose = TRUE,
options = list(sample = 1, seed = 1)
)
#> Requesting url: https://api.openalex.org/authors?filter=x_concepts.id%3Ahttps%3A%2F%2Fopenalex.org%2FC41008148&sample=1&seed=1
#> Getting 1 page of results with a total of 1 records...
#> # A tibble: 1 × 18
#> id display_name display_name_alterna…¹ relevance_score ids orcid works_count
#> <chr> <chr> <list> <dbl> <lis> <lgl> <int>
#> 1 https://openalex.o… K.S. McFall <chr [3]> 1.00 <chr> NA 10
#> # ℹ abbreviated name: ¹display_name_alternatives
#> # ℹ 11 more variables: cited_by_count <int>, counts_by_year <list>,
#> # affiliation_display_name <chr>, affiliation_id <chr>, affiliation_ror <chr>,
#> # affiliation_country_code <chr>, affiliation_type <chr>, affiliation_lineage <chr>,
#> # affiliations_other <list>, topics <list>, works_api_url <chr> |
I understand that "concepts" are being deprecated and "topics" are coming in. But, I'm struggling to query to get topics.
What I'm trying to do is construct an oa_fetch to get the authors with certain topics.
However, when I try something like the following query I get the response, "no records found"
try = oa_fetch(
topics.id = "T13075",
entity = "authors",
verbose = TRUE,
options = list(sample = 20, seed = 1)
)
The same is true when I replace "topics.id" with "topic_share.id"
However, when I change the query above from "entity="authors"" to "entity = "works"" the query does indeed work -- but I don't want the works I want the authors.
The text was updated successfully, but these errors were encountered: