nwb-schema icon indicating copy to clipboard operation
nwb-schema copied to clipboard

Add optional "regex" to be used along with dtype "text"

Open yarikoptic opened this issue 5 years ago • 2 comments

ATM I have not spotted any ability in schema to constrain "text" values. Logical choice to provide such constrain would be a regular expression (note: there is a number of regular expression "languages").

Immediate use-case -- got a file with nwb_version set to NWB-2.2.0 although NWB- prefix was deprecated as of 2.1.0, and version in general should follow semantic version (and seems that post-release suffixes are in active use, e.g. in #422). pynwb happily validates that file since there is no constrains are supported at the schema level.

yarikoptic avatar Apr 09 '20 17:04 yarikoptic

@yarikoptic that is a good idea. this might also provide a flexible way to also describe enumerated types.

From where did you get a file with nwb_version set to NWB-2.2.0. I don't think PyNWB or MatNWB would generate such a file, so I assume it was set manually. I am concerned there might be other fields that are technically valid but not how we expect the data.

rly avatar Apr 09 '20 18:04 rly

From where did you get a file with nwb_version set to NWB-2.2.0.

Let me not disclose my sources (unless they decide to voice themselves), but they are now aware that they need to track it down how it came about ;)

yarikoptic avatar Apr 09 '20 19:04 yarikoptic