Skip to content

Commit

Permalink
LibraryCarpentry#307 Update 13-looking-up-data.md
Browse files Browse the repository at this point in the history
Replaced "-" with "_"
  • Loading branch information
mahdi-robbani authored Aug 24, 2023
1 parent 3cb004f commit 3c191c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions episodes/13-looking-up-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Because retrieving data from external URLs takes time, this exercise targets a s
- Facet by Star
- Choose the single row
- In the ISSN column use the dropdown menu to choose 'Edit column->Add column by fetching URLs'
- Give the column a name e.g. "Journal-Details"
- Give the column a name e.g. "Journal_details"
- In the expression box you need to write some GREL where the output of the expression is a URL which can be used to retrieve data (the format of the data could be HTML, XML, JSON, or some other text format)

In this case we are going to use the CrossRef API: [https://api.crossref.org/](https://api.crossref.org/). Read more about the CrossRef service: [https://crossref.org](https://crossref.org). Note that API providers may impose rate limits or have other requirements for using their data, so it's important to check the site's documentation. To comply with API rate limits, use the Throttle Delay setting to specify the number of milliseconds between URL requests. CrossRef, for instance, [asks users](https://www.crossref.org/documentation/retrieve-metadata/rest-api/tips-for-using-the-crossref-rest-api/#pick-the-right-service-level) to "specify a User-Agent header that properly identifies your script or tool and that provides a means of contacting you via email using 'mailto:'." User-agent headers provide administrators with user information that facilitates better administration and moderation of the API, and it is generally good etiquette to include a header with any API request.
Expand All @@ -79,7 +79,7 @@ At this point you should have a new cell containing a long text string in a form
OpenRefine has a function for extracting data from JSON (sometimes referred to as 'parsing' the JSON). The 'parseJson' function is explained in more detail at [https://docs.openrefine.org/manual/grelfunctions/#format-based-functions-json-html-xml](https://docs.openrefine.org/manual/grelfunctions/#format-based-functions-json-html-xml).

- In the new column you've just added use the dropdown menu to access 'Edit column->Add column based on this column'
- Add a name for the new column e.g. "Journal-Title"
- Add a name for the new column e.g. "Journal_title"
- In the Expression box type the GREL `value.parseJson().message.title`
- You should see in the Preview the Journal title displays

Expand Down

0 comments on commit 3c191c6

Please sign in to comment.