Wiki source code of 8 Hierarchy

Version 18.5 by Helena K. on 2026/06/08 17:10

Hide last authors
Helena K. 3.2 1 {{box title="**Contents**"}}
2 {{toc/}}
3 {{/box}}
Helena K. 1.1 4
Helena K. 3.2 5 == 8.1 Scope ==
Helena K. 1.1 6
Helena K. 18.3 7 The [[Codelist>>doc:sdmx:Glossary 2\.1.Code list.WebHome]] described in the section on structural definitions supports a simple [[hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] of [[Codes>>doc:sdmx:Glossary 2\.1.Code.WebHome]] and restricts any child [[Code>>doc:sdmx:Glossary 2\.1.Code.WebHome]] to having just one parent [[Code>>doc:sdmx:Glossary 2\.1.Code.WebHome]]. Whilst this structure is useful for supporting the needs of the DataStructureDefinition and the MetadataStructureDefinition, it may not be sufficient for supporting the more complex associations between [[codes>>doc:sdmx:Glossary 2\.1.Code.WebHome]] that are often found in coding schemes such as a [[classification>>doc:sdmx:Glossary 2\.1.Statistical Classification.WebHome]] scheme. Often, the [[Codelist>>doc:sdmx:Glossary 2\.1.Code list.WebHome]] used in a DataStructureDefinition is derived from a more complex coding scheme. Access to such a coding scheme can aid applications, such as OLAP applications or data visualisation systems, to give more views of the data than would be possible with the simple [[Codelist>>doc:sdmx:Glossary 2\.1.Code list.WebHome]] used in the DataStructureDefinition. A [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] may be linked to an IndentifiableArtefact, in order to assist.
Helena K. 1.1 8
Helena K. 18.3 9 Note that a [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] is not necessarily a balanced tree. A balanced tree is where [[levels>>doc:sdmx:Glossary 2\.1.Level.WebHome]] are pre-defined and fixed, (i.e. a [[level>>doc:sdmx:Glossary 2\.1.Level.WebHome]] always has the same set of [[codes>>doc:sdmx:Glossary 2\.1.Code.WebHome]], and any [[code>>doc:sdmx:Glossary 2\.1.Code.WebHome]] has a fixed parent and child relationship to other [[codes>>doc:sdmx:Glossary 2\.1.Code.WebHome]]). A [[statistical classification>>doc:sdmx:Glossary 2\.1.Statistical Classification.WebHome]] is an example of a balanced tree, and the support for a balanced [[hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] is a subset, and special case, of [[hierarchies>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]].
Helena K. 1.1 10
Helena K. 18.3 11 The principal features of the [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] are:
Helena K. 1.1 12
Helena K. 18.3 13 1. A child [[code>>doc:sdmx:Glossary 2\.1.Code.WebHome]] can have more than one parent.
14 1. There can be more than one [[code>>doc:sdmx:Glossary 2\.1.Code.WebHome]] that has no parent (i.e. more than one “root node”).
15 1. The [[levels>>doc:sdmx:Glossary 2\.1.Level.WebHome]] in a [[hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] can be explicitly defined or they can be implicit: i.e. they exist only as parent/child relationships in the coding structure.
16 1. [[Hierarchies>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] may be associated to the structures they refer to, via the HierarchyAssociation.
Helena K. 1.1 17
Helena K. 3.2 18 == 8.2 Inheritance ==
Helena K. 1.1 19
Helena K. 3.2 20 === 8.2.1 Class Diagram ===
Helena K. 1.1 21
Helena K. 10.2 22 [[image:image61.png]]
23
Helena K. 1.1 24 **Figure 35: Inheritance class diagram for the Hierarchy**
25
Helena K. 3.2 26 === 8.2.2 Explanation of the Diagram ===
Helena K. 1.1 27
Helena K. 3.2 28 ==== 8.2.2.1 Narrative ====
Helena K. 1.1 29
Helena K. 18.4 30 The [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] and //HierarchyAssociation// inherit from //MaintainableArtefact// and thus have identification, naming, versioning and a [[maintenance agency>>doc:sdmx:Glossary 2\.1.Maintenance agency.WebHome]]. The [[Level>>doc:sdmx:Glossary 2\.1.Level.WebHome]] is a //NameableArtefact// and therefore has an Id, multi-lingual name and multi-lingual description. A //HierachicalCode// is an //IdentifiableArtefact//.
Helena K. 1.1 31
Helena K. 18.4 32 It is important to understand that the [[Codes>>doc:sdmx:Glossary 2\.1.Code.WebHome]] participating in a [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] are not themselves contained in the list – they are referenced from the list and are maintained in one or more [[Codelists>>doc:sdmx:Glossary 2\.1.Code list.WebHome]]. This is explained in the narrative of the relationship class diagram below.
Helena K. 1.1 33
Helena K. 3.2 34 ==== 8.2.2.2 Definitions ====
Helena K. 1.1 35
Helena K. 18.4 36 The definitions of the various classes, [[attributes>>doc:sdmx:Glossary 2\.1.Attribute.WebHome]], and associations are shown in the relationship section below.
Helena K. 1.1 37
Helena K. 3.2 38 == 8.3 Relationship ==
Helena K. 1.1 39
Helena K. 3.2 40 === 8.3.1 Class Diagram ===
Helena K. 1.1 41
Helena K. 10.3 42 [[image:image62.png]]
43
Helena K. 1.1 44 **Figure 36: Relationship class diagram of the Hierarchy**
45
Helena K. 3.2 46 === 8.3.2 Explanation of the Diagram ===
Helena K. 1.1 47
Helena K. 3.2 48 ==== 8.3.2.1 Narrative ====
Helena K. 1.1 49
Helena K. 18.4 50 The basic principles of the [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] are:
Helena K. 1.1 51
Helena K. 18.4 52 1. The [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] is a specification of the structure of the [[Codes>>doc:sdmx:Glossary 2\.1.Code.WebHome]].
53 1. The [[Codes>>doc:sdmx:Glossary 2\.1.Code.WebHome]] in the [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] are not themselves a part of the [[artefact>>doc:sdmx:Glossary 2\.1.Artefact.WebHome]], rather they are references to [[Codes>>doc:sdmx:Glossary 2\.1.Code.WebHome]] in one or more external [[Codelists>>doc:sdmx:Glossary 2\.1.Code list.WebHome]].
54 1. The [[hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] of [[Codes>>doc:sdmx:Glossary 2\.1.Code.WebHome]] is specified in HierarchicalCode. This references the [[Code>>doc:sdmx:Glossary 2\.1.Code.WebHome]] and its immediate child HierarchicalCodes.
Helena K. 1.1 55
Helena K. 18.4 56 A [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] can have formal [[levels>>doc:sdmx:Glossary 2\.1.Level.WebHome]] (hasFormalLevels="true"). However, even if hasFormalLevels="false" the [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] can still have one or more [[Levels>>doc:sdmx:Glossary 2\.1.Level.WebHome]] associated in order to document information about the HierarchicalCodes.
Helena K. 1.1 57
Helena K. 18.4 58 If hasFormalLevels="false" the [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] is “value based” comprising a [[hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] of [[codes>>doc:sdmx:Glossary 2\.1.Code.WebHome]] with no formal [[Levels>>doc:sdmx:Glossary 2\.1.Level.WebHome]]. If hasFormalLevels="true" then the [[hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] is “[[level>>doc:sdmx:Glossary 2\.1.Level.WebHome]] based” where each [[Level>>doc:sdmx:Glossary 2\.1.Level.WebHome]] is a formal [[Level>>doc:sdmx:Glossary 2\.1.Level.WebHome]] in the [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]], such as those present in [[statistical classifications>>doc:sdmx:Glossary 2\.1.Statistical Classification.WebHome]]. In a “[[level>>doc:sdmx:Glossary 2\.1.Level.WebHome]] based” [[hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] each HierarchicalCode is linked to the [[Level>>doc:sdmx:Glossary 2\.1.Level.WebHome]] in which it resides. It is expected that all HierarchicalCodes at the same hierarchic [[level>>doc:sdmx:Glossary 2\.1.Level.WebHome]] defined by the +parent/+child association will be linked to the same [[Level>>doc:sdmx:Glossary 2\.1.Level.WebHome]]. Note that the +[[level>>doc:sdmx:Glossary 2\.1.Level.WebHome]] association need only be specified if the HierarchicalCode is at a different hierarchical [[level>>doc:sdmx:Glossary 2\.1.Level.WebHome]] (implied by the HierarchicalCode parent/child association) than the actual [[Level>>doc:sdmx:Glossary 2\.1.Level.WebHome]] in the [[level>>doc:sdmx:Glossary 2\.1.Level.WebHome]] [[hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] (implied by the [[Level>>doc:sdmx:Glossary 2\.1.Level.WebHome]] parent/child association).
Helena K. 1.1 59
Helena K. 18.4 60 [Note that organisations wishing to be compliant with accepted models for [[statistical classifications>>doc:sdmx:Glossary 2\.1.Statistical Classification.WebHome]] should ensure that the Id is the number associated with the [[Level>>doc:sdmx:Glossary 2\.1.Level.WebHome]], where [[Levels>>doc:sdmx:Glossary 2\.1.Level.WebHome]] are numbered consecutively starting with [[level>>doc:sdmx:Glossary 2\.1.Level.WebHome]] 1 at the highest [[Level>>doc:sdmx:Glossary 2\.1.Level.WebHome]]].
Helena K. 1.1 61
Helena K. 18.4 62 The [[Level>>doc:sdmx:Glossary 2\.1.Level.WebHome]] may have CodingFormat information defined (e.g. coding type at that [[level>>doc:sdmx:Glossary 2\.1.Level.WebHome]]).
Helena K. 1.1 63
Helena K. 18.4 64 A HierarchyAssociation links an IdentifiableArtefact (+linkedObject), that needs a [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]], with the latter (+linkedHierarchy). The association is performed in a certain context (+contextObject), e.g. a [[Dimension>>doc:sdmx:Glossary 2\.1.Dimension.WebHome]] in the context of a [[Dataflow>>doc:sdmx:Glossary 2\.1.Dataflow.WebHome]].
Helena K. 1.1 65
Helena K. 16.1 66 ==== 8.3.2.2 Definitions ====
Helena K. 1.1 67
Helena K. 3.3 68 (% style="width:901.835px" %)
69 |**Class**|**Feature**|(% style="width:564px" %)**Description**
Helena K. 18.4 70 |[[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]]|(((
Helena K. 1.1 71 Inherits from:
Helena K. 18.2 72 //MaintainableArtefact//
Helena K. 18.5 73 )))|(% style="width:564px" %)A [[classification>>doc:sdmx:Glossary 2\.1.Statistical Classification.WebHome]] structure arranged in [[levels>>doc:sdmx:Glossary 2\.1.Level.WebHome]] of detail from the broadest to the most detailed [[level>>doc:sdmx:Glossary 2\.1.Level.WebHome]].
Helena K. 3.3 74 | |hasFormalLevels|(% style="width:564px" %)(((
Helena K. 18.5 75 If “true”, this indicates a [[hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] where the structure is arranged in [[levels>>doc:sdmx:Glossary 2\.1.Level.WebHome]] of detail from the broadest to the most detailed [[level>>doc:sdmx:Glossary 2\.1.Level.WebHome]].
Helena K. 1.1 76
Helena K. 18.5 77 If “false”, this indicates a [[hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] structure where the items in the [[hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] have no formal [[level>>doc:sdmx:Glossary 2\.1.Level.WebHome]] structure.
Helena K. 1.1 78 )))
Helena K. 18.5 79 | |+codes|(% style="width:564px" %)Association to the top-[[level>>doc:sdmx:Glossary 2\.1.Level.WebHome]] [[Hierarchical Codes>>doc:sdmx:Glossary 2\.1.Hierarchical code.WebHome]] in the [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]].
80 | |+level|(% style="width:564px" %)Association to the top [[Level>>doc:sdmx:Glossary 2\.1.Level.WebHome]] in the [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]].
81 |[[Level>>doc:sdmx:Glossary 2\.1.Level.WebHome]]|(((
Helena K. 1.1 82 Inherits from
Helena K. 18.2 83 //NameableArtefact//
Helena K. 3.3 84 )))|(% style="width:564px" %)(((
Helena K. 18.5 85 In a “[[level>>doc:sdmx:Glossary 2\.1.Level.WebHome]] based” [[hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] this describes a group of [[Codes>>doc:sdmx:Glossary 2\.1.Code.WebHome]] which are characterised by homogeneous coding, and where the parent of each [[Code>>doc:sdmx:Glossary 2\.1.Code.WebHome]] in the group is at the same higher [[level>>doc:sdmx:Glossary 2\.1.Level.WebHome]] of the [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]].
86 In a “value based’ [[hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] this describes information about the [[Hierarchical Codes>>doc:sdmx:Glossary 2\.1.Hierarchical code.WebHome]] at the specified nesting [[level>>doc:sdmx:Glossary 2\.1.Level.WebHome]].
Helena K. 1.1 87 )))
Helena K. 18.4 88 | |+codeFormat|(% style="width:564px" %)Association to the [[Coding Format>>doc:sdmx:Glossary 2\.1.Coding format.WebHome]].
Helena K. 18.5 89 | |+child|(% style="width:564px" %)Association to a child [[Level>>doc:sdmx:Glossary 2\.1.Level.WebHome]] of [[Level>>doc:sdmx:Glossary 2\.1.Level.WebHome]].
90 |CodingFormat| |(% style="width:564px" %)Specifies format information for the [[codes>>doc:sdmx:Glossary 2\.1.Code.WebHome]] at this [[level>>doc:sdmx:Glossary 2\.1.Level.WebHome]] in the [[hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] such as whether the [[codes>>doc:sdmx:Glossary 2\.1.Code.WebHome]] at the [[level>>doc:sdmx:Glossary 2\.1.Level.WebHome]] are alphabetic, numeric or alphanumeric and the [[code>>doc:sdmx:Glossary 2\.1.Code.WebHome]] length.
Helena K. 18.4 91 |HierarchicalCode| |(% style="width:564px" %)A hierarchic structure of [[code>>doc:sdmx:Glossary 2\.1.Code.WebHome]] references.
Helena K. 18.2 92 | |validFrom|(% style="width:564px" %)Date from which the construct is valid
93 | |validTo|(% style="width:564px" %)Date from which construct is superseded.
Helena K. 18.4 94 | |+code|(% style="width:564px" %)Association to the [[Code>>doc:sdmx:Glossary 2\.1.Code.WebHome]] that is used at the specific point in the [[hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]].
95 | |+child|(% style="width:564px" %)Association to a child [[Code>>doc:sdmx:Glossary 2\.1.Code.WebHome]] in the [[hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]].
Helena K. 18.5 96 | |+level|(% style="width:564px" %)Association to a [[Level>>doc:sdmx:Glossary 2\.1.Level.WebHome]] where [[levels>>doc:sdmx:Glossary 2\.1.Level.WebHome]] have been defined for the [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]].
Helena K. 18.4 97 |[[Code>>doc:sdmx:Glossary 2\.1.Code.WebHome]]| |(% style="width:564px" %)The [[Code>>doc:sdmx:Glossary 2\.1.Code.WebHome]] to be used at this point in the [[hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]].
98 | |/items|(% style="width:564px" %)Association to the [[Code list>>doc:sdmx:Glossary 2\.1.Code list.WebHome]] containing the [[Code>>doc:sdmx:Glossary 2\.1.Code.WebHome]].
99 |[[Codelist>>doc:sdmx:Glossary 2\.1.Code list.WebHome]]| |(% style="width:564px" %)The [[Code list>>doc:sdmx:Glossary 2\.1.Code list.WebHome]] containing the [[Code>>doc:sdmx:Glossary 2\.1.Code.WebHome]].
Helena K. 1.1 100 |HierarchyAssociation|(((
101 Inherits from:
Helena K. 18.2 102 //MaintainableArtefact//
Helena K. 18.4 103 )))|(% style="width:564px" %)An association between an [[Identifiable Artefact>>doc:sdmx:Glossary 2\.1.Identifiable artefact.WebHome]] and a [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]], within a specific context.
Helena K. 3.3 104 | |+contextObject|(% style="width:564px" %)The context within which the association is performed.
Helena K. 18.4 105 | |+linkedObject|(% style="width:564px" %)Associates the [[Identifiable Artefact>>doc:sdmx:Glossary 2\.1.Identifiable artefact.WebHome]] that needs the [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]].
106 | |+linkedHierarchy|(% style="width:564px" %)Associated the [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]].
© Semantic R&D Group, 2026