Closed cmungall closed 5 months ago
Notes:
minimum_number_dimensions
is 1, maximum_number_dimensions
is Infinity.minimum_number_dimensions
without maximum_number_dimensions
. We have a use case for a min without a max, but I cannot think of one for a max without a min.minimum_cardinality
and maximum_cardinality
. Maybe we can omit them and add them later if there is a need? I am concerned about adding features to the metamodel that are useless but need to be supported for a long time to avoid breaking backwards compatibility.Some useful validation checks:
dimensions_info
must not exceed maximum_number_of_dimensions
dimension_index
must not exceed maximum_number_of_dimensions - 1
dimension_index
must be unique across dimensions_info
itemsarray_info
exists, then multivalued
must be True (if we allow scalar arrays, then this is no longer always true)minimum_number_dimensions
<= maximum_number_dimensions
exact_number_dimensions
and minimum_number_dimensions
or both exact_dimensions
and maximum_number_dimensions
minimum_number_dimensions
, exact_number_dimensions
, maximum_number_dimensions
all > 0minimum_cardinality
<= maximum_cardinality
exact_cardinality
and minimum_cardinality
or both exact_cardinality
and maximum_cardinality
minimum_cardinality
, exact_cardinality
, maximum_cardinality
all > 0for posterity, archived version of matrix of tradeoffs to be added to consolidated docs later, along with @rly 's notes and examples :)
live: https://wiki.jon-e.net/LinkML_Arrays archive: https://web.archive.org/web/20240207234701/https://wiki.jon-e.net/LinkML_Arrays
See
This introduces first-class array support into LinkML.
A minimal example would be:
The native serialization of this in json/yaml will be a LoLoL. Using linkml-xarrays it will be possible to serialize using hdf5/zarr/etc.
The corresponding nptyping type would be
NDArray[Shape["*, *, *"], Float]
.(note: modelers will want the ability to use ctypes but this is orthogonal)
Note that this does not force any metadata on the array; we are deferring on the datamodel for what is equivalent to xarray DataArrays, these will be supported via
implements
for now and first-class incorporation in a future version. This will allow binding between axes are other LinkML arrays.Minimal metadata can be introduced via naming the axes
The corresponding nptyping type would be
NDArray[Shape["* x, * y, * z"], Float]
.The shape can be further constrained; imagine an RGB matrix with coords x, y, and a length 3 r/g/b:
corresponds to
NDArray[Shape["* x, * y, 3 rgb"]
For now if you do want to bind dimensions to additional metadata this can be done via annotations: