Skip to content

Managing "Any of" use cases #75

Description

@RobertJCarroll

For any_of, we have several major use cases:

  1. To define multiple enumeration options, eg, an expected list and an "unknown" list.
  2. To define an "example" enumeration.
  3. To define id types (for global id definitions)

LinkML describes the process as layering the any_of as additional requirements on top of the range: Any. This works in some cases, but in some export models it treats the Any as a real class and ignores the any_of. The documentation also says "Any or X or Y", which isn't consistent with the described intent- it must be only X or Y. They pydantic model appears to support the any_of, but the python model does not- it includes Any which means anything will pass validation as it's not defining the type limitations.

Our desired state is that the range: Any is completely ignored when the any_of ranges are present- it should appear in no output, including the documentation. All generated artifacts treat the slot as permitting only and everything in the any_of ranges. The pydantic model appears to have this behavior today.

For implementation examples:
1: Subject type, which must be EnumSubjectType or EnumUnknownOther.
2: Organism type, which can be any uriorcurie, but we include EnumOrganism with Human and Mouse for reference.
3: Subject Assertion Global ids, which includes 3 global id types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions