get_hierarchy

get_hierarchy(prefix, /, *, extra_relations=None, properties=None, **kwargs)[source]

Get hierarchy of parents as a directed graph.

Parameters:
  • prefix (Prefix) – The name of the namespace.

  • extra_relations (Iterable[ReferenceHint] | None) – Other relations that you want to include in the hierarchy. For example, it might be useful to include the positively_regulates

  • properties (Iterable[ReferenceHint] | None) – Properties to include in the data part of each node. For example, might want to include SMILES strings with the ChEBI tree.

  • kwargs (Unpack[HierarchyKwargs]) – additional keyword arguments for getting a directed hierarchy graph

Returns:

A directional graph representing the hierarchy

Return type:

nx.DiGraph[Reference]

This function thinly wraps _get_hierarchy_helper() to make it easier to work with the lru_cache mechanism.