ropensci / taxize

A taxonomic toolbelt for R
https://docs.ropensci.org/taxize
Other
268 stars 61 forks source link

Something is wrong with tnrs post requests #226

Closed sckott closed 10 years ago

sckott commented 10 years ago

E.g., this fails

tnrs(query = mynames, getpost="POST")

Error : Expectation Failed

Error in names(tmp) <- tolower(names(tmp)) : 
  attempt to set an attribute on NULL

but get requests work

tnrs(query = mynames, getpost="GET")

Calling http://taxosaurus.org/retrieve/b5bd18d940dff2cd61b5c5dfd9c52e7f
     submittedname     acceptedname    sourceid score      matchedname annotations
2  Panthera tigris       Megalachne iPlant_TNRS  0.48       Pantathera      Steud.
1 Magnifera indica Mangifera indica iPlant_TNRS  0.98 Mangifera indica          L.
                                    uri
2 http://www.tropicos.org/Name/40015658
1  http://www.tropicos.org/Name/1300071

haven't been able to track down bug yet. I think it may be on the Taxosaurus side. But a curl POST call on the cli works, hmmmm

sckott commented 10 years ago

Self: Ask Naim about this.

jarioksa commented 10 years ago

I tried this today (Jan 21,2014), and my exprerience is completely different (taxize 0.1.8 2013-12-17, R Under development (unstable) (2014-01-20 r64841), Ubuntu Linux 13.10): tnrs(query = mynames, getpost="POST") worked like charm, like did tnrs(mynames). However, this failed:

tnrs(query = mynames, getpost="GET")
Calling [ "http://taxosaurus.org/retrieve/f4176b361035a6803e4aaab117fd0c41" ]
Error in function (type, msg, asError = TRUE)  : Could not resolve host: 
Error in names(tmp) <- tolower(names(tmp)) : 
  attempt to set an attribute on NULL

Changes in the server side? (Issue #231 still persisted.)

As such, the error message you got was similar as in issue #231 where it was triggered by an empty or malformed result from the server.

sckott commented 10 years ago

@jarioksa Thanks for checking on this. I am getting the same thing you are under stable R 3.0.2. I think something must have changed with Taxosaurus on the server side. I will see if I can build in error catching too for this problem.

sckott commented 10 years ago

I had an error in the code I'm fixing now, but there is another issue in that we are getting quotes around names where they shouldn't be, which I'm asking about now.

jarioksa commented 10 years ago

This seems to happen with NCBI acceptedname and submittedname entries. When I looked at this in a Windows computer on Thursday, there also was an extra visible "\r" at the end of the name. The iPlant names are unquoted. I have gsub'ed away these NCBI extras when using the names: gsub("\\\"","",xncbi$submittedname)

It seems this is something that comes from the server.

sckott commented 10 years ago

Right, I think there is something wrong on their side. I did report this problem to them.

sckott commented 10 years ago

I have been meaning to get on this, but I think I will deal with this in the next minor version pushed to CRAN - I need to get a new version up to CRAN now.

sckott commented 10 years ago

I don't see these errors anymore, think this is fixed