valid model incorrect after reading / writing

7 views
Skip to first unread message

Michiel Karrenbelt

unread,
Apr 10, 2019, 6:14:37 AM4/10/19
to libsbml-development
somehow I have this issue with reading / writing / validating my SBML model.

I'm not sure about the origin, possibly because I'm taking a FBC package containing model and am turning it into a kinetic model without dropping the package?
I know how to patch it though, which is by removing all occurrences of 'sbml:' in the string representation. Even though the file is valid to begin with and doesn't contain 'sbml:' substrings, when reading it and writing it, it is there:

invalid_model = libsbml.writeSBMLToString(libsbml.readSBML('model.xml'))
valid_model = re.sub(r'sbml:', "", invalid_model)

I'd like to know if I am doing something I should not be doing, or whether this is something that should or can be fixed on the backend side. Attached you'll find the model.
model.xml

Frank T. Bergmann

unread,
Apr 10, 2019, 9:28:27 AM4/10/19
to libsbml-development
Hello Michiel, 

this comes about from the fact that you do declare the SBML namespace twice (and in this order): 



so when libSBML has to write the document out, it just goes through the list of namespaces in order to find the first SBML namespace, in order to use it as prefix for the model. Since your model does not use the sbml prefixed one, you could leave it out. Or if you would prefer your model to be used un-prefixed, then you would write the two namespaces in the order 

i hope this helps. 

thanks
Frank

P.S: and i probably should have added that information to the online validator tracker item :) 

Reply all
Reply to author
Forward
0 new messages