Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

array: null for any shaped arrays not allowed #187

Open
sneakers-the-rat opened this issue Feb 22, 2024 · 2 comments
Open

array: null for any shaped arrays not allowed #187

sneakers-the-rat opened this issue Feb 22, 2024 · 2 comments

Comments

@sneakers-the-rat
Copy link
Contributor

sneakers-the-rat commented Feb 22, 2024

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:

range: array_expression

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
@rly
Copy link
Contributor

rly commented Mar 18, 2024

@sneakers-the-rat can we close this? I believe this was discussed in #189 or do we want to allow null as an option in addition to {} and unset?

@sneakers-the-rat
Copy link
Contributor Author

i think we can close this if we make a separate issue for Schemaview should be able to determine whether a value is unset or explicitly null - discussion is here: https://github.com/orgs/linkml/discussions/1975 but imo regardless if we allow it i think we should be able to check (if we choose not to allow explicit nulls then we would need to check for them anyway ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants