Suggested by Chris Myers:
The getAnnotation method returns a list of Annotations even though there is only one Annotation on each object. This function is marked as deprecated, so I suspect that you know this, but I cannot find a replacement.
I assume addAnnotation should also be deprecated and setAnnotation should take a single item. It would also be nice to have some functions to help build and parse annotations. See getSEDBaseAnnotation in the attached as an example.
Ticket moved from /p/jlibsedml/bugs/6/
I've committed in some improved methods to set Annotation, to add top-level elements and also an AnnotationValidator that will complain if you add > 1 top level element with same namespace, as per the SBML spec's recommendations. Please Can you add your attachment here in a comment so I can have a look and see what else you were looking to do?
Thanks Richard
Here is the getSEDBaseAnnotation method I wrote.
Here is the function modified with your changes;
I’m also still getting this warning, not sure why:
17:04:23 [AWT-EventQueue-0] WARN org.jlibsedml.SEDMLReader - Unexpected [Element: <annotation [namespace:="" <a="" href="http://sed-ml.org/sed-ml/level1/version2">http://sed-ml.org/sed-ml/level1/version2]/>]</annotation>
17:04:23 [AWT-EventQueue-0] WARN org.jlibsedml.SEDMLReader - Unexpected [Element: <annotation [namespace:="" <a="" href="http://sed-ml.org/sed-ml/level1/version2">http://sed-ml.org/sed-ml/level1/version2]/>]</annotation>