Api v2 #26
Changes from all commits
b553281
08c3556
a9d0aa2
17df166
b5add19
44c4004
c4bf7a3
3cdf68f
074e8df
cf6f374
4e9b624
d074445
0c5ce4c
745b777
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
Currently, there are no automated test procedures for OTI. You can however, fairly thoroughly test the performance manually. Run the following command to index the current phylesystem repo on devapi.opentreeoflife.org: | ||
|
||
```bash | ||
./index_current_repo.py http://devapi.opentreeoflife.org/oti http://devapi.opentreeoflife.org/api | ||
``` | ||
|
||
And then (assuming indexing worked), query the database to test it. Here are some example queries using cURL, and their expected results. | ||
|
||
### Return a list of all studies: | ||
|
||
```bash | ||
curl -X POST http://devapi.opentreeoflife.org/oti/ext/studies/graphdb/find_studies | ||
``` | ||
|
||
```json | ||
{ | ||
"matched_studies" : [ { | ||
"ot:studyId" : "1354" | ||
}, { | ||
"ot:studyId" : "2189" | ||
}, # snipped | ||
{ | ||
"ot:studyId" : "2326" | ||
}, { | ||
"ot:studyId" : "1827" | ||
} ] | ||
} | ||
``` | ||
|
||
### Search for studies with trees spanning the taxon with name "Annona glabra": | ||
|
||
```bash | ||
curl -X POST http://devapi.opentreeoflife.org/oti/ext/studies/graphdb/find_trees -H "content-type: application/json" -d '{"property":"ot:ottTaxonName","value":"Annona glabra"}' | ||
``` | ||
|
||
```json | ||
{ | ||
"matched_studies" : [ { | ||
"matched_trees" : [ { | ||
"nexson_id" : "tree3008", | ||
"oti_tree_id" : "1495_tree3008" | ||
}, { | ||
"nexson_id" : "tree3009", | ||
"oti_tree_id" : "1495_tree3009" | ||
}, { | ||
"nexson_id" : "tree3010", | ||
"oti_tree_id" : "1495_tree3010" | ||
} ], | ||
"ot:studyId" : "1495" | ||
} ] | ||
} | ||
``` | ||
|
||
### Get a list of properties available for searching studies and trees: | ||
|
||
```bash | ||
curl -X POST http://devapi.opentreeoflife.org/oti/ext/studies/graphdb/properties | ||
``` | ||
|
||
```json | ||
{ | ||
"tree_properties" : [ "ot:studyPublicationReference", "is_deprecated", "ot:focalCladeOTTTaxonName", "ot:studyLastEditor", "ot:studyModified", "ot:studyLabel", "ot:comment", "ot:studyId", "ot:dataDeposit", "ot:authorContributed", "ot:studyUploaded", "ot:studyYear", "ot:focalCladeTaxonName", "ot:tag", "ot:curatorName", "ot:studyPublication", "ot:focalCladeOTTId", "ot:focalClade" ], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is "is_deprecated" really a property? does it need an ot: namespace? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know. It can certainly be changed in oti if we feel that it would On Wed, Sep 10, 2014 at 4:33 PM, Mark T. Holder notifications@github.com
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
FWIW, the current curation app completely ignores the It's briefly mentioned in this oti issue and it definitely sounds like legacy cruft. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On 9/10/14 5:01 PM, Jim Allman wrote:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok. I have made issue #27 to remove this property. Currently, I don't think it matters much if it's there, and the goal of this pull request is to get the new api services up and working this week. So it seems like now that we know what to do, we can deal with this later? |
||
"study_properties" : [ "ot:studyPublicationReference", "is_deprecated", "ot:focalCladeOTTTaxonName", "ot:studyLastEditor", "ot:studyModified", "ot:studyLabel", "ot:comment", "ot:studyId", "ot:dataDeposit", "ot:authorContributed", "ot:studyUploaded", "ot:studyYear", "ot:focalCladeTaxonName", "ot:tag", "ot:curatorName", "ot:studyPublication", "ot:focalCladeOTTId", "ot:focalClade" ] | ||
} | ||
``` |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chinchliff: Oddly, I'm getting an error on exactly one study, pg_719 (all the others are indexed properly):
Any chance this is confused by the presence of another "719" study? But I don't see a ot_719... at least not in the GitHub repo (will check the API server's "local" repo next).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh. I expect it's because of the way the indexing was performed initially.
pg_719 is the first study to be indexed and it probably got screwed up
somehow. It would be nice not to have to re-build the entire db. We just
need to remove the study and then I expect indexing will proceed as
planned. I will think about this...
On Wed, Sep 10, 2014 at 10:33 PM, Jim Allman notifications@github.com
wrote:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case it helps, the error message seems to be coming from ot-base.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the easiest way is just to write a custom method to remove this
study and then run it. If I don't remember to do this, please remind me...
On Wed, Sep 10, 2014 at 10:49 PM, Jim Allman notifications@github.com
wrote:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. Meanwhile, there are two copies of the "Tippery N., 2011" study in oti. You can see them in the main study-list page by searching for its DOI: "10.1600/036364411X605092"