OpenTreeOfLife / taxomachine

taxonomy graphdb
Other
7 stars 4 forks source link

match names context #69

Closed kayce closed 9 years ago

kayce commented 10 years ago

I tried to get OT Ids for a list of mammals using context Mammals. It returned several Ids for non-mammals and the list is the same if I do not use the context.

this is the body of the POST: {"context":"Mammals", "names":["sorex montereyensis”]}

this is the return:

{

"governing_code":"undefined", "unambiguous_name_ids":[

], "unmatched_name_ids":[

], "matched_name_ids":[

"sorex montereyensis"

], "context":"All life", "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":"sorex montereyensis", "matches":[

{

"is_deprecated":false, "is_synonym":false, "flags":[

], "search_string":"sorex montereyensis", "score":0.8421052631578947, "synonyms":[

"Doris montereyensis"

], "is_approximate_match":true, "ot:ottId":2875719, "matched_node_id":3165875, "rank":"", "matched_name":"Doris montereyensis", "unique_name":"Doris montereyensis", "is_dubious":false, "nomenclature_code":"ICZN", "ot:ottTaxonName":"Doris montereyensis"

}, {

"is_deprecated":false, "is_synonym":false, "flags":[

], "search_string":"sorex montereyensis", "score":0.7777777777777778, "synonyms":[

"Sige montereyensis"

], "is_approximate_match":true, "ot:ottId":4983528, "matched_node_id":3246966, "rank":"", "matched_name":"Sige montereyensis", "unique_name":"Sige montereyensis", "is_dubious":false, "nomenclature_code":"ICZN", "ot:ottTaxonName":"Sige montereyensis"

}, {

"is_deprecated":false, "is_synonym":false, "flags":[

], "search_string":"sorex montereyensis", "score":0.7368421052631579, "synonyms":[

"Seila montereyensis"

], "is_approximate_match":true, "ot:ottId":2897877, "matched_node_id":3125969, "rank":"", "matched_name":"Seila montereyensis", "unique_name":"Seila montereyensis", "is_dubious":false, "nomenclature_code":"ICZN", "ot:ottTaxonName":"Seila montereyensis"

}, {

"is_deprecated":false, "is_synonym":false, "flags":[

], "search_string":"sorex montereyensis", "score":0.7368421052631579, "synonyms":[

"Styela rubra", "Clavellinopsis rubra", "Styela montereyensis", "Tethyum montereyensis", "Tethyum montereyense", "Cynthia montereyensis"

], "is_approximate_match":true, "ot:ottId":191339, "matched_node_id":3610477, "rank":"", "matched_name":"Styela montereyensis", "unique_name":"Styela montereyensis", "is_dubious":false, "nomenclature_code":"ICZN", "ot:ottTaxonName":"Styela montereyensis"

}, {

"is_deprecated":false, "is_synonym":true, "flags":[

], "search_string":"sorex montereyensis", "score":0.8947368421052632, "synonyms":[

"Carex montereyensis", "Carex harfordii"

], "is_approximate_match":true, "ot:ottId":136818, "matched_node_id":4402252, "rank":"", "matched_name":"Carex montereyensis", "unique_name":"Carex harfordii", "is_dubious":false, "nomenclature_code":"ICN", "ot:ottTaxonName":"Carex harfordii"

}, {

"is_deprecated":false, "is_synonym":true, "flags":[

], "search_string":"sorex montereyensis", "score":0.7894736842105263, "synonyms":[

"Idotea montereyensis", "Pentidotea montereyensis"

], "is_approximate_match":true, "ot:ottId":993778, "matched_node_id":1321908, "rank":"", "matched_name":"Idotea montereyensis", "unique_name":"Pentidotea montereyensis", "is_dubious":false, "nomenclature_code":"ICZN", "ot:ottTaxonName":"Pentidotea montereyensis"

}

]

}

] }

chinchliff commented 9 years ago

You need to use the argument "context_name" to indicate the context. It looks like you're just specifying "context", but this is getting ignored because it is not a recognized argument. Try this:

curl -X POST http://devapi.opentreeoflife.org/v2/tnrs/match_names -d '{"context_name":"Mammals", "names":["sorex montereyensis"]}' -H "content-type:application/json"

Should result in:

{
  "governing_code" : "ICZN",
  "unambiguous_name_ids" : [ ],
  "unmatched_name_ids" : [ "sorex montereyensis" ],
  "matched_name_ids" : [ ],
  "context" : "Mammals",
  "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" : [ ]
}