OpenTreeOfLife / feedback

No code -- just an issue tracker for general feedback (sent here via GitHub's issues API)
1 stars 0 forks source link

`context_name` in documentation for tnrs/match_names should be `context`? #50

Closed dwinter closed 10 years ago

dwinter commented 10 years ago

The API documentation lists context_name as one of the paramaters to pass on to tnrs/match_names, but trying to send a request with this paramater always returns a BadInputException

curl -X POST http://devapi.opentreeoflife.org/v2/tnrs/match_names -H "content-type:application/json" -d '{"names":["Aster","Symphyotrichum","Erigeron","Barnadesia"], "context_name": ["Plants"]}'
{
  "message" : "Could not convert!",
  "exception" : "BadInputException",
  "fullname" : "org.neo4j.server.rest.repr.BadInputException",
  "stacktrace" : [ "org.neo4j.server.rest.repr.RepresentationFormat.convertString(RepresentationFormat.java:330)", "org.neo4j.server.rest.repr.RepresentationFormat$1.convertString(RepresentationFormat.java:164)", "org.neo4j.server.plugins.ParameterList.getString(ParameterList.java:86)", "org.neo4j.server.plugins.StringTypeCaster.get(StringTypeCaster.java:30)", "org.neo4j.server.plugins.ParameterExtractor.extract(ParameterExtractor.java:45)", "org.neo4j.server.plugins.PluginMethod.invoke(PluginMethod.java:53)", "org.neo4j.server.plugins.PluginManager.invoke(PluginManager.java:168)", "org.neo4j.server.rest.web.ExtensionService.invokeGraphDatabaseExtension(ExtensionService.java:300)", "org.neo4j.server.rest.web.ExtensionService.invokeGraphDatabaseExtension(ExtensionService.java:122)", "java.lang.reflect.Method.invoke(Method.java:606)", "org.neo4j.server.rest.security.SecurityFilter.doFilter(SecurityFilter.java:112)" ]

I guess the parmater name is actually context?

curl -X POST http://devapi.opentreeoflife.org/v2/tnrs/match_names -H "content-type:application/json" -d '{"names":["Aster","Symphyotrichum","Erigeron","Barnadesia"], "context": ["Plants"]}'
{
  "governing_code" : "ICN",
  "unambiguous_name_ids" : [ "Barnadesia", "Erigeron", "Aster", "Symphyotrichum" ],
  "unmatched_name_ids" : [ ],
  "matched_name_ids" : [ "Barnadesia", "Erigeron", "Aster", "Symphyotrichum" ],
  "context" : "Asteraceae",
  "includes_deprecated_taxa" : false,
  "includes_dubious_names" : false,
  "includes_approximate_matches" : true,
  "taxonomy" : {
    "author" : "open tree of life project",
    "weburl" : "https://github.com/OpenTreeOfLife/opentree/wiki/Open-Tree-Taxonomy",
    "source" : "ott2.8"
  },
  "results" : [ {
    "id" : "Barnadesia",
    "matches" : [ {
      "is_deprecated" : false,
      "is_synonym" : false,
      "flags" : [ ],
      "search_string" : "barnadesia",
      "score" : 1.0,
      "synonyms" : [ "Barnadesia Mutis", "Barnadesia" ],
      "is_approximate_match" : false,
      "ot:ottId" : 515698,
      "matched_node_id" : 3947526,
      "rank" : "",
      "matched_name" : "Barnadesia",
      "unique_name" : "Barnadesia",
      "is_dubious" : false,
      "nomenclature_code" : "ICN",
      "ot:ottTaxonName" : "Barnadesia"
    } ]
  }, {
    "id" : "Aster",
    "matches" : [ {
      "is_deprecated" : false,
      "is_synonym" : false,
      "flags" : [ "EDITED" ],
      "search_string" : "aster",
      "score" : 1.0,
      "synonyms" : [ "Kitamuraea", "Bellidiastrum", "Baccharidiopsis", "Miyamayomena", "Aster", "Heterochaeta", "Crinitaria", "Lasallea", "Conyzanthus", "Linosyris", "Aster L.", "Wardaster", "Borkonstia", "Kitamuraster", "Virgulaster", "Chlamydites", "Weberaster", "Galatella", "Baccharidopsis", "Oreastrum" ],
      "is_approximate_match" : false,
      "ot:ottId" : 409712,
      "matched_node_id" : 3976434,
      "rank" : "",
      "matched_name" : "Aster",
      "unique_name" : "Aster (genus in Australasian lineages)",
      "is_dubious" : false,
      "nomenclature_code" : "ICN",
      "ot:ottTaxonName" : "Aster"
    } ]
  }, {
    "id" : "Erigeron",
    "matches" : [ {
      "is_deprecated" : false,
      "is_synonym" : false,
      "flags" : [ "EDITED" ],
      "search_string" : "erigeron",
      "score" : 1.0,
      "synonyms" : [ "Darwiniothamnus", "Stenactis", "Erigeron", "Trimorpha", "fleabanes", "Achaetogeron" ],
      "is_approximate_match" : false,
      "ot:ottId" : 643717,
      "matched_node_id" : 3977809,
      "rank" : "",
      "matched_name" : "Erigeron",
      "unique_name" : "Erigeron",
      "is_dubious" : false,
      "nomenclature_code" : "ICN",
      "ot:ottTaxonName" : "Erigeron"
    } ]
  }, {
    "id" : "Symphyotrichum",
    "matches" : [ {
      "is_deprecated" : false,
      "is_synonym" : false,
      "flags" : [ "EDITED" ],
      "search_string" : "symphyotrichum",
      "score" : 1.0,
      "synonyms" : [ "Virgulus", "Symphyotrichum" ],
      "is_approximate_match" : false,
      "ot:ottId" : 1058735,
      "matched_node_id" : 3980020,
      "rank" : "",
      "matched_name" : "Symphyotrichum",
      "unique_name" : "Symphyotrichum",
      "is_dubious" : false,
      "nomenclature_code" : "ICN",
      "ot:ottTaxonName" : "Symphyotrichum"
    } ]
  } ]
}
dwinter commented 10 years ago

@mjy @jhill1 @jeetsukumaran @karolisr Might want to check that your wrapper functions for tnrs_match_names work when a context is set , and once we have the the correct name confirmed include a test for this

dwinter commented 10 years ago

... or maybe I'm an idiot,

our R function for this was breaking as we were sending a list of strings not a single string (closing the issue now)

josephwb commented 10 years ago

It looks like you figured this out @dwinter? The argument is definitely context_name, but you sent it in a list instead of a single string. Also, the context "Plants" was not valid; I think you want "Land Plants":

curl -X POST http://devapi.opentreeoflife.org/v2/tnrs/match_names -H "content-type:applicaton/json" -d '{"names":["Aster","Symphyotrichum","Erigeron","Barnadesia"], "context_name":"Land Plants"}'
{
  "governing_code" : "ICN",
  "unambiguous_name_ids" : [ "Barnadesia", "Erigeron", "Aster", "Symphyotrichum" ],
  "unmatched_name_ids" : [ ],
  "matched_name_ids" : [ "Barnadesia", "Erigeron", "Aster", "Symphyotrichum" ],
  "context" : "Land plants",
  "includes_deprecated_taxa" : false,
  "includes_dubious_names" : false,
  "includes_approximate_matches" : true,
  "taxonomy" : {
    "author" : "open tree of life project",
    "weburl" : "https://github.com/OpenTreeOfLife/opentree/wiki/Open-Tree-Taxonomy",
    "source" : "ott2.8"
  },
  "results" : [ {
    "id" : "Barnadesia",
    "matches" : [ {
      "is_deprecated" : false,
      "is_synonym" : false,
      "flags" : [ ],
      "search_string" : "barnadesia",
      "score" : 1.0,
      "synonyms" : [ "Barnadesia Mutis", "Barnadesia" ],
      "is_approximate_match" : false,
      "ot:ottId" : 515698,
      "matched_node_id" : 3947526,
      "rank" : "",
      "matched_name" : "Barnadesia",
      "unique_name" : "Barnadesia",
      "is_dubious" : false,
      "nomenclature_code" : "ICN",
      "ot:ottTaxonName" : "Barnadesia"
    } ]
  }, {
    "id" : "Aster",
    "matches" : [ {
      "is_deprecated" : false,
      "is_synonym" : false,
      "flags" : [ "EDITED" ],
      "search_string" : "aster",
      "score" : 1.0,
      "synonyms" : [ "Kitamuraea", "Bellidiastrum", "Baccharidiopsis", "Miyamayomena", "Aster", "Heterochaeta", "Crinitaria", "Lasallea", "Conyzanthus", "Linosyris", "Aster L.", "Wardaster", "Borkonstia", "Kitamuraster", "Virgulaster", "Chlamydites", "Weberaster", "Galatella", "Baccharidopsis", "Oreastrum" ],
      "is_approximate_match" : false,
      "ot:ottId" : 409712,
      "matched_node_id" : 3976434,
      "rank" : "",
      "matched_name" : "Aster",
      "unique_name" : "Aster (genus in Australasian lineages)",
      "is_dubious" : false,
      "nomenclature_code" : "ICN",
      "ot:ottTaxonName" : "Aster"
    } ]
  }, {
    "id" : "Erigeron",
    "matches" : [ {
      "is_deprecated" : false,
      "is_synonym" : false,
      "flags" : [ "EDITED" ],
      "search_string" : "erigeron",
      "score" : 1.0,
      "synonyms" : [ "Darwiniothamnus", "Stenactis", "Erigeron", "Trimorpha", "fleabanes", "Achaetogeron" ],
      "is_approximate_match" : false,
      "ot:ottId" : 643717,
      "matched_node_id" : 3977809,
      "rank" : "",
      "matched_name" : "Erigeron",
      "unique_name" : "Erigeron",
      "is_dubious" : false,
      "nomenclature_code" : "ICN",
      "ot:ottTaxonName" : "Erigeron"
    } ]
  }, {
    "id" : "Symphyotrichum",
    "matches" : [ {
      "is_deprecated" : false,
      "is_synonym" : false,
      "flags" : [ "EDITED" ],
      "search_string" : "symphyotrichum",
      "score" : 1.0,
      "synonyms" : [ "Virgulus", "Symphyotrichum" ],
      "is_approximate_match" : false,
      "ot:ottId" : 1058735,
      "matched_node_id" : 3980020,
      "rank" : "",
      "matched_name" : "Symphyotrichum",
      "unique_name" : "Symphyotrichum",
      "is_dubious" : false,
      "nomenclature_code" : "ICN",
      "ot:ottTaxonName" : "Symphyotrichum"
    } ]
  } ]
}
dwinter commented 10 years ago

Yeah, thanks @josephwb - spend ~30 mins checking and re-checkng before filing the issue, work it out 30 secs later :confounded: