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
- Enter parentIds, childIds, concept. Keep parallel arrays aligned. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- 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 field | Meaning and units | Accepted input |
|---|---|---|
| parentIds | Parent Ids | Required. Array of text; maximum UTF-16 length 8192; maximum items 256. |
| childIds | Child Ids | Required. Array of text; maximum UTF-16 length 8192; maximum items 256. |
| concept | Concept | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| ancestorCount | Ancestor Count | Required. Safe integer. |
| maximumDepth | Longest ancestor path in edges, or -1 when a cycle is reachable from concept. | Required. Safe integer. |
| cyclic | Cyclic | Required. Boolean. |
{
"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
Similar or alternative tools
- Vocabulary Polyhierarchy Parent Count
Select rows with childIds equal to concept, deduplicate their parent IDs, and return the ordered list and count.
- Metadata Relation Inverse Flag
Find forward, return known, and compare its mapped inverse exactly with suppliedInverse.