Skip to content

Commit

Permalink
incorporate June's comment
Browse files Browse the repository at this point in the history
  • Loading branch information
trangdata committed Sep 19, 2024
1 parent d984082 commit f88a2aa
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions vignettes/articles/performance-optimization.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ output_list <- oa_fetch(
str(output_list, max.level = 1)
```

The list output can get quite unruly - each record contains dozens of fields, some of which may be multiply nested.
The list output can get quite unruly each record contains dozens of fields, some of which may be multiply nested.
Moreover, some records may have missing or incomplete fields, so extra care must be taken with the `output = "list"` approach.

One advantage of returning the output as a list is that you can always come back to process them as data frames later.
Expand Down Expand Up @@ -175,8 +175,14 @@ dir(tempdir(), pattern = "rec-\\d.rds$")

### Tips on generating the query URL to the OpenAlex API

You can certainly build your query using `oa_query()` and carefully read the [API documentation](https://docs.openalex.org/) to see what fields/filters are available.
However, I sometimes find it super helpful to use the OpenAlex web interface to build the query [interactively](https://openalex.org/works?page=1&filter=authorships.author.id%3Aa5086928770,open_access.is_oa%3Atrue&view=list,report,api).
Make sure you select the Gear icon on the top right and toggle on "Api query".
To build your query, you can use `oa_query()` and carefully read the [API documentation](https://docs.openalex.org/) to see what fields/filters are available.
For example, I know `cites` is a filter we can use:

```{r}
oa_query(entity = "works", cites = "W1160808132")
```

However, you might find it helpful to use the OpenAlex web interface to build the query [interactively](https://openalex.org/works?page=1&filter=authorships.author.id%3Aa5086928770,open_access.is_oa%3Atrue&view=list,report,api).
Make sure you select the Gear icon on the right and toggle on "Api query".

![Screenshot of OpenAlex web interface for generating API query URLs](images/openalex-web.png)

0 comments on commit f88a2aa

Please sign in to comment.