Skip to content

Main content

Vocabulary Concept Branch Depth Tool

Inspect a supplied vocabulary parent graph, preserving polyhierarchy and explicitly flagging cycles.

Loading tool…

Description

Build parent sets from aligned edge arrays and traverse ancestors with an active-path cycle check and memoized depths.

A controlled vocabulary separates concept identifiers, labels, languages, and hierarchy edges. Distinct literal labels and repeated identical records need different consistency checks.

Build parent sets from aligned edge arrays and traverse ancestors with an active-path cycle check and memoized depths.

When to use this tool

Use Vocabulary Concept Branch Depth when you need a scoped vocabulary-label or ancestry diagnostic.

How to use the tool and how it works

  1. Enter parentIds, childIds, concept. Keep parallel arrays aligned. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read ancestorCount, maximumDepth, cyclic. Inspect cyclic before interpreting the associated values.

Build parent sets from aligned edge arrays and traverse ancestors with an active-path cycle check and memoized depths. Return distinct ancestors excluding concept and the longest depth, or maximumDepth -1 for a reachable cycle.1

Input fieldMeaning and unitsAccepted input
parentIdsParent IdsRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
childIdsChild IdsRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
conceptConceptRequired. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
ancestorCountAncestor CountRequired. Safe integer.
maximumDepthLongest ancestor path in edges, or -1 when a cycle is reachable from concept.Required. Safe integer.
cyclicCyclicRequired. Boolean.
json
{
  "input": {
    "parentIds": [
      "A",
      "B"
    ],
    "childIds": [
      "B",
      "C"
    ],
    "concept": "C"
  },
  "output": {
    "ancestorCount": 2,
    "maximumDepth": 2,
    "cyclic": false
  }
}

Limitations and assumptions

  • Only ancestors reachable from concept are considered; -1 is a cycle sentinel rather than a valid hierarchy depth.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.

Alternative or Complementary methods

Validate the complete vocabulary model and source identifiers, including language and hierarchy policies.

References

  1. Calculation and input contract: information-science/vocabulary-concept-branch-depth — tool.io

Similar or alternative tools