SBMLInternalValidator Class Reference
Inheritance diagram for SBMLInternalValidator:

List of all members.

Public Member Functions

unsigned int checkConsistency ()
 Performs consistency checking and validation on this SBML document.
unsigned int checkInternalConsistency ()
 Performs consistency checking on libSBML's internal representation of an SBML Model.
unsigned int checkL1Compatibility ()
 Performs a set of consistency checks on the document to establish whether it is compatible with SBML Level 1 and can be converted to Level 1.
unsigned int checkL2v1Compatibility ()
 Performs a set of consistency checks on the document to establish whether it is compatible with SBML Level 2 Version 1 and can be converted to Level 2 Version 1.
unsigned int checkL2v2Compatibility ()
 Performs a set of consistency checks on the document to establish whether it is compatible with SBML Level 2 Version 2 and can be converted to Level 2 Version 2.
unsigned int checkL2v3Compatibility ()
 Performs a set of consistency checks on the document to establish whether it is compatible with SBML Level 2 Version 3 and can be converted to Level 2 Version 3.
unsigned int checkL2v4Compatibility ()
 Performs a set of consistency checks on the document to establish whether it is compatible with SBML Level 2 Version 4 and can be converted to Level 2 Version 4.
unsigned int checkL3v1Compatibility ()
 Performs a set of consistency checks on the document to establish whether it is compatible with SBML Level 3 Version 1 and can be converted to Level 3 Version 1.
virtual void clearFailures ()
 Clears the Validator's list of failures.
virtual SBMLValidator * clone () const
 Creates and returns a deep copy of this validator.
unsigned char getApplicableValidators () const
unsigned char getConversionValidators () const
virtual SBMLDocument * getDocument ()
virtual const SBMLDocument * getDocument () const
SBMLErrorLog * getErrorLog ()
 Returns the list of errors or warnings logged during parsing, consistency checking, or attempted translation of this model.
SBMLError * getFailure (unsigned int n) const
 Returns the failure at the given index.
const std::vector< SBMLError > & getFailures () const
 Get the list of SBMLError objects (if any) logged as a result of running the validator.
const Model * getModel () const
 Returns the Model object stored in the SBMLDocument.
Model * getModel ()
 Returns the Model object stored in the SBMLDocument.
unsigned int getNumFailures () const
 Returns the local number of failures.
void logFailure (const SBMLError &msg)
 Adds the given failure to this list of Validators failures.
 SBMLInternalValidator ()
 Constructor.
 SBMLInternalValidator (const SBMLInternalValidator &)
 Copy constructor.
void setApplicableValidators (unsigned char appl)
 Set the current list of validators to be applied.
void setConsistencyChecks (SBMLErrorCategory_t category, bool apply)
 Controls the consistency checks that are performed when SBMLDocument::checkConsistency() is called.
void setConsistencyChecksForConversion (SBMLErrorCategory_t category, bool apply)
 Controls the consistency checks that are performed when SBMLDocument::setLevelAndVersion() is called.
void setConversionValidators (unsigned char appl)
 Set the current list of conversion validators to be applied.
virtual int setDocument (const SBMLDocument *doc)
 Sets the current SBML document.
unsigned int validate (const SBMLDocument &d)
 Validates the given SBMLDocument.
unsigned int validate (const std::string &filename)
 Validates the given SBMLDocument.
virtual unsigned int validate ()
 the actual conversion

Protected Attributes

unsigned char mApplicableValidators
unsigned char mApplicableValidatorsForConversion

Constructor & Destructor Documentation


Member Function Documentation

Performs consistency checking and validation on this SBML document.

If this method returns a nonzero value (meaning, one or more consistency checks have failed for SBML document), the failures may be due to warnings or errors. Callers should inspect the severity flag in the individual SBMLError objects returned by SBMLDocument::getError() to determine the nature of the failures.

Returns:
the number of failed checks (errors) encountered.
See also:
SBMLDocument::checkInternalConsistency()

Performs consistency checking on libSBML's internal representation of an SBML Model.

Callers should query the results of the consistency check by calling SBMLDocument::getError().

Returns:
the number of failed checks (errors) encountered.

The distinction between this method and SBMLDocument::checkConsistency() is that this method reports on fundamental syntactic and structural errors that violate the XML Schema for SBML; by contrast, SBMLDocument::checkConsistency() performs more elaborate model verifications and also validation according to the validation rules written in the appendices of the SBML Level 2 Versions 2–4 specification documents.

See also:
SBMLDocument::checkConsistency()

Performs a set of consistency checks on the document to establish whether it is compatible with SBML Level 1 and can be converted to Level 1.

Callers should query the results of the consistency check by calling SBMLDocument::getError().

Returns:
the number of failed checks (errors) encountered.

Performs a set of consistency checks on the document to establish whether it is compatible with SBML Level 2 Version 1 and can be converted to Level 2 Version 1.

Callers should query the results of the consistency check by calling SBMLDocument::getError().

Returns:
the number of failed checks (errors) encountered.

Performs a set of consistency checks on the document to establish whether it is compatible with SBML Level 2 Version 2 and can be converted to Level 2 Version 2.

Callers should query the results of the consistency check by calling SBMLDocument::getError().

Returns:
the number of failed checks (errors) encountered.

Performs a set of consistency checks on the document to establish whether it is compatible with SBML Level 2 Version 3 and can be converted to Level 2 Version 3.

Callers should query the results of the consistency check by calling SBMLDocument::getError().

Returns:
the number of failed checks (errors) encountered.

Performs a set of consistency checks on the document to establish whether it is compatible with SBML Level 2 Version 4 and can be converted to Level 2 Version 4.

Callers should query the results of the consistency check by calling SBMLDocument::getError().

Returns:
the number of failed checks (errors) encountered.

Performs a set of consistency checks on the document to establish whether it is compatible with SBML Level 3 Version 1 and can be converted to Level 3 Version 1.

Callers should query the results of the consistency check by calling SBMLDocument::getError().

Returns:
the number of failed checks (errors) encountered.
void SBMLValidator::clearFailures ( ) [virtual, inherited]

Clears the Validator's list of failures.

If you are validating multiple SBML documents with the same Validator, call this method after you have processed the list of failures from the last Validation run and before validating the next document.

Creates and returns a deep copy of this validator.

Returns:
a (deep) copy of this validator.

Reimplemented from SBMLValidator.

Returns:
the current list of selected validators
Returns:
the current list of selected validators for conversion
SBMLDocument * SBMLValidator::getDocument ( ) [virtual, inherited]
Returns:
the current SBML document
const SBMLDocument * SBMLValidator::getDocument ( ) const [virtual, inherited]
Returns:
a const reference to the current SBML document

Returns the list of errors or warnings logged during parsing, consistency checking, or attempted translation of this model.

Returns:
the SBMLErrorLog used for the SBMLDocument
See also:
SBMLDocument::getNumErrors()
SBMLError * SBMLValidator::getFailure ( unsigned int  n) const [inherited]

Returns the failure at the given index.

Parameters:
nthe zero based index of failures
Returns:
the failure at the given index
const std::vector< SBMLError > & SBMLValidator::getFailures ( ) const [inherited]

Get the list of SBMLError objects (if any) logged as a result of running the validator.

Returns:
a list of failures logged during validation.
const Model * SBMLValidator::getModel ( ) const [inherited]

Returns the Model object stored in the SBMLDocument.

It is important to note that this method does not create a Model instance. The model in the SBMLDocument must have been created at some prior time, for example using SBMLDocument::createModel() or SBMLDocument::setModel(). This method returns NULL if a model does not yet exist.

Returns:
the Model contained in the SBMLDocument.
Model * SBMLValidator::getModel ( ) [inherited]

Returns the Model object stored in the SBMLDocument.

It is important to note that this method does not create a Model instance. The model in the SBMLDocument must have been created at some prior time, for example using SBMLDocument::createModel() or SBMLDocument::setModel(). This method returns NULL if a model does not yet exist.

Returns:
the Model contained in the SBMLDocument.
unsigned int SBMLValidator::getNumFailures ( ) const [inherited]

Returns the local number of failures.

This method returns the number of failures logged by this validator (that is it does not include the number of the documents error log).

Returns:
the number of errors logged by this validator.
void SBMLValidator::logFailure ( const SBMLError &  msg) [inherited]

Adds the given failure to this list of Validators failures.

void SBMLInternalValidator::setApplicableValidators ( unsigned char  appl)

Set the current list of validators to be applied.

Parameters:
applthe mask of validators to be applied

Controls the consistency checks that are performed when SBMLDocument::checkConsistency() is called.

This method works by adding or subtracting consistency checks from the set of all possible checks that SBMLDocument::checkConsistency() knows how to perform. This method may need to be called multiple times in order to achieve the desired combination of checks. The first argument (category) in a call to this method indicates the category of consistency/error checks that are to be turned on or off, and the second argument (apply, a boolean) indicates whether to turn it on (value of true) or off (value of false).

  • LIBSBML_CAT_GENERAL_CONSISTENCY: Correctness and consistency of specific SBML language constructs. Performing this set of checks is highly recommended. With respect to the SBML specification, these concern failures in applying the validation rules numbered 2xxxx in the Level 2 Versions 2–4 and Level 3 Version 1 specifications.

  • LIBSBML_CAT_IDENTIFIER_CONSISTENCY: Correctness and consistency of identifiers used for model entities. An example of inconsistency would be using a species identifier in a reaction rate formula without first having declared the species. With respect to the SBML specification, these concern failures in applying the validation rules numbered 103xx in the Level 2 Versions 2–4 and Level 3 Version 1 specifications.

  • LIBSBML_CAT_UNITS_CONSISTENCY: Consistency of measurement units associated with quantities in a model. With respect to the SBML specification, these concern failures in applying the validation rules numbered 105xx in the Level 2 Versions 2–4 and Level 3 Version 1 specifications.

  • LIBSBML_CAT_MATHML_CONSISTENCY: Syntax of MathML constructs. With respect to the SBML specification, these concern failures in applying the validation rules numbered 102xx in the Level 2 Versions 2–4 and Level 3 Version 1 specifications.

  • LIBSBML_CAT_SBO_CONSISTENCY: Consistency and validity of SBO identifiers (if any) used in the model. With respect to the SBML specification, these concern failures in applying the validation rules numbered 107xx in the Level 2 Versions 2–4 and Level 3 Version 1 specifications.

  • LIBSBML_CAT_OVERDETERMINED_MODEL: Static analysis of whether the system of equations implied by a model is mathematically overdetermined. With respect to the SBML specification, this is validation rule #10601 in the Level 2 Versions 2–4 and Level 3 Version 1 specifications.

  • LIBSBML_CAT_MODELING_PRACTICE: Additional checks for recommended good modeling practice. (These are tests performed by libSBML and do not have equivalent SBML validation rules.)

By default, all validation checks are applied to the model in an SBMLDocument object unless SBMLDocument::setConsistencyChecks() is called to indicate that only a subset should be applied. Further, this default (i.e., performing all checks) applies separately to each new SBMLDocument object created. In other words, each time a model is read using SBMLReader::readSBML(), SBMLReader::readSBMLFromString(), or the global functions readSBML() and readSBMLFromString(), a new SBMLDocument is created and for that document, a call to SBMLDocument::checkConsistency() will default to applying all possible checks. Calling programs must invoke SBMLDocument::setConsistencyChecks() for each such new model if they wish to change the consistency checks applied.

Parameters:
categorya value drawn from the set of SBML error categoriesindicating the consistency checking/validation to be turned on or off.
applya boolean indicating whether the checks indicated by category should be applied or not.
See also:
SBMLDocument::checkConsistency()

Controls the consistency checks that are performed when SBMLDocument::setLevelAndVersion() is called.

This method works by adding or subtracting consistency checks from the set of all possible checks that may be performed to avoid conversion to or from an invalid document. This method may need to be called multiple times in order to achieve the desired combination of checks. The first argument (category) in a call to this method indicates the category of consistency/error checks that are to be turned on or off, and the second argument (apply, a boolean) indicates whether to turn it on (value of true) or off (value of false).

  • LIBSBML_CAT_GENERAL_CONSISTENCY: Correctness and consistency of specific SBML language constructs. Performing this set of checks is highly recommended. With respect to the SBML specification, these concern failures in applying the validation rules numbered 2xxxx in the Level 2 Versions 2–4 and Level 3 Version 1 specifications.

  • LIBSBML_CAT_IDENTIFIER_CONSISTENCY: Correctness and consistency of identifiers used for model entities. An example of inconsistency would be using a species identifier in a reaction rate formula without first having declared the species. With respect to the SBML specification, these concern failures in applying the validation rules numbered 103xx in the Level 2 Versions 2–4 and Level 3 Version 1 specifications.

  • LIBSBML_CAT_UNITS_CONSISTENCY: Consistency of measurement units associated with quantities in a model. With respect to the SBML specification, these concern failures in applying the validation rules numbered 105xx in the Level 2 Versions 2–4 and Level 3 Version 1 specifications.

  • LIBSBML_CAT_MATHML_CONSISTENCY: Syntax of MathML constructs. With respect to the SBML specification, these concern failures in applying the validation rules numbered 102xx in the Level 2 Versions 2–4 and Level 3 Version 1 specifications.

  • LIBSBML_CAT_SBO_CONSISTENCY: Consistency and validity of SBO identifiers (if any) used in the model. With respect to the SBML specification, these concern failures in applying the validation rules numbered 107xx in the Level 2 Versions 2–4 and Level 3 Version 1 specifications.

  • LIBSBML_CAT_OVERDETERMINED_MODEL: Static analysis of whether the system of equations implied by a model is mathematically overdetermined. With respect to the SBML specification, this is validation rule #10601 in the Level 2 Versions 2–4 and Level 3 Version 1 specifications.

  • LIBSBML_CAT_MODELING_PRACTICE: Additional checks for recommended good modeling practice. (These are tests performed by libSBML and do not have equivalent SBML validation rules.)

By default, all validation checks are applied to the model in an SBMLDocument object unless SBMLDocument::setConsistencyChecks() is called to indicate that only a subset should be applied. Further, this default (i.e., performing all checks) applies separately to each new SBMLDocument object created. In other words, each time a model is read using SBMLReader::readSBML(), SBMLReader::readSBMLFromString(), or the global functions readSBML() and readSBMLFromString(), a new SBMLDocument is created and for that document, a call to SBMLDocument::checkConsistency() will default to applying all possible checks. Calling programs must invoke SBMLDocument::setConsistencyChecks() for each such new model if they wish to change the consistency checks applied.

Parameters:
categorya value drawn from the set of SBML error categoriesindicating the consistency checking/validation to be turned on or off.
applya boolean indicating whether the checks indicated by category should be applied or not.
See also:
SBMLDocument::setLevelAndVersion()
void SBMLInternalValidator::setConversionValidators ( unsigned char  appl)

Set the current list of conversion validators to be applied.

Parameters:
applthe mask of validators to be applied
int SBMLValidator::setDocument ( const SBMLDocument *  doc) [virtual, inherited]

Sets the current SBML document.

Parameters:
docthe document to use for this validation
Returns:
status code
unsigned int SBMLValidator::validate ( const SBMLDocument &  d) [inherited]

Validates the given SBMLDocument.

Failures logged during validation may be retrieved via getFailures().

Returns:
the number of validation errors that occurred.
unsigned int SBMLValidator::validate ( const std::string &  filename) [inherited]

Validates the given SBMLDocument.

Failures logged during validation may be retrieved via getFailures().

Returns:
the number of validation errors that occurred.
unsigned int SBMLInternalValidator::validate ( ) [virtual]

the actual conversion

Returns:
status code represeting success/failure/conversion impossible

Reimplemented from SBMLValidator.


Member Data Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines