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

Steps and issues to reach a more complete state #2

Open
6 of 15 tasks
candleindark opened this issue Oct 15, 2024 · 0 comments
Open
6 of 15 tasks

Steps and issues to reach a more complete state #2

candleindark opened this issue Oct 15, 2024 · 0 comments

Comments

@candleindark
Copy link
Member

candleindark commented Oct 15, 2024

(Note: the content of this issue is mostly copied from DailyDreaming#13)

Steps needed to reach a more complete state

  • Lay out a LinkmlGenerator class that takes in Python Enum objects and Pydantic models for conversion to LinkML schema
  • Resolve Pydantic core schema for each model and each field
  • Identify locally defined fields for each model, e.g. filter out those in __annotations__ that are ClassVar
  • Separate locally defined fields as newly defined ones and overriding ones. The newly defined ones are to be used for global slot definitions, and the overriding ones are to be used for slot usage definitions.
  • Layout a SlotGenerator class for generating slot definition from the Pydantic core schema for a field in a Pydantic model
  • Implement conversion of elemental Pydantic core schema to LinkML slot attribute values in SlotGenerator
    • Some special care possibly needed to be put in place for conversion of numeric types because "exclusiveMaximum" and "exclusiveMinimum" are currently not available in LinkML
  • Implement the conversion of Pydantic core model schemas for Pydantic models to LinkML class definitions.

Issues to be solved to reach a more complete state

  1. LinkML

    1. Questions needed to be answered:
    1. Issues
      1. Unable to generate valid YAML for PermissibleValue with text containing a colon linkml/linkml#2138
        (Needed for dandischema which has enum values containing ":".)
      2. The exact_cardinality metamodel slot doesn't seem to have any effect when used in a SlotDefinition linkml/linkml#2104
        (Not needed. There is a workaround.)
      3. Inconsistent nullability in generated Pydantic model linkml/linkml#2155
        (Solution not needed for our purpose)
      4. equals_string_in meta slot has no affect in validation linkml/linkml#2206
        (Not needed. Found a workaround)
      5. No validation for range uri beyond validation for range string linkml/linkml#2215
        (Needed for the current translation of URL types in Pydantic)
      6. A slot requirement cannot be removed on a subclass linkml/linkml#1508 (comment)
        (Needed for all translations)
  2. Pydantic

    1. Is there a guide/tutorial to the Pydantic core schema? pydantic/pydantic#9485
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

No branches or pull requests

1 participant