Please, help us to better know about our user community by answering the following short survey: https://www.hdfgroup.org/
HDF5  1.12.1
H5M

Map Interface.

The interface can only be used with the HDF5 VOL connectors that implement map objects. The native HDF5 library does not support this feature.

While the HDF5 data model is a flexible way to store data, some applications require a more general way to index information. HDF5 effectively uses key-value stores internally for a variety of purposes, but it does not expose a generic key-value store to the API. The Map APIs provide this capability to the HDF5 applications in the form of HDF5 map objects. These Map objects contain application-defined key-value stores, to which key-value pairs can be added, and from which values can be retrieved by key.

HDF5 VOL connectors with support for map objects:

Example:
hid_t file_id, fapl_id, map_id, vls_type_id;
const char *names[2] = ["Alice", "Bob"];
uint64_t IDs[2] = [25385486, 34873275];
uint64_t val_out;
<HDF5 VOL setup code ....>
vls_type_id = H5Tcopy(H5T_C_S1);
H5Tset_size(vls_type_id, H5T_VARIABLE);
file_id = H5Fcreate("file.h5", H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
map_id = H5Mcreate(file_id, "map", vls_type_id, H5T_NATIVE_UINT64, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Mput(map_id, vls_type_id, &names[0], H5T_NATIVE_UINT64, &IDs[0], H5P_DEFAULT);
H5Mput(map_id, vls_type_id, &names[1], H5T_NATIVE_UINT64, &IDs[1], H5P_DEFAULT);
H5Mget(map_id, vls_type_id, &names[0], H5T_NATIVE_UINT64, &val_out, H5P_DEFAULT);
if(val_out != IDs[0])
ERROR;
H5Mclose(map_id);
H5Tclose(vls_type_id);
H5Fclose(file_id);
H5Tcopy
hid_t H5Tcopy(hid_t type_id)
Copies an existing datatype.
H5T_C_S1
#define H5T_C_S1
Definition: H5Tpublic.h:525
hid_t
int64_t hid_t
Definition: H5Ipublic.h:61
H5Fclose
herr_t H5Fclose(hid_t file_id)
Terminates access to an HDF5 file.
H5Tset_size
herr_t H5Tset_size(hid_t type_id, size_t size)
Sets size for a datatype.
H5T_VARIABLE
#define H5T_VARIABLE
Definition: H5Tpublic.h:248
H5P_DEFAULT
#define H5P_DEFAULT
Definition: H5Ppublic.h:103
H5Tclose
herr_t H5Tclose(hid_t type_id)
Releases a datatype.
H5F_ACC_TRUNC
#define H5F_ACC_TRUNC
Definition: H5Fpublic.h:52
H5Fcreate
hid_t H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id)
Creates an HDF5 file.
H5T_NATIVE_UINT64
#define H5T_NATIVE_UINT64
Definition: H5Tpublic.h:1037