| Author | Topic |
Posts: 417
Registered: May 2004
|
|
Re: No defaults in SBML L3
|
23 Sep '09 07:08

|
 |
|
> The question is then, how can you tell from a file whether it is the
> product of writing or saving? It makes sense to make both similar to
> allow them to be read by the same code, while at the same time, you
> want to have them marked clearly.
I've been thinking about this. What about the following:
=========================================
A) libSBML has two reading and two writing functions:
1) readSBML 3) loadSBML
2) writeSBML 4) saveSBML
1) readSBML - as now; reads in an sbml file whether valid or not
2) writeSBML(bool strict = false); will only write out a model where all
required values have been specified by the user; with the optional
strict flag to indicate that the user only wants a completely valid sbml
file to be written.
3) & 4) read and write sbml BUT with no assumptions about required
values, validity etc. In order to allow libSBML to identify these they
are written using the namespace 'sbml-temporary'.
Obviously 3 & 4 need not be exposed to the user but 1/2 could work out
from the namespace what sort of checks to impose.
I presume that no one would ever really want to exchange these models,
they are merely a way of allowing a user to save unfinished work. Thus
it would be possible to provide the facility to let the software package
specify the temporary namespace.
===============================================
B) libSBML does not automatically provide default values
Instead - there are functions for any components that have required
values that allow the user to set the default values from the L2 spec.
e.g. Unit::setRequiredValuesAsL2Default()
would set exponent=1, scale=0,multiplier=1
This would still mean that users have to call a function but it reduces
the need for the user to track what values are required. And there could
even be a Model::setRequiredValuesAsL2Default() that just loops through
everything :-)
===============================================
I know there is a downside to B) namely that attributes that didn't
exist in L2 are not covered and it still doesn't help me with how to
give a boolean a value that is Not-A-Boolean BUT ...
Am I thinking along lines that might satisfy most people ??
Sarah
____________________________________________________________
To manage your libsbml-development list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/libsbml-development
For a web interface to the libsbml-development mailing list, visit
http://sbml.org/Forums/
For questions or feedback about the libsbml-development list,
contact sbml-team@caltech.edu
|
|
|