— the global portal for all things SBML

Refactor validation

The inclusion of packages in SBML Level 3 creates a situation where the combinations of packages that may be included within a model starts to become exponential.

Starting with libSBML 5.2.0 we have therefor refactored all validation performed by libSBML:

  • SBMLValidator: This is the base class for all of validators. It provides the basic infrastructure. Special care has been taken in wrapping the class for the language bindings, and so it is possible to create custom validators from Java, C#, Python and Ruby. An example of its use would be:
   // validates an SBML document once with a specific validator
   var validator = new SBMLValidatorDerivedClass();

   // add a specific validator to the list of validators to be applied when
   // checkConsistency is called
  • SBMLInternalValidator: all existing validation has been moved from the SBMLDocument into this class.
  • SBMLExternalValidator: We foresee a position where it may be useful, or even necessary, to use external validators from within libSBML. We have not, as yet, come to a definite decision on how libSBML will handle validation of L3 packages. The SBMLExternalValidator writes the current document to a file, and invokes an external program. This program validates the file and writes out validation results in form of the [Online Validator Format]. This result is parsed back into SBMLErrors and added to the documents error log.

For code examples please see our code repository: [Code Examples]

Retrieved from ""

This page was last modified 02:15, 11 January 2012.

Please use our issue tracking system for any questions or suggestions about this website. This page was last modified 02:15, 11 January 2012.