Query Classes (indra_network_search.query
)
This file contains the Query classes mapping incoming rest queries to different algorithms used in the search api.
- class indra_network_search.query.BreadthFirstSearchQuery(query, hash_blacklist=None)[source]
Check queries that will use the bfs_search algorithm
- alg_options()[source]
Match arguments of bfs_search from query
- Return type:
Dict
[str
,Any
]- Returns:
The argument to provide bfs_search
- mesh_options(graph=None)[source]
Get mesh options for bfs_search
- Parameters:
graph (
Optional
[DiGraph
]) – The graph- Return type:
Dict
[str
,Union
[Set
,bool
,Callable
]]- Returns:
The mesh option for bfs_search
- options
alias of
BreadthFirstSearchOptions
- class indra_network_search.query.DijkstraQuery(query, hash_blacklist=None)[source]
Check queries that will use the open_dijkstra_search algorithm
- alg_options()[source]
Match arguments of open_dijkstra_search from query
- Return type:
Dict
[str
,Any
]- Returns:
A dict with arguments for open_dijkstra_search
- mesh_options(graph=None)[source]
Produces mesh arguments matching open_dijkstra_search from query
- Return type:
Dict
[str
,Union
[Set
,bool
,Callable
]]- Returns:
The mesh options for open_dijkstra_query
- options
alias of
DijkstraOptions
- exception indra_network_search.query.InvalidParametersError[source]
Raise when conflicting or otherwise invalid parameters
- exception indra_network_search.query.MissingParametersError[source]
Raise for missing query parameters
- class indra_network_search.query.MultiInteractorsQuery(rest_query)[source]
Check queries that will use pathfinding.direct_multi_interactors
- options
alias of
MultiInteractorsOptions
- class indra_network_search.query.OntologyQuery(query)[source]
Check queries that will use shared_parents
- alg_options()[source]
Match arguments of shared_parents from query
- Return type:
Dict
[str
,Any
]- Returns:
A dict with arguments for shared_parents
- options
alias of
OntologyOptions
- class indra_network_search.query.PathQuery(query, hash_blacklist)[source]
Parent Class for ShortestSimplePaths, Dijkstra and BreadthFirstSearch
- alg_options()[source]
Returns the options for the algorithm used, excl mesh options
- Return type:
Dict
[str
,Any
]
- mesh_options(graph=None)[source]
Return algorithm specific mesh options
- Return type:
Dict
[str
,Any
]
- class indra_network_search.query.Query(query)[source]
Parent class to all Query classes
The Query classes are helpers that make sure the methods of the IndraNetworkSearchAPI receive the data needed from a NetworkSearchQuery or other Rest query.
- api_options()[source]
These options are used when IndraNetworkSearchAPI handles the query
The options here impact decisions on which extra search algorithms to include and which graph to pick
- Return type:
Dict
[str
,Any
]- Returns:
A dict of ApiOptions
Check queries that will use shared_interactors(regulators=True)
Check queries that will use shared_interactors(regulators=False)
- class indra_network_search.query.ShortestSimplePathsQuery(query, hash_blacklist=None)[source]
Check queries that will use the shortest_simple_paths algorithm
- alg_options()[source]
Match arguments of shortest_simple_paths from query
- Return type:
Dict
[str
,Any
]- Returns:
A dict with arguments for shortest_simple_paths
- mesh_options(graph=None)[source]
Match input to shortest_simple_paths
- Return type:
Dict
[str
,Union
[Set
,int
,bool
,Callable
]]- Returns:
The mesh options for shortest_simple_paths
- options
alias of
ShortestSimplePathOptions
- class indra_network_search.query.SubgraphQuery(query)[source]
Check queries that gets the subgraph
- alg_options(graph)[source]
Match arguments of get_subgraph_edges
- Parameters:
graph (
DiGraph
) – The graph the search will be performed with- Return type:
Dict
[str
,List
[Node
]]- Returns:
A dict with the arguments for get_subgraph_edges
- options
alias of
SubgraphOptions