Rest API (indra_network_search.rest_api)

This documentation is here for completeness and for code documentation purposes. For a better description of the Rest API, read the API docs.

The IndraNetworkSearch REST API

indra_network_search.rest_api.get_prefix_autocomplete(prefix=Query(Ellipsis), max_res=Query(100))[source]

Get the case-insensitive node names with (ns, id) starting in prefix

Parameters
  • prefix (str) – The prefix of a node name to search for. Note: for prefixes of 1 and 2 characters, only exact matches are returned. For 3+ characters, prefix matching is done. If the prefix contains ‘:’, an namespace:id search is done.

  • max_res (int) – The top ranked (by node degree) results will be returned, cut off at this many results.

Return type

List[Tuple[str, str, str]]

Returns

A list of tuples of (node name, namespace, identifier)

indra_network_search.rest_api.get_xrefs(ns, id)[source]

Get all cross-refs given a namespace and ID

Parameters
  • ns (str) – The namespace of the entity to find cross-refs for

  • id (str) – The identifier of the entity to find cross-regs for

Return type

List[List[str]]

Returns

A list of tuples containing namespace, identifier, lookup url to identifiers.org

async indra_network_search.rest_api.health()[source]

Returns health status

Returns

Return type

Health

indra_network_search.rest_api.node_id_in_graph(db_name=Query(Ellipsis), db_id=Query(Ellipsis))[source]

Check if a node by provided db name and db id exists

Parameters
  • db_name (str) – The database name, e.g. hgnc, chebi or up

  • db_id (str) – The identifier for the entity in the given database, e.g. 11018

Return type

Optional[Node]

Returns

When a match is found, the full information of the node is returned

indra_network_search.rest_api.node_name_in_graph(node_name=Query(Ellipsis))[source]

Check if node by provided name (case sensitive) exists in graph

Parameters

node_name (str) – The name of the node to check

Return type

Optional[Node]

Returns

When a match is found, the full information of the node is returned

indra_network_search.rest_api.query(search_query, background_tasks)[source]

Interface with IndraNetworkSearchAPI.handle_query

Parameters

search_query (NetworkSearchQuery) – Query to the NetworkSearchQuery

Returns

Return type

Results

async indra_network_search.rest_api.server_status()[source]

Returns the status of the server and some info about the loaded graphs

Returns

indra_network_search.rest_api.sub_graph(search_query)[source]

Interface with IndraNetworkSearchAPI.handle_subgraph_query

Parameters

search_query (SubgraphRestQuery) – Query to for IndraNetworkSearchAPI.handle_subgraph_query

Returns

Return type

SubgraphResults