v1

latestOpenAPI 3.0.1Apache 2.02026-07-171383166.9 KB
translate

Translate natural language question into a standardized query

post/translate

Request body

textstring

Free text question

language'English'

Human language in which the question is posed

Example request

{
  "text": "what genetic conditions offer protection against malaria",
  "language": "English"
}

Response

successful operation

log_level'ERROR' | 'WARNING' | 'INFO' | 'DEBUG'

Logging level

submitterstring nullable

Any string for self-identifying the submitter of a query. The purpose of this optional field is to aid in the tracking of the source of queries for development and issue resolution.

bypass_cacheboolean

Set to true in order to request that the agent obtain fresh information from its sources in all cases where it has a viable choice between requesting fresh information in real time and using cached information. The agent receiving this flag MUST also include it in TRAPI sent to downstream sources (e.g., ARS -> ARAs -> KPs).

stream_progressboolean

Set to true in order to receive a stream of LogEntry objects as the query is progressing

enforce_edge_directionalityboolean

Set to true in order to enforce edge directionality during queries. By default, edge directionality can be reversed without penalty.

return_minimal_metadataboolean

Set to true in order to return only the most minimal metadata. By default, rich metadata for nodes and edges are supplied, which may cause a very large and slower Response.

max_resultsinteger

Maximum number of individual results to return

page_sizeinteger

Split the results into pages with this number of results each

page_numberinteger

Page number of results when the number of results exceeds the page_size, with page 1 as the first page

Example response

[
  {
    "submitter": "submitter",
    "bypass_cache": false,
    "page_number": 1,
    "operations": "",
    "workflow": [
      "",
      ""
    ],
    "log_level": "",
    "enforce_edge_directionality": false,
    "return_minimal_metadata": false,
    "max_results": 100,
    "stream_progress": false,
    "message": {
      "query_graph": {
        "edges": {
          "e00": {
            "subject": "n00",
            "object": "n01",
            "predicates": [
              "biolink:physically_interacts_with"
            ]
          }
        },
        "nodes": {
          "n00": {
            "ids": [
              "CHEMBL.COMPOUND:CHEMBL112"
            ]
          },
          "n01": {
            "categories": [
              "biolink:Protein"
            ]
          }
        }
      }
    },
    "page_size": 100
  }
]