-
Notifications
You must be signed in to change notification settings - Fork 3
Support for enum mapping for slots with multiple enum ranges #31
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
base: main
Are you sure you want to change the base?
Conversation
|
Should add unit tests. |
|
@martinwellman Thanks for working on this feature - supporting multiple enum ranges is a real need (linkml/linkml#2128). I'm sorry to have taken so long to get back to you on this. After reviewing, I have some concerns about the approach: Syntax Issue The PR uses range: [enum1, enum2] which isn't standard LinkML syntax. LinkML coerces this to a string "['enum1', The proper LinkML way to specify multiple enum ranges is any_of: slots: With this syntax, you'd access the enums via slot.any_of[*].range directly - no string parsing needed. Answers to your questions:
Recommendation I'd like to see a reworking of this to support the standard any_of syntax instead. The feature is definitely needed, but Would you be interested in updating the PR to use any_of, or would you prefer we take it from here? |
|
@amc-corey-cox Thanks for the response. I realized eventually that I should be using "any_of" instead of having "range" equal to an array. I have a newer working version locally that uses "any_of" that I've been using for our project. The problem is that there are other parts of LinkML-Map that would need to be updated as well to handle multiple enumerations for ranges. For example, the code for determining the reverse transformation as well as for making a graph of the transformations (there might have been others as well, I can't remember). Would you want these other parts to be updated to support "any_of" with this PR as well? There was also another problem I had to deal with related to "any_of", but I'll have to look back at my notes to recall what it was, since it's been a while. |
This PR adds support for mapping slots that have a range consisting of multiple enumerations.
Some important things to review:
Closes linkml/linkml#2128