feat(openenum): add is_open boolean slot to enum expressions - #261
feat(openenum): add is_open boolean slot to enum expressions#261noelmcloughlin wants to merge 4 commits into
Conversation
4d688c8 to
19a714c
Compare
|
The basic idea makes total sense to me. I just wonder if we want to have a single way of declaring this across the few places we want similar behavior - e.g.
Basically I am in favor of this but just wondering if we want to have a similar mechanism/pattern across all "openness" specs, or if there is a reason this one should be a boolean only |
|
I am just now thinking maybe But issue linkml/linkml#127 proposes 'open enums' via I noted linkml/linkml#1595 discusses |
|
This has been a general naming tension between how I normally think and how linkml does names - I generally tend towards more general names whose meaning varies by context, and linkml tends to have specific names and only use them in one or a few contexts in which is has a single meaning. So where I would probably gravitate towards a single
But anyway, need to decide if we want to have common mechanism/pattern for declaring "all/none/some" openness, or if sometimes binary and sometimes trinary is fine. That also narrows down which names work. |
|
As this issue is slightly beyond my current ability to judge, @amc-corey-cox has volunteered to thinking through the implications and presenting a short version of this at the next developer call in one week. Sorry for the delay - please keep pushing if we slow you down; I can find more aggressive alternative review processes. 🚀 |
There was a problem hiding this comment.
The shape looks right to me. is_open as a boolean fits the metamodel: it mirrors id_prefixes_are_closed — one slot builds the value set, another says whether it's exhaustive. is_open: true just demotes the permissible values from MUST to SHOULD; it doesn't collapse the range.
@sneakers-the-rat on binary-vs-trinary: I don't think enums need the all/none/some shape that extra_slots has. extra_slots had to be trinary because it has no set-construction of its own. Enums already do that via permissible_values/reachable_from/matches/include/minus. And per-value constraints already work: a slot pattern holds independently of enum membership, so "extras must be well-formed" needs nothing new.
If a real case for open_to: shows up, that will need more definition than we're ready to do here and we should design around the live case.
amc-corey-cox
left a comment
There was a problem hiding this comment.
This shouldn't merge ahead of #265 — the pre-commit config currently rides in on a merge commit and deserves its own review. Otherwise all five of my comments are addressed: ifabsent is gone, the description no longer contradicts itself, and the example plus round-trip tests go further than I asked for.
OK cool, makes sense to me, then in general we are not going for naming consistency for openness across the different places that we want to declare it? We should probably make some kind of grouping/subset for openness terms then, or else make sure they are documented together. E.g. we might sprout an
I think just having a listing like that on each that refers to the others as part of a set in the docs would be enough. Main concern I have is being confusing/hard to discover if similar concepts are named differently. |
Wait for #265 and #266
This PR adds
is_openboolean slot to enum expressions in the meta model.See linkml/linkml#127 and linkml/linkml#3712