You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Need to add a method in the NamespacesAdapter to roll down and merge all inherited properties, recursively, from parent classes.
Currently this is handled in both linkml and pydantic models via standard inheritance methods, but NWB schema lang also inherits properties from within overridden props in children, see the example here: NeurodataWithoutBorders/pynwb#1954 (comment)
So the best approach would be to roll down all attrs, datasets, and groups after loading the initial schema but before linkml generation.
There is a somewhat obnoxious ordering problem here - the related method for completing imports requires the other imported namespaces to be loaded, but since nwb schema lang doesnt have a concrete mechanism for resolving imports ( see: NeurodataWithoutBorders/nwb-schema#540 ) they usually have to be added later after object instantiation, which makes for an awkward need to call a method manually afterwards to complete the schema.
We should add an induce or complete method that wraps any post-load steps that need to be taken, and a private attr like _completed that indicates whether it has been called already (and otherwise calls it at the start of build).
This gets us into a little bit of messy territory re: division of labor between nwb_schema_language and nwb_linkml, where the former is basically just the schema classes, but we probably want to have it contain all the steps that relate to loading and completing a schema, so nwb_linkml has only the linkml parts.
The text was updated successfully, but these errors were encountered:
See: NeurodataWithoutBorders/pynwb#1954
Need to add a method in the NamespacesAdapter to roll down and merge all inherited properties, recursively, from parent classes.
Currently this is handled in both linkml and pydantic models via standard inheritance methods, but NWB schema lang also inherits properties from within overridden props in children, see the example here: NeurodataWithoutBorders/pynwb#1954 (comment)
So the best approach would be to roll down all attrs, datasets, and groups after loading the initial schema but before linkml generation.
There is a somewhat obnoxious ordering problem here - the related method for completing imports requires the other imported namespaces to be loaded, but since nwb schema lang doesnt have a concrete mechanism for resolving imports ( see: NeurodataWithoutBorders/nwb-schema#540 ) they usually have to be added later after object instantiation, which makes for an awkward need to call a method manually afterwards to complete the schema.
We should add an
induce
orcomplete
method that wraps any post-load steps that need to be taken, and a private attr like_completed
that indicates whether it has been called already (and otherwise calls it at the start ofbuild
).This gets us into a little bit of messy territory re: division of labor between nwb_schema_language and nwb_linkml, where the former is basically just the schema classes, but we probably want to have it contain all the steps that relate to loading and completing a schema, so nwb_linkml has only the linkml parts.
The text was updated successfully, but these errors were encountered: