p2p-ld / nwb-linkml

Translating NWB schema language to linkml
https://nwb-linkml.readthedocs.io
GNU General Public License v3.0
4 stars 1 forks source link

How to handle object mappers #7

Open sneakers-the-rat opened 3 months ago

sneakers-the-rat commented 3 months ago

There is this mysterious attribute electrodes that is in the pynwb NWBFile class mentioned in the various getter/setter methods: https://github.com/NeurodataWithoutBorders/pynwb/blob/379213673cdb4064d5565326622d0dc1ca31d50c/src/pynwb/file.py#L725

But the schema has no such attribute: https://github.com/NeurodataWithoutBorders/nwb-schema/blob/dev/core/nwb.file.yaml

There's NWBFile.extracellular_ephys.electrodes but not just a plain electrodes

Its an ElectrodeTable which also does not exist in the schema: https://github.com/search?q=repo%3ANeurodataWithoutBorders%2Fnwb-schema+ElectrodeTable&type=code

It turns out there is an out of spec mapping between the electrodes attribute and the ecephys.electrodes attribute: https://github.com/NeurodataWithoutBorders/pynwb/blob/379213673cdb4064d5565326622d0dc1ca31d50c/src/pynwb/io/file.py#L74-L77

Thats implemented here: https://github.com/hdmf-dev/hdmf/blob/a98e5e98cbfb6e824fb57eb5e7eac1dc6cd4532b/src/hdmf/build/objectmapper.py#L92

Do we need to interact with these at all? I dont see why they exist. Main thing to do is figure out if they add any functionality that is actually completely out of spec rather than renaming stuff in the in-memory object for some reason. There is a ton of special casing to handle coercion and whatnot in pynwb that we may or may not need to implement as well, but thats a separate question from "do we need to do anything about the maps"