Skip to content

Commit d308be0

Browse files
committed
typo fixes pointed out by devtools::spell_check()
1 parent 05e11d4 commit d308be0

12 files changed

+62
-60
lines changed

README.Rmd

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ install.packages("patentsview")
5454
```
5555
## Important API Change
5656

57-
The new version of the API requires an api key, or all of your requests will be blocked. An API key can be optained [here](https://patentsview.org/apis/keyrequest). The updated R package will look for an environmental variable PATENTSVIEW_API_KEY set to the value of your key. For windows it would be
57+
The new version of the API requires an API key, or all of your requests will be blocked. An API key can be obtained [here](https://patentsview.org/apis/keyrequest). The updated R package will look for an environmental variable PATENTSVIEW_API_KEY set to the value of your key. For windows it would be
5858
```
5959
set PATENTSVIEW_API_KEY=my_keys_value_without quotes
6060
```
@@ -83,4 +83,4 @@ Head over to the package's [webpage](https://docs.ropensci.org/patentsview/index
8383
This package was first introduced in 2017 in an [rOpenSci blog post](https://ropensci.org/blog/2017/09/19/patentsview/) which
8484
used the original version of the API. The same content, reworked to use the new version
8585
of the API, is available [here](articles/ropensci_blog_post.html). A draft of a possible Tech Note
86-
about the new version of the API and R package is [here]().
86+
about the new version of the API and R package is [here]().

vignettes/api-changes.Rmd

+21-21
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ vignette: >
99

1010

1111

12-
In July of 2021 the Patentview API team announced [upcoming API changes]( https://patentsview.org/data-in-action/whats-new-patentsview-july-2021). This page will explain the changes and impact to the
13-
[R package](#r-package-changes). Note that these are **breaking changes**, existing scripts will no longer run as-is using the new version of the API and the new version of the R package.
12+
In July of 2021 the Patentsview API team announced [upcoming API changes]( https://patentsview.org/data-in-action/whats-new-patentsview-july-2021). This page will explain the changes and impact to the
13+
[R package](#r-package-changes). Note that these are **breaking changes**, existing scripts will no longer run as-is using the the new version of the R package which uses the new version of the API.
1414

1515
## Summary of the API changes
16-
* Probably most importanly, the current shutdown date for the original version of the API
16+
* Probably most importantly, the current shutdown date for the original version of the API
1717
is February 12, 2025, as communicated in the August 2024 newsletter.
1818
* An [API key](#api-key-required) is now required.
1919
* All fields can be queried now and there is seemingly [no distinction](#operators) between using string and full text operators now, with a new [case sensitivity caveat](#case-sensitivity-caveat) though. Note that now some
2020
fields are returned in nested objects and would need to be fully qualified in the query/q: and
21-
fields/f: paramters. Ex. fields=c( "cpc_current.cpc_group_id") is used below.
21+
fields/f: parameters. Ex. fields=c( "cpc_current.cpc_group_id") is used below.
2222
* A result set's size seems unbounded now, you can now retrieve more than 100,000 rows. You'd need to be careful when setting all_pages = TRUE
2323
as the R package will page until the entire result set is retrieved which could be a million or more rows. Ex. search_pv('{"patent_type":"utility"}', all_pages=TRUE)
2424

2525
* Endpoint Changes
26-
- nber_subcategories went away- it was an endpoint in the original verson of the API
26+
- nber_subcategories went away- it was an endpoint in the original version of the API
2727
- Endpoints are now singular, ex. patent not patents. The returned entities are still plural for the most part.
2828
- Now there are [23 endpoints](#endpoints), up from the original 7
2929

@@ -63,7 +63,7 @@ The Patentsview API team has provided a Swagger UI page for the new version of t
6363
- /api/v1/publication/rel_app_text/
6464
- /api/v1/publications/
6565
- /api/v1/wipo/
66-
2. Five of the original api's endpoints have singular names but lighter responses and fewer queryable fields as mentioned above.
66+
2. Five of the original API's endpoints have singular names but lighter responses and fewer queryable fields as mentioned above.
6767
- /api/v1/assignee/
6868
- /api/v1/inventor/
6969
- /api/v1/location/
@@ -85,10 +85,10 @@ Things to note
8585

8686

8787
### HATEOAS Links <a name="HATEOAS">
88-
Some of the returned fields are HATEOAS (Hypermedia as the Engine of Application State) links to retrieve more information about that field. Slightly funky is the cpc_current's cpc_group, returned by the patents endpoint. Here the slash in the CPC is turned into a colon. This is a peculiarity of two of the new convience urls that shouldn't be noticable in the r package, unless you are trying to infer the USPC and CPC values from the returned urls, without actually calling back for this data.
88+
Some of the returned fields are HATEOAS (Hypermedia as the Engine of Application State) links to retrieve more information about that field. Slightly funky is the cpc_current's cpc_group, returned by the patents endpoint. Here the slash in the CPC is turned into a colon. This is a peculiarity of two of the new convenience urls that shouldn't be noticeable in the r package, unless you are trying to infer the USPC and CPC values from the returned urls, without actually calling back for this data.
8989

90-
Here we'll call the patent endpoint to get CPC fields for a particular patend, some of
91-
the fields, like the cpc_group, are HATEOAS links:
90+
Here we'll call the patent endpoint to get CPC fields for a particular patent, some of
91+
the returned fields, like the cpc_group, are HATEOAS links:
9292

9393

9494
``` r
@@ -105,11 +105,11 @@ library(patentsview)
105105

106106
result <- search_pv(query, fields=fields)
107107

108-
# as noted above, the CPC related fields aren't the same as they were in the
108+
# As noted above, the CPC related fields aren't the same as they were in the
109109
# original version of the API. Also note that not all requested fields were
110110
# returned and that _id-less, HATEOAS fields were returned.
111111
unnested <- unnest_pv_data(result$data)
112-
z <- lapply(names(unnested $cpc_current), function(x) {
112+
z <- lapply(names(unnested$cpc_current), function(x) {
113113
print(paste0(x,': ', unnested$cpc_current[[x]][[1]]))
114114
})
115115
#> [1] "patent_id: 11530080"
@@ -123,9 +123,9 @@ library(patentsview)
123123
```
124124
Note that going to these links in a browser will result in a 403 Unauthorized, as no API key is sent.
125125

126-
There is a new method in the R package to retrive data from the HATEOAS links, just pass the returned
126+
There is a new method in the R package to retrieve data from the HATEOAS links, just pass the returned
127127
link and the R package will retrieve the data for you. You can also pass an arbitrary link that hits
128-
the API. This can be particualarly useful if you want to see what the response would be from a link
128+
the API. This can be particularly useful if you want to see what the response would be from a link
129129
found in the [API's documentation](https://search.patentsview.org/docs/docs/Search%20API/SearchAPIReference/).
130130

131131

@@ -209,7 +209,7 @@ Slight weirdness/sleight of hand where the returned field name looses the _id of
209209
```
210210

211211
### Throttling <a name="throttling"></a>
212-
The API will now allow 45 requests per minute, making more requests will anger the API. It will send back an error code with a header indicating how many seconds to wait before sending more queries. The R package will take care of this for you. It will sleep for the required number of seconds before resubmitting your query, seemlessly to your script.
212+
The API will now allow 45 requests per minute, making more requests will anger the API. It will send back an error code with a header indicating how many seconds to wait before sending more queries. The R package will take care of this for you. It will sleep for the required number of seconds before resubmitting your query, seamlessly to your script.
213213

214214
This means that queries could take a lot longer to run now. Ex. a query that would
215215
return 100,000 rows would now take 3.7 hours to run as each request can return at most 1,000 rows.
@@ -218,7 +218,7 @@ return 100,000 rows would now take 3.7 hours to run as each request can return a
218218

219219

220220
### A Note on Paging <a name="a-note-on-paging">
221-
The API team changed how paging works and there is an important subtility that the R package
221+
The API team changed how paging works and there is an important subtlety that the R package
222222
handles for you. This screams for a python library so python users don't need to worry about this and
223223
throttling! Here's a comment in search-pv.R that tries to explain the danger.
224224
```
@@ -230,7 +230,7 @@ throttling! Here's a comment in search-pv.R that tries to explain the danger.
230230
231231
# Doing this also protects users from needing to know the peculiarities
232232
# of the API's paging. Example: if a user requests a sort of
233-
# {"patent_date":"asc"}, on paging the after parameter may skip
233+
# [{"patent_date":"asc"}], on paging the after parameter may skip
234234
# to the next issue date before having retured all the data for the last
235235
# patent_date in the previous request - depending on where the
236236
# patent_dates change relative to the API's page breaks.
@@ -243,7 +243,7 @@ throttling! Here's a comment in search-pv.R that tries to explain the danger.
243243
See the paging discussion in this [PR](https://github.com/ropensci/patentsview/pull/29#discussion_r1059137212)
244244

245245
### String and Full Text Operators <a name="operators">
246-
The Tip below "Syntax" in the API's [documentation](https://search.patentsview.org/docs/docs/Search%20API/SearchAPIReference/#syntax) says
246+
The Tip below "Syntax" in the API's [documentation](https://search.patentsview.org/docs/docs/Search%20API/SearchAPIReference/#syntax) says:
247247

248248
When working with text data fields, wherever possible, we recommend using _text* operators over the
249249
_contains and _begins operator. The text operators treat these fields as full text data and hence
@@ -330,7 +330,7 @@ search_pv(query2, endpoint="brf_sum_text")
330330
The original version of the API seemed to be case insensitive. Not sure if this is a bug or feature
331331
in the new version of the API but it's something to be aware of.
332332

333-
As you'll see from the queries below, the two forms of equal now seem to be case senstive.
333+
As you'll see from the queries below, the two forms of equal now seem to be case sensitive.
334334

335335

336336
``` r
@@ -356,7 +356,7 @@ print (result$query_results$total_hits)
356356
* The version number ought to be bumped to 1.0.0 since there are breaking API changes
357357
* Result set size seems unbounded now. Should we warn if a query would return more than 100,000 rows with all_pages = TRUE?
358358
* [API throttling](#throttling) is handled for users.
359-
* The endpoints are now singluar, patent rather than patents
359+
* The endpoints are now singular, patent rather than patents
360360
* The API team changed how [paging](#a-note-on-paging) works but this is handled for users.
361361
* New methods
362362
+ HATEOAS and sample links can be retrieved using [retrieve_linked_data()](#HATEOAS)
@@ -378,11 +378,11 @@ range_query
378378
* The matched_subentities_only option went away along with subent_cnts and page
379379
* The R package uses the subdomain and paths for the new version of the API
380380
* The original [ropensci_blog_post](ropensci_blog_post.html) was reworked using the new version of the API
381-
* A hex logo was created using GuangchuangYus [hexSticker](https://github.com/GuangchuangYu/hexSticker)
381+
* A hex sticker was created using GuangchuangYu's [hexSticker](https://github.com/GuangchuangYu/hexSticker)
382382

383383
Possible Package Improvements <a name="possible-improvements">
384384

385385
* Have get_fields() and search_pv() throw a specialized error if a plural endpoint is passed
386386
* Add an issue template that warns users not to share their API keys
387-
* There's a new [tech note](ropensci_tech_note.html) that could be used when the new version of the R package is ready.
387+
* There's a new [tech note](ropensci_tech_note.html) that could be used when the new version of the R package is ready.
388388

0 commit comments

Comments
 (0)