ropensci / rfishbase

R interface to the fishbase.org database
https://docs.ropensci.org/rfishbase
111 stars 41 forks source link

occurrence broken (api?) #55

Closed jebyrnes closed 8 years ago

jebyrnes commented 9 years ago

Might be the same api issue as before

occurrence("Oreochromis niloticus")
Source: local data frame [0 x 0]

Warning messages:
1: In check_and_parse(resp) : server error: (500) Internal Server Error
2: In error_checks(parsed, resp = resp) :
  server error for query http://fishbase.ropensci.org/occurrence?SpecCode=2&limit=200&fields=
cboettig commented 9 years ago

@sckott thoughts?

sckott commented 9 years ago

Back to computer in about 2/3 hrs, will do then

On Fri, Jun 26, 2015, 3:49 PM Carl Boettiger notifications@github.com wrote:

@sckott https://github.com/sckott thoughts?

— Reply to this email directly or view it on GitHub https://github.com/ropensci/rfishbase/issues/55#issuecomment-115910970.

jebyrnes commented 9 years ago

Thanks, guys!

sckott commented 9 years ago

sorry for the delay all.

Testing locally, and the /occurrence route works fine for me. But doesn't work on the server. Blame suggests nothing changed recently for that bit of code https://github.com/ropensci/fishbaseapi/blame/master/api.rb

Carl, perhaps the new fishbase DB has occurrence table named differently. I have the old database locally on my machine, and it works here.

sckott commented 9 years ago

@cboettig ps can you send me the new DB when you get a chance

sckott commented 9 years ago

okay, i can't seem to get the new DB installed locally, but grepping to get CREATE TABLE lines in the sql dump file shows that occurrence table is completely missing.

cboettig commented 9 years ago

@jebyrnes It appears this table was not included in our more recent dump from the FishBase team. We can try and follow up with them and maybe meanwhile look into getting the old version of said table imported into the new database.

cboettig commented 9 years ago

meanwhile there are a few other endpoints with location/distribution information that may or may not be helpful.

I'm gonna look into what table joins we can compute server-side so that information isn't so scattered across so many different tables. Any advice on what would be most useful in this regard would be appreciated!

sckott commented 8 years ago

@jebyrnes is this the kind of data you are looking for? I don't know what data used to be in the occurrence route, so curious if this is what you need? There is a museum route, which seems to be what data is pulled from when you are on the Fishbase.org website when you click Occurrence

options(FISHBASE_API = "http://localhost:8888")
museum <- endpoint("museum")
museum("Oreochromis niloticus", limit = 1) %>% data.frame %>% t
#> [,1]
#> OccurrenceRefNo        "4517"
#> Museum                 "Museum National d'Histoire Naturelle"
#> Acronym                "MNHN"
#> Address                "57, rue Cuvier, 75231 Paris Cedex 05, France"
#> City                   "Paris, France"
#> C_code                 "250"
#> LogoURL                NA
#> Online                 "-1"
#> Remarks                NA
#> HomePageURL            "#http://www.mnhn.fr/#"
#> OnlineDatabase         "#http://www.mnhn.fr/collections/gicim#"
#> CatalogueNumPrefix1    "MNHN"
#> CatalogueNumberPrefix2 NA
#> CatalogueNumberPrefix3 NA
#> ContactPerson1         "Patrice Pruvost"
#> ContactPerson1Email    "pruvost@mnhn.fr"
#> ContactPerson2         "Fr"
#> ContactPerson2Email    "busson@mnhn.fr"
#> FirstVersionDate       NA
#> VersionDate            "2003-07-30T00:00:00.000Z"
#> Validity               NA
#> LastUpdateDate         NA
#> DatabaseFormat         NA
#> Accessions             "126371"
#> Species                "10736"
#> Families               "479"
#> Countries              "194"
#> TopCountry             "New Caledonia"
#> TopCountryRecords      "5425"
#> Coordinates            "47103"
#> PercentCoordinates     "37"
#> DateOldestRecord       "04/12/97"
#> DateMostRecentRecord   "05/03/1891"
#> YearOldestRecord       "82"
#> YearMostRecentRecord   "2003"
#> Entered                "65"
#> DateEntered            "2002-01-28T00:00:00.000Z"
#> Modified               "303"
#> DateModified           "2006-02-15T00:00:00.000Z"
#> validnames             "81391"
#> PercentValid           "75.485"
#> synonyms               "13395"
#> PercentSynonym         "12.423"
#> non.matching           NA
#> PercentNon.matching    NA
#> AmbiguousName          NA
#> PercentAmbiguous       NA
#> TS                     NA

just getting 1 row for brevity, and to easily show what data is given back

this isn't on the public API yet

jebyrnes commented 8 years ago

I think so? This was long enough ago that I've moved on.

sckott commented 8 years ago

thanks :) sorry about the long time :clock1:

sckott commented 8 years ago

related to #100 - closing, occurrence table and route gone, and now function stops with error