-
Notifications
You must be signed in to change notification settings - Fork 2
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
Support abstract data types that are not meant to be instantiated #44
Comments
Proposal: Recommend that abstract data type names start with the prefix "Base". Then APIs like PyNWB and MatNWB can strip the "Base" when automatically generating field names. For example, in catalystneuro/ndx-microscopy#41 (comment) we have the schema: - neurodata_type_def: SegmentationContainer
neurodata_type_inc: NWBDataInterface
doc: ...
groups:
- neurodata_type_inc: BaseSegmentation
doc: ...
quantity: "+" I think in both PyNWB and MatNWB, the autogenerated field name for the dictionary of |
It seems that this is behavior that should be enforced. If that is the case, then I think making this explicit in the schema will be important, e.g. via an explicit key to define whether a type should be abstract./e.g., |
LinkML also uses the |
Yes, sorry, I meant to propose the |
Sounds good. Having both the |
I like the key and the base convention, but I worry a bit about the name handling, particularly on the matlab side. Thoughts, @ehennestad? |
MatNWB does not need to follow the same convention for generating APIs as HDMF/PyNWB (MatNWB already lacks object mappers, e.g., they have to know about the NWB |
An alternate approach to the naming convention for APIs is to allow the spec to make explicit what the field name should be for a collection of objects of type X. That also avoids the |
It is sometimes useful to define a hierarchy of neurodata types such that a type (usually the highest level) is an abstract data type, i.e., one that is not meant to be instantiated.
Use Case 1: NeurodataWithoutBorders/nwb-schema#603 proposes creating a
BaseImage
neurodata type that hasImage
andExternalImage
as subtypes. It would be useful to allow other neurodata types to link to / include aBaseImage
neurodata type. This is not just a Union ofImage
andExternalImage
but it would also allow new data types to be defined that extendBaseImage
that could be placed wherever aBaseImage
is allowed. ABaseImage
should not be created though.Use Case 2: https://github.com/catalystneuro/ndx-microscopy proposes creating a
ImagingSpace
neurodata type which hasPlanarImagingSpace
andVolumetricImagingSpace
as subtypes.LinkML supports the
abstract
key: https://linkml.io/linkml-model/latest/docs/abstract/cc @bendichter
The text was updated successfully, but these errors were encountered: