Forums

F.A.Q. F.A.Q.    Register Register    Login Login    Home Home
Search Search
SBML Discussions » jsbml-development » Bug in SBMLWriter
Show: Today's Posts  :: Message Navigator
| Subscribe to topic 
Return to the default flat view Create a new topic Submit Reply
AuthorTopic
rodrigue


Posts: 307
Location:
Cambridge UK
Registered:
February 2005
Re: Bug in SBMLWriter 08 May '12 07:10 Go to previous messageGo to previous message

On 08/05/12 14:43, Nicolas Rodriguez wrote:
> On 08/05/12 14:30, Nicolas Rodriguez wrote:
>> On 08/05/12 14:20, Andreas Dräger wrote:
>>> Am 5/8/12 3:17 PM, schrieb Nicolas Rodriguez:
>>>> On 08/05/12 13:57, Andreas Dräger wrote:
>>>>> |Hi all,
>>>>>
>>>>> It seems the SBML writer does currently write invalid SBML code when
>>>>> making use of the ability of SBML Level 3 to associate plain numbers
>>>>> with units:
>>>>>
>>>>> <cn type="integer" sbml:units="dimensionless"> 1</cn>
>>>>>
>>>>> The above code is only valid if the namespace declaration of the math
>>>>> element also defines
>>>>>
>>>>> xmlns:sbml="http://www.sbml.org/sbml/level3/version1/core"
>>>>>
>>>>> Currently, it does only declare the regular MathML namesapce. As a
>>>>> result, JSBML is currently unable to parse models that itself wrote into
>>>>> a file before. Where can we fix this problem?
>>>> The check is in
>>>> org.sbml.jsbml.util.compilers.MathMLXMLStreamCompiler.isSBMLNamespaceNeeded(ASTNode)
>>>>
>>>> the namespace is added in
>>>> org.sbml.jsbml.xml.stax.SBMLWriter.writeMathML(MathContainer,
>>>> SMOutputElement, XMLStreamWriter, int)
>>>>
>>>> line 1084 to 1106.
>>>>
>>>> The compiler org.sbml.jsbml.util.compilers.FindUnitsCompiler is used to
>>>> say if there is a unit declaration or not in the mathML.
>>>>
>>>> This is probably there that the problem happen, and the value returned
>>>> is probably false.
>>>> It is probably due to the way you are declaring the units and then how
>>>> the mathML compiler is calling the methods.
>>>>
>>>> If I read a model with units, then the writing is fine so there is may
>>>> be something missing when we declare units from scratch.
>>>>
>>>>
>>> Hi Nico,
>>>
>>> Yes, it is probably because I simply say
>>>
>>> myASTNode.setUnit(Unit.Kind.DIMENSIONLESS.getName());
>>>
>>> or something similar. I thought this would be enough and didn't care
>>> about namespaces at the moment.
>> It should be enough but it was probably not tested much until now.
>>
>> We should probably check how the reader is setting things up.
> So, the reader is not doing anything specific, just using the setUnits()
> method ( I suppose it was a typo error on your code as I don't see a
> method setUnit().
>
> Strange, it was working fine before.

Just checked it again using org.sbml.jsbml.ext.qual.BuildToyModelTest

And it is working fine for me.

Can you check which version of jsbml did you use to generate the models ?

Nico


____________________________________________________________
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

      

SubjectPosterDate
Read Message   Bug in SBMLWriter Andreas Dräger08 May '12 05:57
Read Message   Re: Bug in SBMLWriter rodrigue08 May '12 06:17
Read Message   Re: Bug in SBMLWriter Andreas Dräger08 May '12 06:20
Read Message   Re: Bug in SBMLWriter rodrigue08 May '12 06:30
Read Message   Re: Bug in SBMLWriter rodrigue08 May '12 06:43
Read Message   Re: Bug in SBMLWriter  rodrigue08 May '12 07:10
Read Message   Re: Bug in SBMLWriter Andreas Dräger09 May '12 11:42
Read Message   Re: Bug in SBMLWriter rodrigue10 May '12 04:49
Read Message   Re: Bug in SBMLWriter rodrigue10 May '12 04:57
Read Message   Re: Bug in SBMLWriter rodrigue10 May '12 05:38
Read Message   Re: Bug in SBMLWriter Andreas Dräger10 May '12 05:50
Read Message   Re: Bug in SBMLWriter Andreas Dräger10 May '12 04:59
Previous Topic:Re: [sbml-render] Ids and names on elements
Next Topic:jsbml-svn commit list added
Go to forum:
-=] Back to Top [=-

Powered by FUDforum. (Copyright Advanced Internet Designs Inc.)

Please use our issue tracking system for any questions or suggestions about this website.