biosimulations / biosimulations-physiome

Command-line application for publishing the Physiome model repository of physiological models to the BioSimulations repository for simulation projects
https://docs.biosimulations.org/repositories/physiome
0 stars 0 forks source link

Deal with cases when SED-ML is saved with extension `.xml` #24

Closed bilalshaikh42 closed 2 years ago

bilalshaikh42 commented 2 years ago

For example https://models.physiomeproject.org/w/andre/SAN-ORd

jonrkarr commented 2 years ago

You could read all files with extension .xml and check whether the default namespace starts with the URIs for CellML.

import lxml.etree
etree = lxml.etree.parse(filename)
root = etree.getroot()
default_ns = root.nsmap.get(None, '')
is_cellml = default_ns.startswith('http://www.cellml.org/cellml/')
is_sedml = default_ns.startswith('http://sed-ml.org/sed-ml/')
jonrkarr commented 2 years ago

Rather than fixing this here, PMR2/models.physiomeproject.org#23 encourages the Physiome team to handle this upstream.