-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
New endpoint connection between Capella and Noctua #147
Comments
Hans-Michael's github id is goldturtle :-) |
Cheers! I've added you to the geneontology/noctua-community group. We'll see how this workflow goes and maybe change it later. |
@vanaukenk will provide some feedback here as well. |
A sample post, in URI format and as a JSON blob are as follows. This is only a model, parameters will change. Using URI: Using JSON, blob is like this: { |
Terrific--we'll use this as a jumping-off point and refresh the API with an eye towards it. To clarify, the URL you have there is the GET (parameters in the URL) version of the POST (parameters in header, and possibly in URL as well) that you'd do? I just want to make sure I know a large enough set of the parameters involved. |
Yes, I POST this, but all of the parameter are in the URL |
Understood--thanks! |
To make this more abstract for any incoming datasource to make use of, I've simplified the JSON a bit: {
"model_id": "gomodel:01234567", // optional, create new model if not extant
"barista_token": "sdlkjslkjd", // required
"database_id" : "WB:WBGene00005794", // required
"evidence_id" : "ECO:0000314", // required
"class_id" : "GO:0050689", // required
"reference_id" : "PMID:666333", // required
"external_id" : "XX:YYYYYYY", // optional
"comments" : ["foo", "bar"] // optional, default empty
} If okayed by @goldturtle , this will be the provisional format accepted by /tractorbeam. |
Using httpie, access commands could look like: http --form localhost:8910/tractorbeam barista_token=123 database_id=WB:WBGene00005794 evidence_id=ECO:0000314 class_id=GO:0050689 reference_id=PMID:666333 external_id=XX:YYYYYYY model_id=gomodel:56b285cf00000012 Add to model: http --form localhost:8910/tractorbeam barista_token=123 database_id=WB:WBGene00005794 evidence_id=ECO:0000314 class_id=GO:0050689 reference_id=PMID:666333 external_id=XX:YYYYYYY |
Now in production. |
To clarify #147 (comment) , while I'm using a JSON blob to define the variables, the actual arguments are not in a JSON blob, the actual arguments are just application/x-www-form-urlencoded form fields, as demonstrated by the examples using httpie above. |
Hi there, Thanks, Server: http://noctua.berkeleybop.org/tractorbeam?barista_token=123&database_id=WB:WBGene00005794&comments=meh&model_id=gomodel:01234567&evidence_id=ECO:0000314&class_id=GO:0050689&reference_id=PMID:666333&external_id=TPDBID:0000181 |
This is currently correct: the endpoint only accepts POST right now: |
From #147 (comment) it's an application/x-www-form-urlencoded body. |
This command still works for me:
|
The localhost URI doesn't do me any good. I am posting. If I cut and paste the URL provided above into a browser which performs a GET, I am correctly pointed out to my mistake |
Corrected to point to the production server as an example (not recommended for typical development though):
One cannot cut and paste into a regular browser a POST--most browsers will default to a GET. |
I was aware of it, I just posted the browser example to test that GET indeed doesn't work. What puzzles me that even though my POST is x-www-form-urlencoded, your application still expects some POSTDATA, as indicated by the original response:
if I post x-www-form-urlencoded, I leave the message body empty, thus this response. So it seems your app is analyzing and expecting POSTDATA when I send something x-www-form-urlencoded. httpie seems to repeat all parameters in the body, because if I add to the body, all parameter by hand:
I get the correct I think it would be good if your application doesn't analyze the message body when posting x-www-form-urlencoded, or at least doesn't break. |
Actually, I'd like to modify that; let's do whatever the common convention on this is. (One would need to look that up on the web). I know EBI is analyzing the URL only, but not the message body. |
@goldturtle I'm not sure I follow you here, or the alternative being propsed. |
Whoops, sorry, crossed there. |
OK, there must be a convention for that, as I said. Let's follow that convention, because Textpresso will have other clients, as you do. |
...and with clients I mean customers, not http client ;-) |
Okay, let's see where we are and maybe future-proof this a bit. We currently have (ignoring the JSON formatting) the following arguments: |
For user scenarios, we should also consult with our model-curator, On 02/23/2016 04:34 PM, kltm wrote:
|
@vanaukenk The more I think about it, the more I'm tempted to formalize the spec that we're going to use with batching possible. Is this a possible use case? The implication would be that you could spend more time within Textpresso, collecting annotations, and then dump them into Noctua in a single go. |
Hi @KTLM and @goldturtle |
@VanAuken Thank you, I think that helps. I think to give us the maximal flexibility moving forward, it's probably best to bake in this scenario from the beginning. I'll implement this into Noctua and ping back here (with examples) once this is live for testing. |
Now looking at modelling like: {
"barista-token": "sdlkjslkjd",
"model-id": "gomodel:01234567",
"requests": [
{
"database-id" : "UniProtKB:A0A005",
"evidence-id" : "ECO:0000314",
"class-id" : "GO:0050689",
"reference-id" : "PMID:666333",
"textspresso-id" : "XXX:YYYYYYY",
"comments" : ["foo", "bar"]
}
]
} The "model-id" is optional depending on whether you're generating a new model or editing a current one. |
Example command, using Content-Type: application/json : http --json localhost:8910/tractorbeam barista-token=123 requests:='[{"database-id":"WB:WBGene00005794", "evidence-id":"ECO:0000314", "class-id":"GO:0050689", "reference-id":"PMID:666333", "external-id":"FOO:0123456"}]' So we would no longer be using application/x-www-form-urlencoded. |
…es; switch content-type to application/json; swtich arguments to use - instead of _; work on #147
Pushed to production. |
Cool. I had coded for both options, but didn't post that fact on github. It's M. On 02/26/2016 06:54 PM, kltm wrote:
|
This is essentially a continuation of #51.
From the call today, Hans-Michael (replace with github ID) will provide an example payload, as used for kicking to protein2go. Using this, noctua will:
Future iterations could also involve the user being able to login ahead of time (capella keeps the token) and/or doing the seeding remotely from capella with the API.
It is expected to go fairly easily as #51 established most of the code and paths.
The text was updated successfully, but these errors were encountered: