ropensci / patentsview

An R client to the PatentsView API
https://docs.ropensci.org/patentsview
Other
31 stars 9 forks source link

NULL data when changing the year in the example query #26

Closed dragonattheend closed 2 years ago

dragonattheend commented 2 years ago

This is an example from the manual.

> search_pv(query = '{"_gt":{"patent_year":2007}}')
$data
#### A list with a single data frame on a patent level:

List of 1
 $ patents:'data.frame':    25 obs. of  3 variables:
  ..$ patent_id    : chr [1:25] "10000000" ...
  ..$ patent_number: chr [1:25] "10000000" ...
  ..$ patent_title : chr [1:25] "Coherent LADAR using intra-pixel quadrature detection" ...

$query_results
#### Distinct entity counts across all downloadable pages of output:

total_patent_count = 100,000

This is what I get when I switch 2007 to 2008.

> search_pv(query = '{"_gt":{"patent_year":2008}}')
$data
#### A list with a single data frame on a patent level:

List of 1
 $ patents: NULL

$query_results
#### Distinct entity counts across all downloadable pages of output:

total_patent_count = 0

I'm using the dev version of the package.

dragonattheend commented 2 years ago
search_pv(
+     query = qry_funs$eq(inventor_last_name = "chambers"),
+     all_pages = TRUE
+ )
Error in request_apply(res, method, query, base_url, arg_list, ...) : 
  No records matched your query...Can't download multiple pagesFALSE

This is an example from https://crew102.github.io/patentsview/articles/getting-started.html#fn1

I was also getting some EOF errors with other examples.

Feel like I'm missing something...

qingluandian commented 2 years ago

Hey, I also got the same errors. when I ran the codes post in the mannual in the Application:Citation network from https://docs.ropensci.org/patentsview/articles/citation-networks.html

rel_pats_res <- search_pv(
   query = list(patent_number = rel_pats$patent_number),
   fields =  c("cited_patent_number", "patent_number", "patent_title"), 
   all_pages = TRUE, method = "POST"
 )

I also got the warnings:

Error in request_apply(res, method, query, base_url, arg_list, ...) : 
  No records matched your query...Can't download multiple pagesFALSE

To confirm whether the problem I met was as the same as @dragonattheend, I tried the swith from 2007 to 2008 and the example from https://crew102.github.io/patentsview/articles/getting-started.html#fn1, I also got

> search_pv(query = '{"_gte":{"patent_date":"2007-01-01"}}')
$data
#### A list with a single data frame on a patent level:

List of 1
 $ patents:'data.frame':    25 obs. of  3 variables:
  ..$ patent_id    : chr [1:25] "10000000" ...
  ..$ patent_number: chr [1:25] "10000000" ...
  ..$ patent_title : chr [1:25] "Coherent LADAR using intra-pixel quadrature detection" ...

$query_results
#### Distinct entity counts across all downloadable pages of output:

total_patent_count = 100,000
> search_pv(query = '{"_gte":{"patent_date":"2008-01-01"}}')
$data
#### A list with a single data frame on a patent level:

List of 1
 $ patents: NULL

$query_results
#### Distinct entity counts across all downloadable pages of output:

total_patent_count = 0
> search_pv(
+   query = qry_funs$eq(inventor_last_name = "chambers"),
+   all_pages = TRUE
+   )
Error in request_apply(res, method, query, base_url, arg_list, ...) : 
  No records matched your query...Can't download multiple pagesFALSE

Futhermore, I tried to run the query that I have successfully run the day before yesterday, I was surprised to get the warnings as following:

Error: parse error: premature EOF

                     (right here) ------^

It seems that the problem happened in these two days. Looking forward to your warm reply!

qingluandian commented 2 years ago

The problem have been sovled! @dragonattheend maybe you can try the codes in your machine again. I think this might be the problem of the original database of PatentsView, and now it gets back to be normal!

> search_pv(query = '{"_gte":{"patent_date":"2008-01-01"}}')
$data
#### A list with a single data frame on a patent level:

List of 1
 $ patents:'data.frame':    25 obs. of  3 variables:
  ..$ patent_id    : chr [1:25] "10000000" ...
  ..$ patent_number: chr [1:25] "10000000" ...
  ..$ patent_title : chr [1:25] "Coherent LADAR using intra-pixel quadrature detection" ...

$query_results
#### Distinct entity counts across all downloadable pages of output:

total_patent_count = 100,000
> search_pv(
+   query = qry_funs$eq(inventor_last_name = "chambers"),
+   all_pages = TRUE
+  )
$data
#### A list with a single data frame on a patent level:

List of 1
 $ patents:'data.frame':    2273 obs. of  3 variables:
  ..$ patent_id    : chr [1:2273] "10000988" ...
  ..$ patent_number: chr [1:2273] "10000988" ...
  ..$ patent_title : chr [1:2273] "Seal assemblies in subsea rotating control devices" ...

$query_results
#### Distinct entity counts across all downloadable pages of output:

total_patent_count = 2,273
dragonattheend commented 2 years ago

now it gets back to be normal!

Thanks a lot, it works now for me too!