Wiki source code of 8 Hierarchy
Hide last authors
| author | version | line-number | content |
|---|---|---|---|
| |
3.2 | 1 | {{box title="**Contents**"}} |
| 2 | {{toc/}} | ||
| 3 | {{/box}} | ||
| |
1.1 | 4 | |
| |
3.2 | 5 | == 8.1 Scope == |
| |
1.1 | 6 | |
| |
15.2 | 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 and restricts any [[child>>doc:IMElements.child.WebHome]] [[Code>>doc:IMElements.AnnotableArtefact.IdentifiableArtefact.NameableArtefact.Item.Code.WebHome]] to having just one [[parent>>doc:IMElements.parent.WebHome]] [[Code>>doc:IMElements.AnnotableArtefact.IdentifiableArtefact.NameableArtefact.Item.Code.WebHome]]. Whilst this [[structure>>doc:IMElements.structure.WebHome]] is useful for supporting the needs of the [[DataStructureDefinition>>doc:IMElements.AnnotableArtefact.IdentifiableArtefact.NameableArtefact.VersionableArtefact.MaintainableArtefact.Structure.DataStructureDefinition.WebHome]] and the [[MetadataStructureDefinition>>doc:IMElements.AnnotableArtefact.IdentifiableArtefact.NameableArtefact.VersionableArtefact.MaintainableArtefact.Structure.MetadataStructureDefinition.WebHome]], it may not be sufficient for supporting the more complex associations between codes 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>>doc:IMElements.AnnotableArtefact.IdentifiableArtefact.NameableArtefact.VersionableArtefact.MaintainableArtefact.Structure.DataStructureDefinition.WebHome]] 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>>doc:IMElements.AnnotableArtefact.IdentifiableArtefact.NameableArtefact.VersionableArtefact.MaintainableArtefact.Structure.DataStructureDefinition.WebHome]]. A [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] may be linked to an IndentifiableArtefact, in order to assist. |
| |
1.1 | 8 | |
| |
15.1 | 9 | Note that a [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] is not necessarily a balanced tree. A balanced tree is where |
| |
1.1 | 10 | |
| |
15.2 | 11 | levels are pre-defined and fixed, (i.e. a level always has the same set of codes, and any code has a fixed [[parent>>doc:IMElements.parent.WebHome]] and [[child>>doc:IMElements.child.WebHome]] relationship to other codes). 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]]. |
| |
6.2 | 12 | |
| |
15.1 | 13 | The principal features of the [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] are: |
| |
1.1 | 14 | |
| |
15.2 | 15 | 1. A [[child>>doc:IMElements.child.WebHome]] code can have more than one [[parent>>doc:IMElements.parent.WebHome]]. |
| 16 | 1. There can be more than one code that has no [[parent>>doc:IMElements.parent.WebHome]] (i.e. more than one “root node”). | ||
| 17 | 1. The levels 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>>doc:IMElements.parent.WebHome]]/[[child>>doc:IMElements.child.WebHome]] relationships in the coding [[structure>>doc:IMElements.structure.WebHome]]. | ||
| |
15.1 | 18 | 1. [[Hierarchies>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] may be associated to the structures they refer to, via the HierarchyAssociation. |
| |
1.1 | 19 | |
| |
3.2 | 20 | == 8.2 Inheritance == |
| |
1.1 | 21 | |
| |
3.2 | 22 | === 8.2.1 Class Diagram === |
| |
1.1 | 23 | |
| |
10.2 | 24 | [[image:image61.png]] |
| 25 | |||
| |
1.1 | 26 | **Figure 35: Inheritance class diagram for the Hierarchy** |
| 27 | |||
| |
3.2 | 28 | === 8.2.2 Explanation of the Diagram === |
| |
1.1 | 29 | |
| |
3.2 | 30 | ==== 8.2.2.1 Narrative ==== |
| |
1.1 | 31 | |
| |
15.1 | 32 | 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 (% style="color:#e74c3c" %)Level(%%) is a //NameableArtefact// and therefore has an Id, multi-lingual name and multi-lingual description. A //HierachicalCode// is an //IdentifiableArtefact//. |
| |
1.1 | 33 | |
| |
15.1 | 34 | 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. |
| |
1.1 | 35 | |
| |
3.2 | 36 | ==== 8.2.2.2 Definitions ==== |
| |
1.1 | 37 | |
| |
15.1 | 38 | The definitions of the various classes, [[attributes>>doc:sdmx:Glossary 2\.1.Attribute.WebHome]], and associations are shown in the relationship section below. |
| |
1.1 | 39 | |
| |
3.2 | 40 | == 8.3 Relationship == |
| |
1.1 | 41 | |
| |
3.2 | 42 | === 8.3.1 Class Diagram === |
| |
1.1 | 43 | |
| |
10.3 | 44 | [[image:image62.png]] |
| 45 | |||
| |
1.1 | 46 | **Figure 36: Relationship class diagram of the Hierarchy** |
| 47 | |||
| |
3.2 | 48 | === 8.3.2 Explanation of the Diagram === |
| |
1.1 | 49 | |
| |
3.2 | 50 | ==== 8.3.2.1 Narrative ==== |
| |
1.1 | 51 | |
| |
15.1 | 52 | The basic principles of the [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] are: |
| |
1.1 | 53 | |
| |
15.1 | 54 | 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]]. |
| 55 | 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]]. | ||
| 56 | 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. | ||
| |
1.1 | 57 | |
| |
15.1 | 58 | A [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] can have formal (% style="color:#e74c3c" %)levels(%%) (hasFormalLevels="true"). However, even if hasFormalLevels="false" the [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] can still have one or more (% style="color:#e74c3c" %)Levels(%%) associated in order to document information about the HierarchicalCodes. |
| |
1.1 | 59 | |
| |
15.1 | 60 | 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 (% style="color:#e74c3c" %)Levels(%%). If hasFormalLevels="true" then the [[hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] is “(% style="color:#e74c3c" %)level(%%) based” where each (% style="color:#e74c3c" %)Level(%%) is a formal (% style="color:#e74c3c" %)Level(%%) 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 “(% style="color:#e74c3c" %)level(%%) based” [[hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] each HierarchicalCode is linked to the (% style="color:#e74c3c" %)Level(%%) in which it resides. It is expected that all HierarchicalCodes at the same hierarchic (% style="color:#e74c3c" %)level(%%) defined by the +parent/+child association will be linked to the same (% style="color:#e74c3c" %)Level(%%). Note that the +(% style="color:#e74c3c" %)level(%%) association need only be specified if the HierarchicalCode is at a different hierarchical (% style="color:#e74c3c" %)level(%%) (implied by the HierarchicalCode parent/child association) than the actual (% style="color:#e74c3c" %)Level(%%) in the (% style="color:#e74c3c" %)level(%%) [[hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] (implied by the (% style="color:#e74c3c" %)Level(%%) parent/child association). |
| |
1.1 | 61 | |
| |
15.1 | 62 | [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 (% style="color:#e74c3c" %)Level(%%), where (% style="color:#e74c3c" %)Levels(%%) are numbered consecutively starting with (% style="color:#e74c3c" %)level(%%) 1 at the highest (% style="color:#e74c3c" %)Level(%%)]. |
| |
1.1 | 63 | |
| |
15.1 | 64 | The (% style="color:#e74c3c" %)Level(%%) may have CodingFormat information defined (e.g. coding type at that (% style="color:#e74c3c" %)level(%%)). |
| |
1.1 | 65 | |
| |
15.1 | 66 | 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]]. |
| |
1.1 | 67 | |
| |
15.1 | 68 | ==== 8.3.2.2 ==== |
| |
1.1 | 69 | |
| |
15.1 | 70 | ==== Definitions ==== |
| 71 | |||
| |
3.3 | 72 | (% style="width:901.835px" %) |
| 73 | |**Class**|**Feature**|(% style="width:564px" %)**Description** | ||
| |
15.1 | 74 | |[[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]]|((( |
| |
1.1 | 75 | Inherits from: |
| 76 | //MaintainableArtefact// | ||
| |
15.1 | 77 | )))|(% style="width:564px" %)A [[classification>>doc:sdmx:Glossary 2\.1.Statistical Classification.WebHome]] structure arranged in (% style="color:#e74c3c" %)levels(%%) of detail from the broadest to the most detailed (% style="color:#e74c3c" %)level(%%). |
| |
3.3 | 78 | | |hasFormalLevels|(% style="width:564px" %)((( |
| |
15.1 | 79 | If “true”, this indicates a [[hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] where the structure is arranged in (% style="color:#e74c3c" %)levels(%%) of detail from the broadest to the most detailed (% style="color:#e74c3c" %)level(%%). |
| |
1.1 | 80 | |
| |
15.1 | 81 | 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 (% style="color:#e74c3c" %)level(%%) structure. |
| |
1.1 | 82 | ))) |
| |
15.1 | 83 | | |+[[codes>>doc:sdmx:Glossary 2\.1.Code.WebHome]]|(% style="width:564px" %)Association to the top-(% style="color:#e74c3c" %)level(%%) [[Hierarchical Codes>>doc:sdmx:Glossary 2\.1.Hierarchical code.WebHome]] in the [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]]. |
| 84 | | |+(% style="color:#e74c3c" %)level|(% style="width:564px" %)Association to the top (% style="color:#e74c3c" %)Level(%%) in the [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]]. | ||
| 85 | |(%%)(% style="color:#e74c3c" %)Level|((( | ||
| |
1.1 | 86 | Inherits from |
| 87 | //NameableArtefact// | ||
| |
3.3 | 88 | )))|(% style="width:564px" %)((( |
| |
15.1 | 89 | In a “(% style="color:#e74c3c" %)level(%%) 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 (% style="color:#e74c3c" %)level(%%) of the [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]]. |
| 90 | 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 (% style="color:#e74c3c" %)level(%%). | ||
| |
1.1 | 91 | ))) |
| |
15.1 | 92 | | |+codeFormat|(% style="width:564px" %)Association to the [[Coding Format>>doc:sdmx:Glossary 2\.1.Coding format.WebHome]]. |
| 93 | | |+child|(% style="width:564px" %)Association to a child (% style="color:#e74c3c" %)Level(%%) of (% style="color:#e74c3c" %)Level(%%). | ||
| 94 | |CodingFormat| |(% style="width:564px" %)Specifies format information for the [[codes>>doc:sdmx:Glossary 2\.1.Code.WebHome]] at this (% style="color:#e74c3c" %)level(%%) in the [[hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] such as whether the [[codes>>doc:sdmx:Glossary 2\.1.Code.WebHome]] at the (% style="color:#e74c3c" %)level(%%) are alphabetic, numeric or alphanumeric and the [[code>>doc:sdmx:Glossary 2\.1.Code.WebHome]] length. | ||
| 95 | |HierarchicalCode| |(% style="width:564px" %)A hierarchic structure of [[code>>doc:sdmx:Glossary 2\.1.Code.WebHome]] references. | ||
| |
3.3 | 96 | | |validFrom|(% style="width:564px" %)Date from which the construct is valid |
| 97 | | |validTo|(% style="width:564px" %)Date from which construct is superseded. | ||
| |
15.1 | 98 | | |+[[code>>doc:sdmx:Glossary 2\.1.Code.WebHome]]|(% 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]]. |
| 99 | | |+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]]. | ||
| 100 | | |+(% style="color:#e74c3c" %)level|(% style="width:564px" %)Association to a (% style="color:#e74c3c" %)Level(%%) where (% style="color:#e74c3c" %)levels(%%) have been defined for the [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]]. | ||
| 101 | |[[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]]. | ||
| 102 | | |/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]]. | ||
| 103 | |[[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]]. | ||
| |
1.1 | 104 | |HierarchyAssociation|((( |
| 105 | Inherits from: | ||
| |
5.1 | 106 | //MaintainableArtefact// |
| |
15.1 | 107 | )))|(% 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. |
| |
3.3 | 108 | | |+contextObject|(% style="width:564px" %)The context within which the association is performed. |
| |
15.1 | 109 | | |+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]]. |
| 110 | | |+linkedHierarchy|(% style="width:564px" %)Associated the [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]]. |