TranslatorSRI / NodeNormalization

Service that produces Translator compliant nodes given a curie
MIT License
9 stars 6 forks source link

Add an asynchronous normalize TRAPI endpoint #147

Open cbizon opened 1 year ago

cbizon commented 1 year ago

Right now the TRAPI endpoint is only sync, but it needs an async version so that wf runner can use it.

Also, let's change the name from /response which is a bad name...

cbizon commented 1 year ago

I think to be TRAPI compliant we want the endpoints to be /query and /asyncquery

jdr0887 commented 1 year ago

Reading the code, most of the functions are 'async' with 'await' calls in the body, eg: https://github.com/TranslatorSRI/NodeNormalization/blob/2f08a2d88d23dad5f54f3f763bda5c0dbaf51dff/node_normalizer/server.py#L80

In trying to read between the lines...you are asking me to:

Is this accurate?

cbizon commented 1 year ago

/asyncquery should take a trapi message and immediately return a 200. Part of the input payload to /asyncquery should be a callback_url. When the job is complete, the response should be posted to the callback_url.

gaurav commented 1 year ago

Here's the documentation for AsyncQuery: https://github.com/NCATSTranslator/ReasonerAPI/blob/91338a117354385d58ce0b904fb70a095fc501dd/docs/reference.md#asyncquery-

gaurav commented 1 year ago

I think this has been implemented, but the testing code for this is probably in https://github.com/TranslatorSRI/NodeNormalization/pull/157, which needs a lot of work before we can merge it. Let's leave it open until it's fully fixed.