NeuroML / NeuroML2

This repository hosts the NeuroML 2 Schema, the ComponentType definitions in LEMS and the core documentation of NeuroML2.
https://docs.neuroml.org
GNU Lesser General Public License v3.0
50 stars 24 forks source link

feat(schema): add simple type to restrict component reference paths #216

Closed sanjayankur31 closed 12 months ago

sanjayankur31 commented 1 year ago

The regex says that the path must be a string that:

sanjayankur31 commented 1 year ago

To test with xmllint, something like this will do (replace path of xsd here):

find . -name "*.nml" -execdir xmllint --schema /home/asinha/Documents/02_Code/00_mine/NeuroML/software/NeuroML2/Schemas/NeuroML2/NeuroML_v2.3.xsd --noout '{}' \; 2> validation-output.txt

Question: can the [] be empty or non numeric?

pgleeson commented 1 year ago

@sanjayankur31 See https://github.com/NeuroML/org.neuroml.export/blob/development/src/main/java/org/neuroml/export/utils/Utils.java#L127

I think all paths in projection/connections and inputList/inputs will be of the form ../pop_pyr/0/pyr_4_sym or ../pop_pyr[0]

and all in explicit inputs will be

pop_pyr/0/pyr_4_sym or pop_pyr[0]

I would limit it to only these options until you find any other examples. Test on all in https://github.com/NeuroML/NeuroML2/tree/master/examples

sanjayankur31 commented 1 year ago

Sounds good. I'll go tweak it.

sanjayankur31 commented 12 months ago

@pgleeson : limited to the possible paths now. All examples validate, and tested a bunch of models too.

pgleeson commented 12 months ago

Thanks, testing on exp

pgleeson commented 12 months ago

Looks good. The extra java based tests in jnml are actually quite informative too, e.g. if you put the wrong population id in the string of connection and it doesn't match the one in projection.

sanjayankur31 commented 12 months ago

Looks good. The extra java based tests in jnml are actually quite informative too, e.g. if you put the wrong population id in the string of connection and it doesn't match the one in projection.

Cool. I'd gone through the various bits and listed them out in the docs here (and also in the appendix of the paper):

https://docs.neuroml.org/Userdocs/ValidatingNeuroMLModels.html#list-of-validation-tests