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 | |
| |
18.1 | 9 | Note that a [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] is not necessarily a balanced tree. A balanced tree is where 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]]. |
| |
1.1 | 10 | |
| |
15.1 | 11 | The principal features of the [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] are: |
| |
1.1 | 12 | |
| |
15.2 | 13 | 1. A [[child>>doc:IMElements.child.WebHome]] code can have more than one [[parent>>doc:IMElements.parent.WebHome]]. |
| 14 | 1. There can be more than one code that has no [[parent>>doc:IMElements.parent.WebHome]] (i.e. more than one “root node”). | ||
| 15 | 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 | 16 | 1. [[Hierarchies>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] may be associated to the structures they refer to, via the HierarchyAssociation. |
| |
1.1 | 17 | |
| |
3.2 | 18 | == 8.2 Inheritance == |
| |
1.1 | 19 | |
| |
3.2 | 20 | === 8.2.1 Class Diagram === |
| |
1.1 | 21 | |
| |
10.2 | 22 | [[image:image61.png]] |
| 23 | |||
| |
1.1 | 24 | **Figure 35: Inheritance class diagram for the Hierarchy** |
| 25 | |||
| |
3.2 | 26 | === 8.2.2 Explanation of the Diagram === |
| |
1.1 | 27 | |
| |
3.2 | 28 | ==== 8.2.2.1 Narrative ==== |
| |
1.1 | 29 | |
| |
16.1 | 30 | The [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] and //HierarchyAssociation// inherit from //[[MaintainableArtefact>>doc:IMElements.AnnotableArtefact.IdentifiableArtefact.NameableArtefact.VersionableArtefact.MaintainableArtefact.WebHome]]// and thus have identification, naming, versioning and a [[maintenance agency>>doc:sdmx:Glossary 2\.1.Maintenance agency.WebHome]]. The Level is a //[[NameableArtefact>>doc:IMElements.AnnotableArtefact.IdentifiableArtefact.NameableArtefact.WebHome]]// and therefore has an Id, multi-lingual [[name>>doc:IMElements.name.WebHome]] and multi-lingual [[description>>doc:IMElements.description.WebHome]]. A //HierachicalCode// is an //[[IdentifiableArtefact>>doc:IMElements.AnnotableArtefact.IdentifiableArtefact.WebHome]]//. |
| |
1.1 | 31 | |
| |
16.1 | 32 | It is important to understand that the Codes 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 | 33 | |
| |
3.2 | 34 | ==== 8.2.2.2 Definitions ==== |
| |
1.1 | 35 | |
| |
15.1 | 36 | 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 | 37 | |
| |
3.2 | 38 | == 8.3 Relationship == |
| |
1.1 | 39 | |
| |
3.2 | 40 | === 8.3.1 Class Diagram === |
| |
1.1 | 41 | |
| |
10.3 | 42 | [[image:image62.png]] |
| 43 | |||
| |
1.1 | 44 | **Figure 36: Relationship class diagram of the Hierarchy** |
| 45 | |||
| |
3.2 | 46 | === 8.3.2 Explanation of the Diagram === |
| |
1.1 | 47 | |
| |
3.2 | 48 | ==== 8.3.2.1 Narrative ==== |
| |
1.1 | 49 | |
| |
15.1 | 50 | The basic principles of the [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] are: |
| |
1.1 | 51 | |
| |
16.1 | 52 | 1. The [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] is a specification of the [[structure>>doc:IMElements.structure.WebHome]] of the Codes. |
| 53 | 1. The Codes 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>>doc:IMElements.references.WebHome]] to Codes 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 is specified in HierarchicalCode. This [[references>>doc:IMElements.references.WebHome]] the [[Code>>doc:IMElements.AnnotableArtefact.IdentifiableArtefact.NameableArtefact.Item.Code.WebHome]] and its immediate [[child>>doc:IMElements.child.WebHome]] HierarchicalCodes. | ||
| |
1.1 | 55 | |
| |
16.1 | 56 | A [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] can have formal levels (hasFormalLevels="true"). However, even if hasFormalLevels="false" the [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] can still have one or more Levels associated in order to document information about the HierarchicalCodes. |
| |
1.1 | 57 | |
| |
16.1 | 58 | If hasFormalLevels="false" the [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] is “[[value>>doc:IMElements.value.WebHome]] based” comprising a [[hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] of codes with no formal Levels. If hasFormalLevels="true" then the [[hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] is “level based” where each Level is a formal 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 “level based” [[hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] each HierarchicalCode is linked to the Level in which it resides. It is expected that all HierarchicalCodes at the same hierarchic level defined by the +[[parent>>doc:IMElements.parent.WebHome]]/+[[child>>doc:IMElements.child.WebHome]] association will be linked to the same Level. Note that the +level association need only be specified if the HierarchicalCode is at a different hierarchical level (implied by the HierarchicalCode [[parent>>doc:IMElements.parent.WebHome]]/[[child>>doc:IMElements.child.WebHome]] association) than the actual Level in the level [[hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] (implied by the Level [[parent>>doc:IMElements.parent.WebHome]]/[[child>>doc:IMElements.child.WebHome]] association). |
| |
1.1 | 59 | |
| |
16.1 | 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, where Levels are numbered consecutively starting with level 1 at the highest Level]. |
| |
1.1 | 61 | |
| |
16.1 | 62 | The Level may have CodingFormat information defined (e.g. coding [[type>>doc:IMElements.type.WebHome]] at that level). |
| |
1.1 | 63 | |
| |
16.1 | 64 | A HierarchyAssociation links an [[IdentifiableArtefact>>doc:IMElements.AnnotableArtefact.IdentifiableArtefact.WebHome]] (+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:IMElements.AnnotableArtefact.IdentifiableArtefact.Component.DimensionComponent.Dimension.WebHome]] in the context of a [[Dataflow>>doc:IMElements.AnnotableArtefact.IdentifiableArtefact.NameableArtefact.VersionableArtefact.MaintainableArtefact.StructureUsage.Dataflow.WebHome]]. |
| |
1.1 | 65 | |
| |
16.1 | 66 | ==== 8.3.2.2 Definitions ==== |
| |
1.1 | 67 | |
| |
3.3 | 68 | (% style="width:901.835px" %) |
| 69 | |**Class**|**Feature**|(% style="width:564px" %)**Description** | ||
| |
15.1 | 70 | |[[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]]|((( |
| |
1.1 | 71 | Inherits from: |
| |
16.1 | 72 | //[[MaintainableArtefact>>doc:IMElements.AnnotableArtefact.IdentifiableArtefact.NameableArtefact.VersionableArtefact.MaintainableArtefact.WebHome]]// |
| 73 | )))|(% style="width:564px" %)A [[classification>>doc:sdmx:Glossary 2\.1.Statistical Classification.WebHome]] structure arranged in levels of detail from the broadest to the most detailed level. | ||
| |
3.3 | 74 | | |hasFormalLevels|(% style="width:564px" %)((( |
| |
16.1 | 75 | If “true”, this indicates a [[hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] where the structure is arranged in levels of detail from the broadest to the most detailed level. |
| |
1.1 | 76 | |
| |
16.1 | 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 structure. |
| |
1.1 | 78 | ))) |
| |
16.1 | 79 | | |+codes|(% style="width:564px" %)Association to the top-level [[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 in the [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]]. | ||
| 81 | |Level|((( | ||
| |
1.1 | 82 | Inherits from |
| |
16.1 | 83 | //[[NameableArtefact>>doc:IMElements.AnnotableArtefact.IdentifiableArtefact.NameableArtefact.WebHome]]// |
| |
3.3 | 84 | )))|(% style="width:564px" %)((( |
| |
16.1 | 85 | In a “level based” [[hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] this describes a group of Codes which are characterised by homogeneous coding, and where the parent of each Code in the group is at the same higher level 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. | ||
| |
1.1 | 87 | ))) |
| |
15.1 | 88 | | |+codeFormat|(% style="width:564px" %)Association to the [[Coding Format>>doc:sdmx:Glossary 2\.1.Coding format.WebHome]]. |
| |
16.1 | 89 | | |+[[child>>doc:IMElements.child.WebHome]]|(% style="width:564px" %)Association to a child Level of Level. |
| 90 | |CodingFormat| |(% style="width:564px" %)Specifies format information for the codes at this level in the [[hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]] such as whether the codes at the level are alphabetic, numeric or alphanumeric and the code length. | ||
| 91 | |HierarchicalCode| |(% style="width:564px" %)A hierarchic structure of code references. | ||
| 92 | | |[[validFrom>>doc:IMElements.validFrom.WebHome]]|(% style="width:564px" %)Date from which the construct is valid | ||
| 93 | | |[[validTo>>doc:IMElements.validTo.WebHome]]|(% style="width:564px" %)Date from which construct is superseded. | ||
| 94 | | |+code|(% style="width:564px" %)Association to the Code that is used at the specific point in the [[hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]]. | ||
| 95 | | |+[[child>>doc:IMElements.child.WebHome]]|(% style="width:564px" %)Association to a child Code in the [[hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]]. | ||
| 96 | | |+level|(% style="width:564px" %)Association to a Level where levels have been defined for the [[Hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]]. | ||
| 97 | |[[Code>>doc:IMElements.AnnotableArtefact.IdentifiableArtefact.NameableArtefact.Item.Code.WebHome]]| |(% style="width:564px" %)The Code to be used at this point in the [[hierarchy>>doc:sdmx:Glossary 2\.1.Hierarchy.WebHome]]. | ||
| 98 | | |/[[items>>doc:IMElements.items.WebHome]]|(% style="width:564px" %)Association to the [[Code list>>doc:sdmx:Glossary 2\.1.Code list.WebHome]] containing the Code. | ||
| 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. | ||
| |
1.1 | 100 | |HierarchyAssociation|((( |
| 101 | Inherits from: | ||
| |
16.1 | 102 | //[[MaintainableArtefact>>doc:IMElements.AnnotableArtefact.IdentifiableArtefact.NameableArtefact.VersionableArtefact.MaintainableArtefact.WebHome]]// |
| |
15.1 | 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. |
| |
3.3 | 104 | | |+contextObject|(% style="width:564px" %)The context within which the association is performed. |
| |
15.1 | 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]]. |