You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In HDF5, there are a few different mechanisms used to refer to other data in an HDF5 file from a location other than where they are stored.
For example, HDF5 supports different types of links like hard links, soft links, and external links. These are analogous to links on the filesystem with the exception of external links, which constitute a soft link to a different HDF5 file. These can refer to groups or datasets in HDF5.
Also HDF5 supports a couple kinds of references such as object references and region references. These refer simply to datasets or some subselection of datasets.
I like and use the feature of hdf5 to use object references. Instead of using symbolic links would it be possible to create a "virtual" Group, a directory or a data storage, which does contain references (path) to the effective Group members. Instead of using the file system the reference is in a lets say .vgroup file. May be an easy and flexible approach.
ASDF currently doesn't support chunking however, which would make Zarr a good addition to ASDF. The original issue points out that integrating with Zarr would benefit parallel computation with ASDF (e.g. with Dask).
Is there any update on this issue? It would be great to be able to refer to parts of a larger array as a new dataset, without having to copy the data or having to create your own parsing code.
From our view we would like to start working on this for ASDF in a couple months (after a new staff member starts). If someone is willing to help, even better.
Any news on this? I'm currently trying to plan out how to use zarr for electrophysiology datasets. These data can have repeated stimulus patterns and identical time arrays for which shared arrays (see #690) and/or groups seem like they could be really useful.
But they do not provide anything like internal links - I've raised earth-mover/icechunk#747 to discuss the idea of implementing that through icechunk manifests.
Also separately xarray.DataTree has "inherited coordinates", which allows analysis code to have coordinate variables defined once and automatically made available amongst many child datasets.
for me the big question is which level of the stack should support links / references as first-class entities, and what the APIs would look like.
The key: value store abstraction is a great target for the implementation of links, but in order to prevent pathologies like circular references, we would probably need to impose zarr-format-aware rules at store definition time -- we don't want to a group to contain its own ancestors via links, but for array chunks, there's no possibility of recursion. So the difference between a safe link and an unsafe link requires knowing the elements of the zarr hierarchy that are being linked, which is a higher level of abstraction than the store API.
Maybe simpler to detect cyclic paths at runtime, and refuse to enter them with an exception. In any case, we don't have a clear policy for handling links in our local file system store, so I opened an issue about that: #4126
Whatever the policy, it should definitely allow referencing ancestor arrays (e.g., like xarray.DataTree inherited coordinates). Indeed, I see ancestor array reference as likely the primary use case.
at the moment I don't see a compelling reason why links to arbitrary arrays would be problematic, as long as everything is scoped to the file system. but this might also be something users would want to opt into explicitly. There are also questions about what other zarr implementations support -- if tensorstore and zarrs support following symlinks, then that's a very compelling reason for us to adopt it. if they don't, then we risk generating zarr data on the file system that can't be accessed consistently across implementations, and we want to avoid this.
Activity
amkigit commentedon Oct 1, 2019
I like and use the feature of hdf5 to use object references. Instead of using symbolic links would it be possible to create a "virtual" Group, a directory or a data storage, which does contain references (path) to the effective Group members. Instead of using the file system the reference is in a lets say .vgroup file. May be an easy and flexible approach.
NumesSanguis commentedon Dec 12, 2019
Someone recently made an issue over at ASDF (Advanced Scientific Data Format) to integrate with Zarr: asdf-format/asdf#718
ASDF supports:
ASDF currently doesn't support chunking however, which would make Zarr a good addition to ASDF. The original issue points out that integrating with Zarr would benefit parallel computation with ASDF (e.g. with Dask).
alimanfoo commentedon Dec 12, 2019
Thanks @NumesSanguis for making the connection, very interesting.
perrygreenfield commentedon Dec 12, 2019
Thanks @NumesSanguis from the ASDF side as well. This is something we want to take a serious look at.
Cadair commentedon Dec 12, 2019
Thanks for making the link @NumesSanguis once we have wrapped our heads around things a little more I might open some issues here 😀
NumesSanguis commentedon May 8, 2020
Is there any update on this issue? It would be great to be able to refer to parts of a larger array as a new dataset, without having to copy the data or having to create your own parsing code.
perrygreenfield commentedon May 8, 2020
From our view we would like to start working on this for ASDF in a couple months (after a new staff member starts). If someone is willing to help, even better.
marcel-goldschen-ohm commentedon Jun 29, 2023
Any news on this? I'm currently trying to plan out how to use zarr for electrophysiology datasets. These data can have repeated stimulus patterns and identical time arrays for which shared arrays (see #690) and/or groups seem like they could be really useful.
TomNicholas commentedon Feb 18, 2025
Note that VirtualiZarr + Icechunk together give something similar to external links (we call them "virtual chunks").
But they do not provide anything like internal links - I've raised earth-mover/icechunk#747 to discuss the idea of implementing that through icechunk manifests.
TomNicholas commentedon Feb 18, 2025
Also separately
xarray.DataTreehas "inherited coordinates", which allows analysis code to have coordinate variables defined once and automatically made available amongst many child datasets.d-v-b commentedon Jul 8, 2026
for me the big question is which level of the stack should support links / references as first-class entities, and what the APIs would look like.
The key: value store abstraction is a great target for the implementation of links, but in order to prevent pathologies like circular references, we would probably need to impose zarr-format-aware rules at store definition time -- we don't want to a group to contain its own ancestors via links, but for array chunks, there's no possibility of recursion. So the difference between a safe link and an unsafe link requires knowing the elements of the zarr hierarchy that are being linked, which is a higher level of abstraction than the store API.
Maybe simpler to detect cyclic paths at runtime, and refuse to enter them with an exception. In any case, we don't have a clear policy for handling links in our local file system store, so I opened an issue about that: #4126
marcel-goldschen-ohm commentedon Jul 8, 2026
Whatever the policy, it should definitely allow referencing ancestor arrays (e.g., like
xarray.DataTreeinherited coordinates). Indeed, I see ancestor array reference as likely the primary use case.d-v-b commentedon Jul 8, 2026
at the moment I don't see a compelling reason why links to arbitrary arrays would be problematic, as long as everything is scoped to the file system. but this might also be something users would want to opt into explicitly. There are also questions about what other zarr implementations support -- if tensorstore and zarrs support following symlinks, then that's a very compelling reason for us to adopt it. if they don't, then we risk generating zarr data on the file system that can't be accessed consistently across implementations, and we want to avoid this.