Skip to content

Support top-level query parameters #509

@tokebe

Description

@tokebe

Multiple teams have found a use case for being able to specify certain parameters that inform how the query execution should behave. An example already exists in TRAPI: bypass_cache. Additional examples in Retriever can be found in these two issues: BioPack-team/retriever#8, BioPack-team/retriever#7

I propose a top-level parameters or query_parameters dictionary should be added, subsuming the existing bypass_cache and adding additional enumerated parameters:

  • timeout or job_timeout or something like this, which can be used to alert the API how much time it has to work with, or set to -1 to enable the API to spend an unbound amount of time on the query (up to the API to decide how long), or can be left unset to accept the API's default timeout, which should be populated in the response.
  • data_tiers to allow ARAs to specify to Retriever which data tiers should be used-- this may be best kept as an informal parameter, rather than strictly codifying it, considering its highly specific use-case
  • Any others for which there is a clear, broad use-case

Additionally, this dictionary should accept additional values, so that arbitrary/informal parameters may be defined by individual APIs implementing TRAPI.

As an example, this is presently a valid query to Retriever:

{
    "parameters": {
        "timeout": -1,
        "tiers": [
            1
        ]
    },
    "submitter": "bte-dev-tester-manual",
    "message": {
        "query_graph": {
            "nodes": {
                "n0": {
                    "categories": [
                        "biolink:Gene"
                    ],
                    "ids": [
                        "NCBIGene:3778"
                    ]
                },
                "n1": {
                    "categories": [
                        "biolink:Disease"
                    ]
                }
            },
            "edges": {
                "e01": {
                    "subject": "n0",
                    "object": "n1",
                    "predicates": [
                        "biolink:causes"
                    ]
                }
            }
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions