Skip to main content

Hierarchy Class


Sometimes a class contains a hierarchy, that is either defined explicitly in the database or not.

Example: South Europe is a region that is part of Europe, forming a hierarchy.


To define it, you will need to first add a couple of tags to your class.

kb {
class Region {
name.en: "Region"

tag: [


Hierarchy not in the database

If your hierarchy is not defined in your database (e.g. there is a South Europe, but no Europe in the database), you can manually define the hierarchy over Studio.

To do this, open the entities file for your class in Studio. You can find it by clicking on the list icon on the Studio sidebar next to the class name.

Entities File

Now define the hierarchy node entities manually (e.g. "Europe") and set the parent attribute from the existing entities (e.g. "South Europe"). Don't forget to add the tags KB_HierarchyLeaf and KB_HierarchyNode.

kb.Region {

entity South_Europe_123 {
name.en: "South Europe"

/** Add this to all hierarchy leaves */
tag: KB_HierarchyLeaf

/** Specify the node in the next level of the hierarchy */
parent: Europe

id: "123"

/** Create this manually */
entity Europe {
name.en: "Europe"

tag: KB_HierarchyNode

parent: EMEA

/** Set the id to something unused. */
id: "Europe"

/** The hierarchy can be multi-level. */
entity EMEA {
name.en: "EMEA"

tag: KB_HierarchyNode

id: "EMEA"