Users of libSBML vary in the way in which they approach SBML and wish to use libSBML to manipulate it. Some users are keen to keep an SBML model in a valid state at all times, whilst others are happy to ignore consistency when working with a model and merely check consistency once they have finished. There are also users who do not worry about unit consistency whichever of these two categories they fall into. These preferences can extend to different libSBML functionality that a user might be using.
This leads to the following user preferences:
- I want to work with and save SBML regardless of whether it is valid
- I want to work with and save only valid SBML
- I want to work with and save only valid SBML but I wish to ignore certain consistency checks
- I want to convert between Levels and Versions only if the semantics of the model is preserved
- I want to convert between Levels and Versions regardless of whether semantics is preserved
- I consider a model to be valid if it meets a particular set of consistency checks and I do not care whether it meets another set
At present libSBML offers a number of functions that allow the user to try and achieve the 'state' they require. They can turn on or off certain sets of validation. They can select strict or non-strict conversion. In other ways libSBML prevents the user from creating invalid SBML by failing to set an attribute or element to an invalid value. Thus it is not straight forward for the user to customize the behaviour required.
Sarah suggests that it would be possible to adjust the libSBML code so that all functions were applied in the chosen 'state'. A user could initialize the 'state' when starting libSBML or possibly for each SBMLDocument instance. This 'state' would then be applied to all subsequent functions.
document->setState('consistentUnits', 'off'); document->setState('preserveValidity', 'on');
would be used to set the state. All subsequent functions calls relating to units would then be performed without the requirement that units were consistent; but any other functions would not allow the creation of invalid SBML.
SBML L3 and packages also introduce other potential states that a user may find useful such as choosing to ignore certain packages.
This is obviously a topic that requires much thought and user consultation but could be applied to produce a libSBML-6 that met the requirements of more developers.