19.5.5 Attributes in HDF5

Topic Version2Published04/16/2018
For StandardPRODML v2.0
  • Each HDF group and dataset has a corresponding XML object. Each of these XML objects may contain sub-elements and attributes that are either defined locally or inherited from more abstract types. All of these sub-elements and attributes of the XML object must be copied to the HDF group if they meet ONE of following criteria:
    • XML element or attribute is derived from XSD primitive type (e.g. “xs:long”, “xs:boolean”). The name of the element/attribute is used for the HDF attribute. For the corresponding HDF data types, see the next section.
  • For each HDF Dataset, if there is a DasExternalDatasetPart referring to it (most do, CalibrationDataPoints does not, see Section 19.8.5 DAS External Dataset Part), the sub-elements and attributes of the DasExternalDatasetPart object must also be copied to the HDF Dataset as attributes. The criteria specified in the previous bullet point also apply. However, the element “PathInExternalFile” must be skipped because it duplicates the HDF path for the dataset.
  • Where the above criteria are met:
    • If an attribute is mandatory in the XML schema, it is also mandatory in the HDF and it must have a value. All mandatory attributes musts have a valid entry (which means either with a valid attribute value or a defined NULL value). Non-mandatory attributes (marked in the attached Schema with [0..1]) or groups (marked with 0..*) must be omitted from the XML or HDF files if they are not used (i.e., empty).
    • When the attribute’s maximum number of occurrence is 1, the HDF attribute must be a scalar.
    • When the attribute’s maximum number of occurrence is larger than 1 (e.g., unbound), the HDF attribute must be an array, even if there is only one item. For example, “Dimensions” is presented as an array of strings in the worked example.

The optionality and requirements for HDF5 groups above means, in practice, it is allowable to not include groups like raw, processed, spectra and FBE. However, in groups like DasAcquisition, attributes that are marked as mandatory in optional groups that are used (such as NumberOfLoci, RawDataTime, etc.) must always be properly populated if the associated group is used.