A class that represents a Taxonomy. It provides methods to find nodes by label or by id. Additionally, it computes the Lowest Common Ancestor for two nodes

Constructors

Methods

  • Compute the lowest common ancestor for two nodes identified by their labels

    Parameters

    • c1Label: string

      Label of the first node

    • c2Label: string

      Label of the second node

    Returns null | TaxonomyNode

    A copy of the lowest common ancestor of the nodes; or null, if any input node does not exist

  • Find the first node with a specific label

    Parameters

    • label: string

      node label

    Returns undefined | TaxonomyNode

    A copy of the taxonomy node with the label; or undefined, if it does not exist