OpenTreeOfLife / taxomachine

taxonomy graphdb
Other
7 stars 4 forks source link

service for checking deprecated ids #36

Closed chinchliff closed 10 years ago

chinchliff commented 10 years ago

Need to import the deprecated ids from Jonathan and have a service to query them.

chinchliff commented 10 years ago

This is done and should be stable as of commit ccde8f199d583bd440a0aa47fe85940028ac3668.

There are three ways to access deprecated ids.

1 The contextQueryForNames service now has an option to include deprecated ids in the results.

Example:

curl -X POST http://localhost:7474/db/data/ext/TNRS/graphdb/contextQueryForNames -H "content-type:application/json" -d '{"queryString":"Metopidae","includeDubious":true,includeDeprecated":true}'

Results:

{
  "governing_code" : "undefined",
  "unambiguous_name_ids" : [ "Metopidae" ],
  "unmatched_name_ids" : [ ],
  "matched_name_ids" : [ "Metopidae" ],
  "context" : "All life",
  "includes_deprecated_ids" : true,
  "includes_dubious_names" : true,
  "taxonomy" : {
    "author" : "open tree of life project",
    "weburl" : "https://github.com/OpenTreeOfLife/opentree/wiki/Open-Tree-Taxonomy",
    "source" : "ott2.6"
  },
  "results" : [ {
    "id" : "Metopidae",
    "matches" : [ {
      "is_deprecated" : false,
      "dubious_name" : false,
      "is_synonym" : false,
      "flags" : [ "SIBLING_LOWER", "TATTERED" ],
      "is_perfect_match" : false,
      "search_string" : "metopidae",
      "score" : 1.0,
      "is_approximate_match" : false,
      "is_homonym" : true,
      "matched_ott_id" : 5342013,
      "matched_node_id" : 2754493,
      "rank" : "",
      "matched_name" : "Metopidae",
      "unique_name" : "Metopidae (family in order Armophorida)",
      "nomenclature_code" : "ICN",
      "synonym_or_homonym_status" : "known"
    }, {
      "is_deprecated" : false,
      "dubious_name" : true,
      "is_synonym" : false,
      "flags" : [ "HIDDEN", "SIBLING_LOWER", "TATTERED", "TATTERED_INHERITED" ],
      "is_perfect_match" : false,
      "search_string" : "metopidae",
      "score" : 1.0,
      "is_approximate_match" : false,
      "is_homonym" : true,
      "matched_ott_id" : 5342015,
      "matched_node_id" : 2755117,
      "rank" : "",
      "matched_name" : "Metopidae",
      "unique_name" : "Metopidae (family in order Heterotrichida)",
      "nomenclature_code" : "ICN",
      "synonym_or_homonym_status" : "known"
    }, {
      "is_deprecated" : true,
      "matched_node_id" : 3135045,
      "flags" : [ "DEPRECATED" ],
      "matched_name" : "Metopidae",
      "is_perfect_match" : true,
      "score" : 1.0,
      "search_string" : "metopidae",
      "is_approximate_match" : false,
      "matched_ott_id" : 5342016
    } ]
  } ]
}

2 The getTaxonInfo service will find and return deprecated taxa:

Example:

curl -X POST http://localhost:7474/db/data/ext/OTTServices/graphdb/getTaxonInfo -H "content-type:application/json" -d '{"ottId":5342016}'

Results:

{
  "ot:ottId" : 5342016,
  "flags" : [ "DEPRECATED" ],
  "source_info" : "irmng:113432",
  "ot:ottTaxonName" : "Metopidae",
  "reason" : "unresolved/blocked",
  "node_id" : 3135045
}

3 There is a new service that will return information about all the deprecated taxa in the database.

Example:

curl -X POST http://localhost:7474/db/data/ext/OTTServices/graphdb/getDeprecatedTaxa

Result:

[ {
  "ot:ottId" : 5286014,
  "source_info" : "if:293729",
  "ot:ottTaxonName" : "Bogoriellomyces subpersicinae",
  "reason" : "different-division"
},
...
{
  "ot:ottId" : 5298479,
  "source_info" : "if:413285,gbif:5448851",
  "ot:ottTaxonName" : "Lacrymaria atricha",
  "reason" : "different-division"
} ]