descendants
- Last Updated: May 29, 2026
- 2 minute read
- Semaphore
- Documentation
The descendants rule generates a set of links to all the descendants of the current concept by following the defined type of relationship.
Descendants is a recursive tree traversal template rule creating a list of contributing links and exposing them under a specific label value.
An illustration is included in the out-of-the-box FactExtraction-AllDescendants.kid template.
Attributes
The descendants rule has the following attributes:
- label
- relationshiptypes - the only allowed value is “LowerInHierarchy”
- rulebaseclass : the rulebase class name to use to generate the target link labels
Example 1
For a model that contains the following hierarchies:
Education and skills (id: 1)
NT: Schools (id: 2)
NT: Learning and teaching methods (id: 3)
NT: e-Learning (id: 4)
NT: National Grid for Learning (id: 5)
NT: Distance learning (id: 6)
Using the following template rule:
<combine>
<descendants label="link.RULEBASE_CLASS.WORD_FIELD.LANGUAGE.ID_FIELD_FINAL" relationshiptypes="LowerInHierarchy" rulebaseclass="${className}" />
</combine>
The rule generated for ‘Education and skills’ will be expanded to:
<combine>
<link label="link.Topic.Schools.en.2_FINAL" />
<link label="link.Topic.Learning and teaching methods.en.3_FINAL" />
<link label="link.Topic.e-Learning.en.4_FINAL" />
<link label="link.Topic.National Grid for Learning.en.5_FINAL" />
<link label="link.Topic.Distance learning.en.6_FINAL" />
</combine>
Example 2
For a model that contains the following hierarchies
Organizations (id: 1)
NT: Org A (id: 2)
NT: Org B (id: 3)
NT: Org C (id: 4) - DO NOT GENERATE RULEBASE SET
NT: Org D (id: 5)
NT: org E (id: 6)
Using the following template rule:
<any label="Organization.${className}.${rulebaseSetConfig.language.name}.ALL">
<descendants label="Organization.RULEBASE_CLASS.LANGUAGE.ZTHES"
relationshiptypes="LowerInHierarchy" rulebaseclass="${className}" />
</any>
The rule generated for ‘Organizations’ will be expanded to:
<any label="Organization.NamedEntity.en.ALL">
<link label="Organization.NamedEntity.en.2" />
<link label="Organization.NamedEntity.en.3" />
<link label="Organization.NamedEntity.en.5" />
<link label="Organization.NamedEntity.en.6" />
</any>
In such a case typically rulebases for Org A to E will be generated with the FactExtraction-SimpleEntity.kid or a similar type of classification strategy.
The Organization.NamedEntity.en.ALL is then used in a fact extraction rulebase such as:
<extract promote="document">
<sentence extract_group="employee">
<expression type="PERSON" extract_name="name" />
<phrase data="works for" />
<link label="Organization.NamedEntity.en.ALL" extract_tags="organization" />
</sentence>
</extract>