ModellingWebLab / cellmlmanip

CellML loading and model equation manipulation
Other
3 stars 1 forks source link

Validate MathML input #10

Closed tamuri closed 4 years ago

tamuri commented 7 years ago

Note from Jonathan:

This would be a separate module, probably just validating against a (RELAX NG) schema. There's one in the old pycml.

MichaelClerx commented 7 years ago

Note: Not sure libCellML is planning to take care of this

nickerso commented 7 years ago

libCellML validation currently validates MathML strings against the MathML 2.0 DTD and I think also checks that <ci>'s only make use of variables defined in the component.

MichaelClerx commented 7 years ago

Thanks!

skeating commented 5 years ago

If libCellML is going to validate the MathML - can this be closed ?

MichaelClerx commented 5 years ago

For the time being we're not using libcellml, so no?

skeating commented 5 years ago

Reason I ask is that previous experience has shown that having bad MathML in a model can play havoc with unit checking/conversion etc. So realistically validating MathML needs to be a priority when it comes to unit stuff

MichaelClerx commented 5 years ago

I'm all for validating it properly! And checking whether its restricted to the CellML subset (which checking against the MathML DTD doesn't do)

skeating commented 5 years ago

I have much experience of writing RNG schemas for reduced sets of MathML (strangely this is because SBML only supports a subset of MathML!) so could certainly get that sorted quickly. If RNG is acceptable.

jonc125 commented 5 years ago

We also have the RNG schemas for CellML 1.0 (and MathML) that pycml uses... https://github.com/Chaste/Chaste/blob/release/python/pycml/cellml1.0.rng etc

MichaelClerx commented 5 years ago

If we want to do that, then here's an example of how to do it in Python: https://github.com/MichaelClerx/cellml-validation/blob/master/check/_validation.py#L54-L81

MichaelClerx commented 5 years ago

And here's a report showing which errors it catches: https://github.com/MichaelClerx/cellml-validation/blob/master/reports/relaxng_1_0.md :D :D :D

skeating commented 5 years ago

Cool - so can I assume that before any call is made to generate simulation code/use cellmlmanip the cellml has been validated enough that I shouldnt hit any issues ?

MichaelClerx commented 5 years ago

No none of this is currently implemented in CellMLManip!