biothings / biothings_explorer

TRAPI service for BioThings Explorer

Home Page:https://api.bte.ncats.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TRAPI 1.5: new query property `bypass_cache`

colleenXu opened this issue · comments

TRAPI 1.5 introduces a new optional property in queries (same level as message/log_level/workflow/submitter), bypass_cache (lines 292-299, 351-358). It can be added to "sync" (/query) and async queries.

If this property is present and set to true, then BTE shouldn't use cached data. Also, BTE should add bypass_cache: true to its queries to TRAPI KPs, according to the implementation note in changelog

  • Note: got clarification that this property can't/shouldn't be passed to NodeNorm (Translator Slack link)
Example TRAPI query with `bypass_cache: true`

{
    "bypass_cache": true,
    "message": {
        "query_graph": {
            "nodes": {
                "SN": {
                    "categories":["biolink:ChemicalEntity"]
                },
                "ON": {
                    "ids":["MONDO:0001119"],
                    "categories":["biolink:Disease"]
               }
            },
            "edges": {
                "e01": {
                    "subject": "SN",
                    "object": "ON",
                    "predicates": ["biolink:treats"],
                    "knowledge_type": "inferred"
                }
            }
        }
    }
}

May be related to old feature, where caching is a parameter in queries #224

@tokebe

Looks good.
Based on quick testing, this works as-intended: I ran queries 3 times. 1st to cache, 2nd to see if it uses the cache (it does), 3rd with bypass_cache to see if it correctly doesn't use the cache (yep). I tested a basic query (not-creative-mode) and a creative-mode query.

The code was deployed today to Prod as part of the Octopus release. I tested and it's live. I used the same method of 3 queries, seeing if I can toggle the value of bypass_cache to use the cache or not.