SDD Primer Home   Index

SDD Part 0: Introduction and Primer to the SDD Standard

3.4.2 Arranging entities into hierarchies (trees)

Class entities, particularly in taxonomy, are often conveniently arranged into nested hierarchies. Species are nested in genera, genera in families, families in Orders etc.

In SDD documents class entities defined in the <Entities> section may optionally be arranged into a hierarchy or tree to reflect the taxonomic hierarchy, or for other reasons. For more information on defining entities, see the topic Specifying the list of entities.

Note that object entities are not included in entity hierarchies: instead, object entities (e.g. specimens) are referred to a class entity (e.g. a species), and may be regarded as belonging in a class hierarchy to their parent entity.

Example 3.4.2.1 arranges a number of defined class entities into a class hierarchy.

Example 3.4.2.1 - Arranging defined class entities into a class hierarchy

<Entities>
  <ClassHierarchies>
    <ClassHierarchy key="1">
        <FreeFormDescription>Default taxon hierarchy</FreeFormDescription>
        <Node>
            <Class ref="4"/>
            <Node>
                <Class ref="1"/>
            </Node>
            <Node>
                <Class ref="3"/>
            </Node>
            <Node>
                <Node>
                  <Class ref="5">
                </Node>
                <Node>
                  <Class ref="8">
                </Node>
            </Node>
          </Node>
    </ClassHierarchy>
  </ClassHierarchies>
</Entities>
 

The hierarchy is specified using a <ClassHierarchy> element of the <ClassHierarchies> collection. Note that SDD currently supports only a single class hierarchy per document, but future versions will support multiple hierarchies.

The <ClassHierarchy> element must be furnished with a Key value (e.g. <ClassHierarchy key="1">). This is used to refer to the hierarchy elsewhere in the SDD document. Key values must be positive integers.

The <FreeformDescription> element is used to provide a text description of the hierarchy by which it can be listed and described by a consuming application.

The hierarchy is created using <Node> elements. Each <Node> element may contain zero or more child <Node> elements, and/or a <Class> element that refers to a defined class entity using the ref attribute (which refers to the class entity's key value).

A <Node> element that contains a <Class> element is labelled with the name of the class entity referred to; a <Node> element that lacks a <Class> element is anonymous.

If the class entities referred to in Example 3.4.2.1 have the following labels:

Then the example defines the following tree

    ┬─ Genus 1
    ├──
Species 1
    ├──
Species 2
    └┬──
Species 3
     └──
Species 5

KRT Last Edit: 31 Dec 03