Closed mnarayan1 closed 1 year ago
infores:gtrx
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"
}
}
}
}
}'
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.
@mnarayan1 @andrewsu On the "INXIGHT" IDs, some questions:
ncats.drug
, since Andrew's issue on this was closed with this commitncats.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@mnarayan1
I've attached the edited yaml with the following changes: gtrx.txt
UNII
as the ID prefix rather than ncats.drug
or INXIGHT
. Discussed here. supportBatch: true
. In general, queries that use the /query.post endpoint can handle batch-queries (> 1 ID at a time). notes on testing:
{
"conf": {
"only_overrides": true
},
"apis": {
"gtrx": "file:///Users/colleenxu/Desktop/translator-api-registry/gtrx/gtrx.yaml"
}
}
npm run compile
and API_OVERRIDE=true INSTANCE_ENV=dev npm run smartapi_sync --workspace='@biothings-explorer/bte-trapi'
to set up using this local copy of the yaml. Then I run npm start
to start up BTE.http://localhost:3000/v1/smartapi/gtrx/query
. Inside the request body (TRAPI query), we must use prefixed-IDs (aka curies)...@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"]
}
}
}
}
}'
@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?
YAML for GTRx API. The API is located here.
Issues