h5rdmtoolbox.ld.hdf2jsonld

Contents

h5rdmtoolbox.ld.hdf2jsonld#

h5rdmtoolbox.ld.hdf2jsonld(filename, metadata_filename=None, context=None, structural=True, contextual=True, indent=2, file_uri=None, skipND=1)[source]#

Export HDF5 file metadata to JSON-LD format.

Converts HDF5 file metadata to a JSON-LD file, including both structural RDF (groups, datasets, attributes) and contextual RDF (semantic mappings).

Parameters:
  • filename (Union[str, pathlib.Path]) – Path to the HDF5 file.

  • metadata_filename (Optional[Union[str, pathlib.Path]], default None) – Output path for the JSON-LD file. If None, uses the HDF5 filename with .jsonld extension.

  • context (Optional[dict], default None) – Additional JSON-LD context definitions.

  • structural (bool, default True) – Include structural RDF from HDF5 hierarchy.

  • contextual (bool, default True) – Include contextual RDF from attribute mappings.

  • indent (int, default 2) – JSON indentation level.

  • file_uri (Optional[str], default None) – Base URI for the file resources.

  • skipND (Optional[int], default 1) – Number of dimensions to skip for nested data.

Returns:

pathlib.Path – Path to the generated JSON-LD file.