The S100 standard defines an international framework for the exchange of hydrographic and maritime data. Two of the most common encodings used within this framework are GML (Geography Markup Language) and HDF5 (Hierarchical Data Format version5). While the underlying models differXMLbased for GML and binary hierarchical for HDF5both require rigorous validation to ensure data integrity, interoperability, and compliance with regulatory expectations.
This page outlines a set of generic validation checks that can be applied to either format, highlights formatspecific considerations, and provides guidance for building automated validation pipelines.
GML is an XML grammar designed to encode geographic features, geometry, and associated metadata. Within the S100 suite, GML files are typically packaged as .gml or .xml documents that reference a set of XML Schema Definition (XSD) files defining the allowed structure, data types, and constraints.
Key characteristics:
gml:ReferenceSystem definition.HDF5 stores data in a selfdescribing, portable binary format. The format uses groups (similar to directories) and datasets (arrays, tables, images, etc.) that can contain attributes. Within S100, HDF5 files are used for large raster or gridded data such as bathymetry, hydrography, or environmental layers.
Important traits:
GML: Validate the XML document against the official S100 XSD set using an XML validator (e.g., xmllint, Xerces, or Pythons lxml). The validator must be run with namespace awareness and must resolve any xs:import statements.
HDF5: Verify that required groups and datasets exist. A simple schema can be expressed as a JSON or YAML description that lists expected paths, data types, and required attributes. Tools such as h5check or custom scripts using the h5py library can perform this check.
Ensure that the actual data type of each element matches the declared type. For GML, this means checking that numeric values conform to xsd:decimal or xsd:integer and that strings obey any pattern constraints. In HDF5, confirm that dataset dtype matches the specification (e.g., float32 for depth values) and that attribute types are consistent.
Many S100 attributes have defined min/max ranges or enumerated value sets. Validation should:
featureType) contain only values listed in the corresponding code list.For both formats, the CRS must be explicitly declared and must be a recognized EPSG identifier. Validation steps:
gml:srsName in GML or the crs attribute in HDF5).The specification often defines mandatory attributes and limits on repetitions. Validation must:
gml:id, featureCode) are present. Detect truncated or corrupted files. For XML, check that the document parses without errors. For HDF5, use the h5check utility or the HDF5 librarys builtin validation function to ensure the files internal checksum is valid.
S100 datasets may reference external resources (e.g., image files, auxiliary tables). Validation should confirm that:
xlink:href references in GML resolve to reachable URIs. Attributes that describe physical quantities must carry unit specifications, typically using uom (unit of measure) URIs. Validation checks include:
Large S100 products often require efficient access. While not strictly a validation step, checking that:
Both formats rely on accompanying metadata (ISO19115/19139 for GML; HDF5 attributes for datasets). Validation should verify that required metadata elementssuch as title, date, responsibleParty, and lineageare present and populated.
| Check Category | GML Implementation | HDF5 Implementation |
|---|---|---|
| Schema Validation | XML validator against S100 XSD | JSON/YAML schema applied with h5py |
| DataType Consistency | XPath type checks; XSD facets | Dataset dtype inspection |
| Range/Enumeration | Pattern / enumeration facets in XSD | Python list of allowed values compared to attribute values |
| CRS Validation | gml:srsName vs EPSG database | Attribute crs vs EPSG database |
| CrossReference | Resolve xlink:href | Verify external links using h5py.File(..., libver='latest') |
lxml (Python), xercesc, or libxml2 for GML; use h5py and the HDF5 C library for binary checks.