Forums

F.A.Q. F.A.Q.    Register Register    Login Login    Home Home
Search Search
SBML Discussions » jsbml-development » setting automatically an SBO term for time
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
setting automatically an SBO term for time 24 Nov '10 02:52 Go to previous message

> Index: src/org/sbml/jsbml/UnitDefinition.java
> ===================================================================
> --- src/org/sbml/jsbml/UnitDefinition.java (revision 445)
> +++ src/org/sbml/jsbml/UnitDefinition.java (working copy)
> @@ -172,42 +172,40 @@
> * specified level version combination or null if no
> such predefined
> * unit exists.
> */
> public static final UnitDefinition getPredefinedUnit(String
> id, int level,
> int version) {
> if (level < 3) {
> id = id.toLowerCase();
> Unit u = new Unit(level, version);
> UnitDefinition ud = new UnitDefinition(id,
> level, version);
> if (id.equals("substance")) {
> u.setKind(Unit.Kind.MOLE);
> } else if (id.equals("volume")) {
> u.setKind(Unit.Kind.LITRE);
> } else if (id.equals("area")) {
> u.setKind(Unit.Kind.METRE);
> u.setExponent(2);
> } else if (id.equals("length")) {
> u.setKind(Unit.Kind.METRE);
> } else if (id.equals("time")) {
> u.setKind(Unit.Kind.SECOND);
> - u.setSBOTerm(345);
> - ud.setSBOTerm(345);
Just encountered these setSBOTerm calls that make the library failed to
read SBML L2V1 in a really strange way where the exception was quite hidden.

First, I thing we should avoid setting automatically anything that is
not on the specs.
And it feel strange to me to annotate unit with SBO term in general.
In this case, the SBO term 345 is obsolete and we should better use a
child of the term 346 (temporal measure) but I am not sure any term fit
anymore.

The second problem is that method call provoke an exception being thrown
(for level 2 version 1 or lower model), a PropertyNotAvailableError
and when java try to print the stack trace there was a
NullPointerException in the toString() because plenty of the attributes
of an SBMLError were not defined
and this exception is apparently catch by the jdk so nothing was displayed.

So, we need to define the toString() of the new SBMLErrors, I can to
that and I would propose to remove these setSBOTerm call.
Do you make any use of it Andreas ?

Thanks,
Nico



> } else {
> return null;
> }
> ud.setName("Predefined unit " + id);
> ud.addUnit(u);
> return ud;
> }
> return null;
> }

____________________________________________________________
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   setting automatically an SBO term for time  rodrigue24 Nov '10 02:52
Read Message   Re: setting automatically an SBO term for time Andreas Dräger24 Nov '10 04:39
Read Message   Re: setting automatically an SBO term for time rodrigue24 Nov '10 05:31
Read Message   Re: setting automatically an SBO term for time Andreas Dräger24 Nov '10 06:16
Read Message   Re: setting automatically an SBO term for time rodrigue24 Nov '10 06:23
Read Message   Re: setting automatically an SBO term for time rodrigue24 Nov '10 06:04
Read Message   Re: setting automatically an SBO term for time Andreas Dräger24 Nov '10 06:13
Previous Topic:Level/Version checks
Next Topic:http://jsbml.svn.sourceforge.net/viewvc/jsbml/trunk/src/org/sbml/jsbml/AbstractMathContainer.java?r1
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.