Repository navigation
The master attribute in an OMEX archive is an optional hint yet OpenCOR requires it. #557
Description
Activity
- added a commit that references this issue
on Aug 19, 2026 It is true that the
masterattribute is optional. However, when it comes to our use of COMBINE archives (i.e. contain one or several CellML files and, sometimes, one or several SED-ML files) then a tool like Web OpenCOR needs to know which file it should open. Failing that, what is Web OpenCOR supposed to be doing? I guess it could let the user know which files are present in the COMBINE archive and ask the user to select the one that ought to be opened or just select the first SED-ML file, if there is one, or the first CellML file.Anyway, until this gets done (if ever), I thought I would just enforce the need for the
masterattribute to avoid ambiguity.Certainly
masteris necessary if there are several CellML and/or SED-ML files in an archive. However, when an archive only contains a single CellML file and no SED-ML and there's no master attribute on any of the archive's files, shouldn't the CellML be treated as if it were master? Similarly, if there is only the one SED-ML file and no master file, then shouldn't the SED-ML be treated as the master??Certainly
masteris necessary if there are several CellML and/or SED-ML files in an archive.Well, I would like it to be necessary, but as you have seen:
masteris optional, so...However, when an archive only contains a single CellML file and no SED-ML and there's no master attribute on any of the archive's files, shouldn't the CellML be treated as if it were master? Similarly, if there is only the one SED-ML file and no master file, then shouldn't the SED-ML be treated as the master??
Yes, it could be done, I agree.
This is something I stumbled into after creating a simple OMEX archive and trying to open it with OpenCOR. Having realised that
masteris mandatory so far as OpenCOR goes, I got things to work by specifying the CellML file to be the master. This is fine so far as I go, although someone else in the future, following the OMEX spec, may well be tripped up by this "feature" -- if nothing else, should the requirement not be noted in some README?Note that this is actually a libOpenCOR requirement, not a Web OpenCOR requirement. Still, I am not sure it's worth worrying too much about it? @nickerso?
And indeed, opening the OMEX archive of the GLUT2 model on PMR fails with no master...

Ok, I am going to look into it and have libOpenCOR support an OMEX file with no master file. But what should be the exact behaviour if there is no master file?
- if the OMEX file contains one SED-ML file, then it will consider that SED-ML file as the master file.
- if the OMEX file contains several SED-ML files, then... what should we do? Use the first SED-ML file or warn the user that there are several SED-ML files?
- if the OMEX file doesn't contain any SED-ML file but one CellML file, then it will consider that CellML file as the master file.
- if the OMEX file doesn't contain any SED-ML file but several CellML files, then... what should we do? Use the first CellML file or warn the user that there are several CellML files?
For points 2 and 4, I am in favour of just warning the user since I don't think libOpenCOR should decide on the user's behaviour. If anything, it should be a tool like Web OpenCOR that should ask the user which CellML / SED-ML file should be opened. This is particular important for CellML files since there might indeed be a "main" CellML file that imports other CellML files.
Does this sound reasonable?
Otherwise, why not just generate an OMEX file which specifies a master file?...
Does this sound reasonable?
Yes it does. If there's only one thing to choose from there's no need to explicitly specify it (options 1 and 3), otherwise have libOpenCOR fail and have a UI (e.g. Web OpenCOR) ask the user what they want.
Otherwise, why not just generate an OMEX file which specifies a master file?...
Because PMR has exposures with OMEX files that have no master -- @nickerso is one culprit...
Does this sound reasonable?
Yes it does. If there's only one thing to choose from there's no need to explicitly specify it (options 1 and 3), otherwise have libOpenCOR fail and have a UI (e.g. Web OpenCOR) ask the user what they want.Otherwise, why not just generate an OMEX file which specifies a master file?...
Because PMR has exposures with OMEX files that have no master -- @nickerso is one culprit...
Ok, I will look into it tomorrow then (see opencor/libopencor#603).
Closing as a result of PR #606 for issue for opencor/libopencor#603.
@dbrnz, just to confirm that this is now working... although the GLUT2 model on PMR has a lot of issues...

Thanks!
The OMEX opens just fine in legacy OpenCOR, and the archive does contain './units/units.cellml`, so is there an issue with libOpenCOR reading OMEX archives that have files in sub-directories?
https://models.physiomeproject.org/e/cae/GLUT2_BG.cellml/view seems to be dead at the moment, but if the model uses imports, then it won't work. Indeed, [lib]OpenCOR doesn't currently support imports, only flattened models... :/
The OMEX opens just fine in legacy OpenCOR
Hmm, I tell a lie -- it does not...
With legacy OpenCOR:
- If the OMEX is unzipped then OpenCOR happily opens and runs the SEDML in the archive.
- Directly opening the OMEX as downloaded from PMR reports:
Information: only COMBINE archives with one master file are supported. - Tweaking the manifest to specify the SEDML file to be
masterand directly opening the recreated OMEX gives:Error: 'units/units.cellml' could not be found.
PMR appears to have been offline -- the link is now back up for me.
With legacy OpenCOR:
- If the OMEX is unzipped then OpenCOR happily opens and runs the SEDML in the archive.
Makes sense.
- Directly opening the OMEX as downloaded from PMR reports:
Information: only COMBINE archives with one master file are supported.
Makes sense indeed and I should have been surprised the first time you sad that it was working fine in legacy OpenCOR since, like in Web OpenCOR (before the fix), a COMBINE archive is expected to have master file.
- Tweaking the manifest to specify the SEDML file to be
masterand directly opening the recreated OMEX gives:Error: 'units/units.cellml' could not be found.
?! Here is the OMEX file that I have just tweaked to have a master file and it all works fine in legacy OpenCOR (make sure to rename the extension to
.omexor libSBML will trip over it).?! Here is the OMEX file that I have just tweaked to have a master file and it all works fine in legacy OpenCOR (make sure to rename the extension to .omex or libSBML will trip over it).
Aargh, my mistake -- I used
-jwhen zipping so as not to have paths included and this of course flattened things...Anyway I can run the model using legacy OpenCOR, which is all I need. I've recreated it using CellDL and am now trying to get the resulting CellML running in both legacy and web OpenCOR -- the issues so far have been to do with CellML generation, not OpenCOR.
21. > ?! Here is the OMEX file that I have just tweaked to have a master file and it all works fine in legacy OpenCOR (make sure to rename the extension to .omex or libSBML will trip over it).
Aargh, my mistake -- I used `-j` when zipping so as not to have paths included and this of course flattened things...🤯🤣
Anyway I can run the model using legacy OpenCOR, which is all I need. I've recreated it using CellDL and am now trying to get the resulting CellML running in both legacy and web OpenCOR -- the issues so far have been to do with CellML generation, not OpenCOR.With CellML generation?
Anyway I can run the model using legacy OpenCOR, which is all I need. I've recreated it using CellDL and am now trying to get the resulting CellML running in both legacy and web OpenCOR -- the issues so far have been to do with CellML generation, not OpenCOR.
With CellML generation?
Issues with how I'm generating CellML from CellDL, outside of OpenCOR.
Reacted by Alan Garny
From the specification of an OMEX manifest:
However while OpenCOR will open an OMEX archive with just a CellML file that has the
masterattribute settrue, it complains if there is nomasterattribute and reports:Does OpenCOR expect a SED-ML file when the CellML isn't flagged as master? The above messages are recent, as earlier code simply crashed when there was no SED-ML. I would expect CellML to be used if there's no SED-ML, regardless of the
masterattribute, as it's meant to be an optional hint.