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

Support for enum mapping for slots with multiple enum ranges #31

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

martinwellman
Copy link
Collaborator

This PR adds support for mapping slots that have a range consisting of multiple enumerations.

Some important things to review:

  1. In object_transformer.py line 186, source_type (of type ElementName) is converted from a string with yaml.safe_load. The expected loaded value is a string (eg. 'myenum') or list of strings (eg. ['myenum1', 'myenum2', ...]). Is this the preferred way to do this?
  2. In object_transformer.py in function transform_enum: while iterating over the enum derivations, the first time we encounter a derivation with mirror_source=True we return str(source_value) (if no mapping has been successful yet). Should we instead iterate over all enum derivations, try to map the source_value (ignoring mirror_source), and only after failing all enum derivations should we return str(source_value) if any of the enum derivations have mirror_source=True?

Closes linkml/linkml#2128

@martinwellman
Copy link
Collaborator Author

Should add unit tests.

@martinwellman martinwellman marked this pull request as ready for review July 9, 2024 17:38
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

Successfully merging this pull request may close these issues.

Mapping slots with multiple enumerations as a range
1 participant