Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TRAPI 1.5: new query property bypass_cache #799

Closed
colleenXu opened this issue Mar 26, 2024 · 3 comments
Closed

TRAPI 1.5: new query property bypass_cache #799

colleenXu opened this issue Mar 26, 2024 · 3 comments
Assignees
Labels
On Test Related changes are deployed to Test server trapi 1.5

Comments

@colleenXu
Copy link
Collaborator

colleenXu commented Mar 26, 2024

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"
                }
            }
        }
    }
}

@tokebe tokebe self-assigned this Mar 26, 2024
@colleenXu colleenXu changed the title Major: new query property bypass_cache TRAPI 1.5: new query property bypass_cache Mar 29, 2024
@colleenXu
Copy link
Collaborator Author

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

@colleenXu
Copy link
Collaborator Author

colleenXu commented Apr 12, 2024

@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.

@colleenXu colleenXu added the On CI Related changes are deployed to CI server label Apr 16, 2024
@colleenXu colleenXu added On CI -> Test and removed On CI Related changes are deployed to CI server labels May 3, 2024
@tokebe tokebe added On Test Related changes are deployed to Test server and removed On CI -> Test labels May 9, 2024
@colleenXu
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
On Test Related changes are deployed to Test server trapi 1.5
Projects
None yet
Development

No branches or pull requests

2 participants