cannin / ihop-reach

A web application to access biological data extracted from biomedical literature.
https://reach.nrnb-docker.ucsd.edu
GNU Lesser General Public License v3.0
4 stars 4 forks source link

Provide An Endpoint to Allow Identifier Queries #7

Closed cannin closed 5 years ago

cannin commented 5 years ago

Users should be able to query for identifiers, like: "uniprot:P55851"

The example query below returns articles for participant_a matches but the query should search participant_a OR participant_b

curl -i 'http://API_URL/api/v1/articles?where={"extracted_information.participant_a.identifier": "uniprot:P55851"}' 

How can this be done? Is it possible to simplify the query?

RohitChattopadhyay commented 5 years ago

I am unable to find a solution for the following problems

  1. Flask restricting lookup to sub-document field ( ref https://github.com/pyeve/eve/issues/886 )
  2. Display all matches with additional_lookup

As a way around, I suggest that we redirect a request like api/v1/identifiers/uniprot:P55851 to api/v1/articles?where={"$or":[{"extracted_information.participant_a.identifier":"uniprot:P55851"},{"extracted_information.participant_b.identifier":"uniprot:P55851"}]} This is a valid solution but involves a redirection. I will continue as per guidance

RohitChattopadhyay commented 5 years ago

Posted in StackOverflow asking for a solution, no help till now https://stackoverflow.com/questions/56219214/nested-additional-lookup

cannin commented 5 years ago

The redirect is acceptable for now.

On Mon, May 27, 2019 at 1:26 AM Rohit Rajat Chattopadhyay < notifications@github.com> wrote:

Posted in StackOverflow asking for a solution, no help till now https://stackoverflow.com/questions/56219214/nested-additional-lookup

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cannin/ihop-reach/issues/7?email_source=notifications&email_token=AAGA6DFF4Q7YHS3U2CNTYC3PXNWJNA5CNFSM4HN2JZA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWIZXMQ#issuecomment-496081842, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGA6DGAY2XFREBOTLPRLKDPXNWJNANCNFSM4HN2JZAQ .