Electronic Data Interchange | |
The Composite Element Data Structure (UN/EDIFACT) |
The Composite Element is a unit of information where the data is represented by multiple and indivisible collection of values. The collection of values are in a collection of component elements that are closely interrelated whereby the values by themselves lose meaning without the other values in the collection. For example, the semantic use of measurement requires the use of (a) a decimal value, as well as (b) the unit of measure. The component elements are in a predefined order.
The composite element has the following properties:
In the context of a data segment, the composite element has the following additional properties:
Component Elements
A composite element (sub element) contains a collection of component elements. The component elements are fundamentally the same as the simple data element, only component elements have the composite element as the parent; simple data elements have the data segment as the parent. Also, component elements cannot have repeating instances under the composite element.
All component elements in the data segment can have a mandatory (M), or optional (O,C) requirement. Additionally, an optional element may have a relational, or dependency, requirement where its required presence is dependent on the presence of other elements in the same collection. If this relational condition exists, then a syntax rule, or dependency note, that states the relationship of the elements, is included in the composite element definition.
It is possible to have all component elements in the composite to have an optional requirement. If there is no data in the elements then the composite element is considered empty, and the entire composite element is ommitted from the data stream. A composite element is considered present only if one component element is present; a component element is considered present only if its value contain at least one character.
It is also possible to have all component elements in the composite to have a mandatory requirement. If some elements are mandatory, these elements will normally have a position at the beginning of the collection. If an optional data composite element is present, then all mandatory component elements must be present as well. If all optional and/or mandatory component elements are empty in a mandatory composite element, the composite element is omitted completely. However, it is an error at the mandatory component element if its parent composite element, whose presence has been determined to be mandatory, is omitted (not present); in this case, there are two errors: the missing component element, and the missing composite element. A mandatory composite element is mandatory only if its parent data segment is mandatory or is present.
An empty component element contain no character in its value. In the data stream they are completely omitted including their component separators that follow them if they occur at the end of the composite element. If the empty element is followed by a non-empty element then its absence is indicated by the component separator that follow it, thus preserving the positions of non-empty values in the composite element's data stream.
Component elements are separated by a component separator character.