Menu

#75 SBMLDocument.getNumErrors() return 0 even when having errors

closed-duplicate
nobody
None
5
2013-01-10
2013-01-10
Anonymous
No

My previous message (from the end of last year) just disappeared without any answer... So I retry to ask you the question.

I have an SBML model with errors in it. When I read it with the function:

SBMLReader reader = new SBMLReader();
SBMLDocument doc = reader.readSBML(sbml_file);

in the STDOUT console I well have error messages that are prompted telling me that this file has issues:

64 [main] ERROR org.sbml.jsbml.xml.parsers.SBMLCoreParser - " MODEL_GBiC" is not a valid identifier for this model.
65 [main] WARN org.sbml.jsbml.xml.parsers.SBMLCoreParser - Could not recognize the attribute 'id' on the element model. Please check the SBML specifications.
154 [main] ERROR org.sbml.jsbml.xml.parsers.SBMLCoreParser - "M_PIn-1_c" is not a valid identifier for this species.
154 [main] WARN org.sbml.jsbml.xml.parsers.SBMLCoreParser - Could not recognize the attribute 'id' on the element species. Please check the SBML specifications.
622 [main] ERROR org.sbml.jsbml.xml.parsers.SBMLCoreParser - "M_PIn-1_c" is not a valid identifier for this speciesReference.
623 [main] WARN org.sbml.jsbml.xml.parsers.SBMLCoreParser - Could not recognize the attribute 'species' on the element speciesReference. Please check the SBML specifications.
624 [main] ERROR org.sbml.jsbml.xml.parsers.SBMLCoreParser - "M_PIn-1_c" is not a valid identifier for this speciesReference.
624 [main] WARN org.sbml.jsbml.xml.parsers.SBMLCoreParser - Could not recognize the attribute 'species' on the element speciesReference. Please check the SBML specifications.
636 [main] ERROR org.sbml.jsbml.xml.parsers.SBMLCoreParser - "M_PIn-1_c" is not a valid identifier for this speciesReference.
636 [main] WARN org.sbml.jsbml.xml.parsers.SBMLCoreParser - Could not recognize the attribute 'species' on the element speciesReference. Please check the SBML specifications.
1482 [main] WARN org.sbml.jsbml.xml.parsers.SBMLCoreParser - No Species matches the speciesID '' of speciesReference.

However, if I ask the doc.getNumErrors() function, it return me 0...

This is only if I previously call the doc.checkConsistency() function to run the online validator that I have the correct result returned by doc.getNumErrors() (4 because 4 errors).

So my question is: How can I automatically detect if a model has issues without depending on the online validator (I want my program to be runned locally, without any internet connection dependency...)?
It should be possible because when reading it, the jsbml library correctly prompt error messages. However it does not seems to correctly keep a trace of them to return a correct result with the doc.getNumErrors() function...

Thanks for your answer

Best wishes and happy new year !

Discussion

  • Nicolas Rodriguez

    • status: open --> closed-duplicate
     
  • Nicolas Rodriguez

    Hello, your previous tracker was answered but moved to the features request tracker in fact.
    If you want to follow a tracker item, you will need to be logged into sourceforge before you fill in the tracker item, then you will receive a mail each time there is a changed to it.

    Duplicate of tracker item #3591047. see http://sourceforge.net/tracker/?func=detail&aid=3591047&group_id=279608&atid=1186779

     

Log in to post a comment.