linkml-model icon indicating copy to clipboard operation
linkml-model copied to clipboard

`array: null` for any shaped arrays not allowed

Open sneakers-the-rat opened this issue 4 months ago • 2 comments

I believe we arrived at a place where this would represent an array with any shape:

classes:
  MyClass:
    attributes:
      an_array:
        range: int
        array:

but currently the range of the array slot is a non-nullable array_expression: https://github.com/linkml/linkml-model/blob/e53a511e4e0fe7c403747f18de77553d42365feb/linkml_model/model/schema/meta.yaml#L1430

edit: wait obviously you can make metamodel attributes optional too my bad. i'll PR

Not sure how to express this in the schema, my first instinct would be something like this:

any_of:
- range: array_expression
- range: null

but I'm not sure if that's valid.

Another option to be able to differentiate between an explicit null like that and an any shaped array might be to make the syntax

array: Any

which would make the metamodel more straightforward:

any_of:
- range: array_expression
- range: Anything

sneakers-the-rat avatar Feb 22 '24 07:02 sneakers-the-rat