NCATS-Tangerine / translator-api-registry

This repo hosts the API metadata for the Translator project
13 stars 30 forks source link

GTRx API YAML #109

Closed mnarayan1 closed 1 year ago

mnarayan1 commented 1 year ago

YAML for GTRx API. The API is located here.

Issues

andrewsu commented 1 year ago
mnarayan1 commented 1 year ago

I updated the yaml file with infores information.

For testing, I followed the instructions and I'm getting this error when I run a query: Specified SmartAPI ID (123412341234) is either invalid or missing.

Here's what my smartapi_overrides.json file looks like:

{
  "conf": {
    "only_overrides": true
  },
  "apis": {
    "123412341234": "https://raw.githubusercontent.com/mnarayan1/translator-api-registry/gtrx-yaml/gtrx/gtrx.yaml"  
  }
}

Here's the query I tested:

curl --request POST \
  --url http://localhost:3000/v1/smartapi/123412341234/query \
  --header 'Content-Type: application/json' \
  --data '{
    "message": {
        "query_graph": {
            "nodes": {
                "n0": {
                    "categories": ["biolink:Disease"],
                    "ids": ["257220"]
                },
                "n1": {
                    "categories": ["biolink:SmallMolecule"]
                }
            },
            "edges": {
                "e01": {
                    "subject": "n0",
                    "object": "n1"
                }
            }
        }
    }
}'
colleenXu commented 1 year ago

I'm reviewing this now, so I'll request some edits soon.

I think one reason @mnarayan1 is encountering issues is because the names of the operations (disease-drug and drug-disease) don't match the names of the operations in the $ref under/query.post

      x-bte-kgs-operations:
      - $ref: '#/components/x-bte-kgs-operations/chemical-disease'
      - $ref: '#/components/x-bte-kgs-operations/disease-chemical'

because the yaml parser encounters this error, it probably isn't loading the yaml.

colleenXu commented 1 year ago

@mnarayan1 @andrewsu On the "INXIGHT" IDs, some questions:

  1. Are these UNII IDs? When I put various IDs into the top search bar of https://drugs.ncats.io/, I see an icon indicating that these are UNII IDs. And for most of these, SRI Node Normalizer can retrieve the correct entity when given this ID with the UNII prefix.
  2. It looks like Inxight IDs were added as the ID namespace ncats.drug, since Andrew's issue on this was closed with this commit
  3. I tried using Inxight/INXIGHT/inxight and ncats.drug as prefixes for the IDs in SRI Node Normalizer. None of those prefixes worked. Noting this issue https://github.com/TranslatorSRI/NodeNormalization/issues/135
colleenXu commented 1 year ago

@mnarayan1

I've attached the edited yaml with the following changes: gtrx.txt


notes on testing:

example queries ``` { "message": { "query_graph": { "edges": { "e01": { "subject": "n0", "object": "n1" } }, "nodes": { "n0": { "ids": ["OMIM:250250"], "categories": ["biolink:Disease"], "name": "CARTILAGE-HAIR HYPOPLASIA" }, "n1": { "categories": ["biolink:SmallMolecule"] } } } } } ``` and ``` { "message": { "query_graph": { "edges": { "e01": { "subject": "n0", "object": "n1" } }, "nodes": { "n0": { "ids": ["UNII:F64QU97QCR"], "categories": ["biolink:SmallMolecule"], "name": "Dantrolene" }, "n1": { "categories": ["biolink:Disease"] } } } } } ```
mnarayan1 commented 1 year ago

@colleenXu Thanks for your help! I updated my branch with your changes.

I tried testing with the updated yaml and queries, and I'm getting this error:

{
    "error": "Your input query graph is invalid",
    "more_info": "Your Input Query Graph is invalid."
}

I'm guessing the yaml file loaded correctly this time, but there are some issues with how I'm testing the queries themselves? This is the query I ran this time:

curl --request POST \
  --url http://localhost:3000/v1/smartapi/gtrx/query \
  --header 'Content-Type: application/json' \
  --data '{
    "message": {
        "query_graph": {
            "edges": {
                "e01": {
                    "subject": "n0",
                    "object": "n1"
                }
            },
            "nodes": {
                "n0": {
                    "ids": ["UNII:F64QU97QCR"],
                    "categories": ["biolink:SmallMolecule"],
                    "name": "Dantrolene"
                },
                "n1": {
                    "categories": ["biolink:Disease"]
                }
            }
        }
    }
}'
colleenXu commented 1 year ago

@mnarayan1 Thanks for making these changes! I'm going to move forward and merge this PR, then do the next steps of incorporating it into BTE.

I'm not sure why you're getting this vague error. Perhaps we could do a quick zoom meeting with screen-share to figure this out?