Skip to content

Handle LinkML migration issue of pydantic2linkml: Impossible to generate slot usage entry for the #389

Description

@candleindark

pydantic2link has the complains about not able to generate some slot usage entries in generation of some class definitions

such as in the translation of the Dandiset class

Image

Stats of such complains

Total: 54 count
Ones about the schemaKey usage slots at different class defintions: 41 counts

Cause

pydantic2link unable to generate the usage slot cause by the fact that LinkML schema are monotonic. Restrictions from a slot usage definition are only additive and can not override the restrictions in the corresponding slot definition.

TODOs:

  • Come up with a solution to handle each of these complains in the generated LinkML schema
    • The ones about schemaKey should be able to be handled the same way (do these first)
      • make the schemaKey slot be a type designator (using the _merge.yaml)
      • remove the ifabsent value in the schemaKey slot (this value is not relevant in a type designator; using the he _merge.yaml))
      • remove all the existing notes of Impossible to generate slot usage entry for the SchemaKey appended by pydantic2linkml
      • make schemaKey required (using the _merge.yaml). Doing this ensure new data coming in have the schemaKey field.
      • note: if _merge.yaml was merged "first" while processing subclasses, and if default value differs from the class name - we wanted to add notes: about that divergence
        • workaround: add manually to _merge.yaml file those notes for all those classes where we overload schemaKey with the value that is not the same as class name
      • Figure out why or what for we had schemaKey 'Dandiset' for PublishedDandiset and so on
        • check what class loading of a published dandiset manifest record results in (I guess should be PublishedDandiset)
        • check with @dandi/dandi-archive people how schemaKey is used in frontend (e.g. meditor) and whether it must remain e.g. "Dandiset" for "PublishedDandiset"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions