Closed chinchliff closed 10 years ago
I really don't like the current about.json format, and have been planning on changing it. Consider this file to be volatile, a work in progress. When it's ready to be used I'll document it.
On Wed, Apr 16, 2014 at 10:52 AM, Cody Hinchliff notifications@github.comwrote:
On taxonomy import, taxomachine should read and store the contents of the about.json file from smasher. This should be available (presumably in the same format as the original about.json file) from a service.
— Reply to this email directly or view it on GitHubhttps://github.com/OpenTreeOfLife/taxomachine/issues/33 .
Alright. I won't attempt to import it yet then.
Will need to do this in order to meet the requirements for public release (see issue #37). Just going to be minimal for now. @jar398 do you want to try and make some progress on the format first or should I use it as-is?
Taxonomy metadata is returned in TNRS results from contextQueryForNames. The autocompleteQuery returns a JSON array containing matches, so I have not added metadata to these results yet because we should add a container and separate the metadata from the match list. This will require some coordination with @jimallman to avoid breaking the webapp.
Currently only minimal metadata comes through. I took a look at the about.json file and I agree with @jar398 that the format could be improved. There appears to be some interesting recursive duplication going on that seems confusing. So, for now, enjoy very minimal metadata in some TNRS searches. I'm going to close this issue, we can return to the unfinished bits later with more targeted issues.
Features are stable in commit 1b125e0cec909f673072cc96d2d0bd02bb552b83
Example query:
curl -X POST http://localhost:7474/db/data/ext/TNRS/graphdb/contextQueryForNames -H "content-type:application/json" -d '{"queryString":"Trillium decipiens"}'
Results (the taxonomy
object is new):
{
"governing_code" : "undefined",
"unambiguous_name_ids" : [ "Trillium decipiens" ],
"unmatched_name_ids" : [ ],
"matched_name_ids" : [ "Trillium decipiens" ],
"context" : "All life",
"includes_deprecated_ids" : false,
"includes_dubious_names" : false,
"taxonomy" : {
"author" : "open tree of life project",
"weburl" : "https://github.com/OpenTreeOfLife/opentree/wiki/Open-Tree-Taxonomy",
"source" : "ott2.6"
},
"results" : [ {
"id" : "Trillium decipiens",
"matches" : [ {
"is_deprecated" : false,
"dubious_name" : false,
"is_synonym" : false,
"flags" : [ ],
"is_perfect_match" : true,
"search_string" : "trillium decipiens",
"score" : 1.0,
"is_approximate_match" : false,
"is_homonym" : false,
"matched_ott_id" : 886351,
"matched_node_id" : 2593050,
"rank" : "",
"matched_name" : "Trillium decipiens",
"unique_name" : "Trillium decipiens",
"nomenclature_code" : null,
"synonym_or_homonym_status" : "known"
} ]
} ]
}```
Hmm, I see that I was thinking of a different issue when I wrote the last comment... Adding the metadata service now...
Ok, this service has been added as of commit 7fe02bd5603f158dc0375b791831f18bebe8e4c1. As stated above, taxonomy metadata is minimal right now, pending an update to the about.json file that ships with OTT.
Example curl call:
curl -X POST http://localhost:7474/db/data/ext/OTTServices/graphdb/getTaxonomyInfo
Result:
{
"author" : "open tree of life project",
"weburl" : "https://github.com/OpenTreeOfLife/opentree/wiki/Open-Tree-Taxonomy",
"source" : "ott2.6"
}
On taxonomy import, taxomachine should read and store the contents of the about.json file from smasher. This should be available (presumably in the same format as the original about.json file) from a service.