Skip to content

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