forked from DailyDreaming/linkml-aind-model
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
(Note: the content of this issue is mostly copied from DailyDreaming#13)
Steps needed to reach a more complete state
- Lay out a
LinkmlGeneratorclass that takes in PythonEnumobjects 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 areClassVar - 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
SlotGeneratorclass 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
- Some special care possibly needed to be put in place for conversion of numeric types because "
- 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
-
LinkML
- Questions needed to be answered:
- 1. How to specify a slot of range float that accepts values less than 10.0? #2144
(May not be needed for dandischema but needed for the support of other schemas) - 2. What are the default values for meta model slots? #2147
(Needed for dandischema but the question is mostly answered) - 3. Is there a way to specify a default value for a slot with a range of an arbitrary type? #2149
(May not be needed for dandischema but needed for the support of other schemas) - 4. How to specify the LinkML equivalent of Union[List[int], str]? #2154 (Note: this is resolved. See Refactoring model so we could avoid shortcoming of linkml model dandi-schema#257)
(Needed for Dandischema which has field types such asOptional[Union[List[GenotypeInfo], Identifier]]) - 5. How to define a slot whose values are comparable to a dictionary in Python?
(Needed for Dandischema which has field type ofDict[DigestType, str]fordigestinBareAsset.) - 6. DANDI/EMBER/... transfer/add "run-time" (instance) related validations. linkml model: how to add "run-time" or "instance specific" validations dandi-schema#274
- Issues
- Unable to generate valid YAML for
PermissibleValuewithtextcontaining a colon linkml/linkml#2138
(This is no longer needed.) - The
exact_cardinalitymetamodel slot doesn't seem to have any effect when used in aSlotDefinitionlinkml/linkml#2104
(Not needed. There is a workaround.) - Inconsistent nullability in generated Pydantic model linkml/linkml#2155
(Solution not needed for our purpose) equals_string_inmeta slot has no affect in validation linkml/linkml#2206
(Not needed. Found a workaround)- No validation for range
uribeyond validation for rangestringlinkml/linkml#2215
(Needed for the current translation of URL types in Pydantic) - A slot requirement cannot be removed on a subclass linkml/linkml#1508 (comment)
(Needed for all translations)
- Unable to generate valid YAML for
-
Pydantic
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels