| Author | Topic |
Posts: 307
Location: Cambridge UK
Registered: February 2005
|
|
Re: create compartment is missing id
|
18 Apr '11 10:42

|
 |
|
On 18/04/2011 12:59, Clemens Wrzodek wrote:
> I think, if something has a defined level/version, other than the
> parent, throw an exception.
> If level/version is undefined, change it recursively.
>
Yes, I think that is the best way.
Nico
> Am 18.04.2011 18:56, schrieb Andreas Dräger:
>> Dear all,
>>
>>>>> listOfCompartments.add(compartment );
>>>>> document.getModel().setListOfCompartments(listOfCompartments );
>>> What happens is that when writing this model to XML the writer does
>>> not know that you desire to write a compartment of Level 2, it
>>> therefore only writes the name as this is done in Level 1.
>> While checking this example in detail I noticed that JSBML adapts the
>> Level/Version combination when adding elements to that of the parent.
>> See the method setThisAsParentSBMLObject in AbstractSBase. There you
>> can see that the method checkLevelAndVersionCompatibility actually
>> changes the Level/Version combination of an element. This is not done
>> recursively. To set L/V recursively, we have to set both at the same
>> time to avoid invalid L/V combinations. However, I am asking myself if
>> JSBML should be more strict and throw an exception when trying to add
>> something with different L/V combination to a parent object. What do
>> people think?
>>
>> Way 1: Silently change the L/V combination in a recursive way
>> Way 2: Throw an exception.
>>
>> What is better?
>>
>> Cheers
>> Andreas
>>
____________________________________________________________
To manage your jsbml-development list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/jsbml-development
For a web interface to the jsbml-development mailing list, visit
http://sbml.org/Forums/
For questions or feedback about the jsbml-development list,
contact sbml-team@caltech.edu
|
|
|