=head1 NAME LibSBML -- interface to the libSBML library =head1 SYNOPSIS # Change the following path to wherever your copy is installed. use lib '/usr/local/lib/perl5/site_perl'; use File::Spec; use LibSBML; use strict; my $file = File::Spec->rel2abs('FOO.xml'); my $rd = new LibSBML::SBMLReader; my $document = $rd->readSBML($file); # Check for reading errors: my $errors = $document->getNumErrors(); # Print errors, if any, to stderr. if ($errors > 0) { $document->printErrors(); die "Errors while reading $file"; } my $model = $document->getModel() || die "No Model found in $file"; ... =head1 DESCRIPTION The LibSBML.pm package gives access to almost all functions in libSBML (http://sbml.org). The Perl wrapper is generated using SWIG http://www.swig.org/ with relatively little manual intervention. =head1 AUTHORS Christoph Flamm Rainer Machne =head1 FUNCTION INDEX =over 8 =item getLibSBMLVersion Returns the libSBML version as an integer: version 1.2.3 becomes 10203. Returns the libSBML version as an integer: version 1.2.3 becomes 10203. =item getLibSBMLDottedVersion Returns the libSBML version as a string of the form "1.2.3". Returns the libSBML version as a string of the form "1.2.3". =item getLibSBMLVersionString Returns the libSBML version as a string: version 1.2.3 becomes "10203". Returns the libSBML version as a string: version 1.2.3 becomes "10203". =back =head2 SBMLReader Methods for reading SBML from files and text strings. @htmlinclude libsbml-not-sbml-warning.html The SBMLReader class provides the main interface for reading SBML content from files and strings. The methods for reading SBML all return an SBMLDocument object representing the results. In the case of failures (such as if the SBML contains errors or a file cannot be read), the errors will be recorded with the SBMLErrorLog object kept in the SBMLDocument returned by SBMLReader. Callers should check for errors and warnings using the methods for this purpose provided on SBMLDocument. For convenience as well as easy access from other languages besides C++, this file also defines two global functions, readSBML() and readSBMLFromString(). They are equivalent to creating an SBMLReader object and then calling the @if clike SBMLReader::readSBML() @endif@if java SBMLReader::readSBML(String filename) @endif or @if clike SBMLReader::readSBMLFromString() @endif@if java SBMLReader::readSBMLFromString(String xml) @endif methods, respectively. =over =item SBMLReader::SBMLReader Creates a new SBMLReader and returns it. =item SBMLReader::readSBML Reads an SBML document from a file. If the file named C does not exist or its content is not valid SBML, one or more errors will be logged with the SBMLDocument object returned by this method. Callers can use the methods on SBMLDocument such as SBMLDocument::getNumErrors() and @if clike SBMLDocument::getError() @endif@if java SBMLDocument::getError(long n) @endif to get the errors. The object returned by @if clike SBMLDocument::getError() @endif@if java SBMLDocument::getError(long n) @endif is an SBMLError object, and it has methods to get the error code, category, and severity level of the problem, as well as a textual description of the problem. The possible severity levels range from informational messages to fatal errors; see the documentation for SBMLError for more information. If the file C could not be read, the file-reading error will appear first. The error code can provide a clue about what happened. For example, a file might be unreadable (either because it does not actually exist or because the user does not have the necessary access priviledges to read it) or some sort of file operation error may have bee reported by the underlying operating system. Callers can check for these situations using code such as the following: C SBMLReader reader = new SBMLReader(); SBMLDocument doc = reader.readSBML(filename); if (doc->getNumErrors() E 0) { if (doc->getError(0)->getId() == XMLError::FileUnreadable) { // Handle case of unreadable file here. } else if (doc->getError(0)->getId() == XMLError::FileOperationError) { // Handle case of other file error here. } else { // Handle other cases -- see error codes defined in XMLErrorCode_t // for other possible cases to check. } } @endcode If the given filename ends with the suffix C<">.gz" (for example, @c "myfile.xml.gz"), the file is assumed to be compressed in I format and will be automatically decompressed upon reading. Similarly, if the given filename ends with C<">.zip" or C<">.bz2", the file is assumed to be compressed in I or I format (respectively). Files whose names lack these suffixes will be read uncompressed. Note that if the file is in I format but the archive contains more than one file, only the first file in the archive will be read and the rest ignored. @param filename the name or full pathname of the file to be read. Returns a pointer to the SBMLDocument created from the SBML content. @see SBMLError @note LibSBML versions 2.x and 3.x behave differently in error handling in several respects. One difference is how early some errors are caught and whether libSBML continues processing a file in the face of some early errors. In general, libSBML 3.x stops parsing SBML inputs sooner than libSBML 2.x in the face of XML errors because the errors may invalidate any further SBML content. For example, a missing XML declaration at the beginning of the file was ignored by libSBML 2.x but in version 3.x, it will cause libSBML to stop parsing the rest of the input altogether. While this behavior may seem more severe and intolerant, it was necessary in order to provide uniform behavior regardless of which underlying XML parser (Expat, Xerces, libxml2) is being used by libSBML. The XML parsers themselves behave differently in their error reporting, and sometimes libSBML has to resort to the lowest common denominator. @note To read a gzip/zip file, libSBML needs to be configured and linked with the zlib library at compile time. It also needs to be linked with the bzip2 library to read files in I format. (Both of these are the default configurations for libSBML.) Errors about unreadable files will be logged if a compressed filename is given and libSBML was I linked with the corresponding required library. @note SBMLReader::hasZlib() and SBMLReader::hasBzip2() can be used to check whether libSBML has been linked with each library. =item SBMLReader::readSBMLFromString Reads an SBML document from the given XML string. This method is flexible with respect to the presence of an XML declaration at the beginning of the string. In particular, if the string in C does not begin with the XML declaration C<<?xml version='1.0' encoding='UTF-8'?>>, then this method will automatically prepend the declaration to C. This method will log a fatal error if the content given in the parameter C is not SBML. See the method documentation for @if clike SBMLReader::readSBML() @endif@if java SBMLReader::readSBML(String filename) @endif for an example of code for testing the returned error code. @param xml a string containing a full SBML model Returns a pointer to the SBMLDocument created from the SBML content. @if clike @see SBMLReader::readSBML() @endif@if java @see SBMLReader::readSBML(String filename) @endif =item SBMLReader::hasZlib Predicate returning C or C depending on whether libSBML is linked with zlib at compile time. Returns C if zlib is linked, C otherwise. =item SBMLReader::hasBzip2 Predicate returning C or C depending on whether libSBML is linked with bzip2 at compile time. Returns C if bzip2 is linked, C otherwise. =item SBMLReader::readInternal Used by readSBML() and readSBMLFromString(). @docnote The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be I for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation. @deprecated libSBML internal =item readSBML Reads an SBML document from the given file C. If C does not exist, or it is not an SBML file, an error will be logged in the error log of the SBMLDocument object returned by this method. Calling programs can inspect this error log to determine the nature of the problem. Please refer to the definition of SBMLDocument for more information about the error reporting mechanism. Returns a pointer to the SBMLDocument read. =item readSBMLFromString Reads an SBML document from a string assumed to be in XML format. If the string does not begin with XML declaration, @verbatim @endverbatim an XML declaration string will be prepended. This method will report an error if the given string C is not SBML. The error will be logged in the error log of the SBMLDocument object returned by this method. Calling programs can inspect this error log to determine the nature of the problem. Please refer to the definition of SBMLDocument for more information about the error reporting mechanism. Returns a pointer to the SBMLDocument read. =back =head2 SBMLWriter Methods for writing SBML to files and text strings. @htmlinclude libsbml-not-sbml-warning.html The SBMLWriter class is the converse of SBMLReader, and provides the main interface for serializing SBML models into XML and writing the result to files and text strings. The methods for writing SBML all take an SBMLDocument object and a destination. They return a boolean value to indicate success or failure. =over =item SBMLWriter::SBMLWriter Creates a new SBMLWriter. =item SBMLWriter::setProgramName Sets the name of this program, i.e., the program that is about to write out the SBMLDocument. If the program name and version are set (setProgramVersion()), the following XML comment, intended for human consumption, will be written at the beginning of the document: @verbatim @endverbatim @param name the name of this program (where "this program" refers to program in which libSBML is embedded, not libSBML itself!) @see setProgramVersion(const std::string& version) =item SBMLWriter::setProgramVersion Sets the version of this program, i.e., the program that is about to write out the SBMLDocument. If the program version and name are set (setProgramName()), the following XML comment, intended for human consumption, will be written at the beginning of the document: @verbatim @endverbatim @param version the version of this program (where "this program" refers to program in which libSBML is embedded, not libSBML itself!) @see setProgramName(const std::string& name) =item SBMLWriter::writeSBML Writes the given SBML document to filename. If the given filename ends with the suffix C<">.gz" (for example, @c "myfile.xml.gz"), libSBML assumes the caller wants the file to be written compressed in I. Similarly, if the given filename ends with C<">.zip" or C<">.bz2", libSBML assumes the caller wants the file to be compressed in I or I format (respectively). Files whose names lack these suffixes will be written uncompressed. Special considerations for the zip format: If the given filename ends with C<">.zip", the file placed in the zip archive will have the suffix C<">.xml" or C<">.sbml". For example, the file in the zip archive will be named C<"test>.xml" if the given filename is C<"test>.xml.zip" or C<"test>.zip". Similarly, the filename in the archive will be C<"test>.sbml" if the given filename is @c "test.sbml.zip". @note To write a gzip/zip file, libSBML needs to be configured and linked with the zlib library at compile time. It also needs to be linked with the bzip2 library to write files in I format. (Both of these are the default configurations for libSBML.) Errors about unreadable files will be logged and this method will return C if a compressed filename is given and libSBML was I linked with the corresponding required library. @note SBMLReader::hasZlib() and SBMLReader::hasBzip2() can be used to check whether libSBML has been linked with each library. @param d the SBML document to be written @param filename the name or full pathname of the file where the SBML is to be written. Returns C on success and C if the filename could not be opened for writing. =item SBMLWriter::writeSBML Writes the given SBML document to the output stream. @param d the SBML document to be written @param stream the stream object where the SBML is to be written. Returns C on success and C if one of the underlying parser components fail (rare). =item SBMLWriter::writeToString Writes the given SBML document to an in-memory string and returns a pointer to it. The string is owned by the caller and should be freed (with C()) when no longer needed. @param d the SBML document to be written Returns the string on success and C<0> if one of the underlying parser components fail. =item SBMLWriter::hasZlib Predicate returning C or C depending on whether underlying libSBML is linked with zlib. LibSBML supports reading and writing files compressed with either bzip2 or zip/gzip compression. The facility depends on libSBML having been compiled with the necessary support libraries. This method allows a calling program to inquire whether that is the case for the copy of libSBML it is running. Returns C if libSBML is linked with zlib, C otherwise. =item SBMLWriter::hasBzip2 Predicate returning C or C depending on whether underlying libSBML is linked with bzip2. LibSBML supports reading and writing files compressed with either bzip2 or zip/gzip compression. The facility depends on libSBML having been compiled with the necessary support libraries. This method allows a calling program to inquire whether that is the case for the copy of libSBML it is running. Returns C if libSBML is linked with bzip2, C otherwise. =item SBMLWriter::hasBzip2 Predicate returning C or C depending on whether underlying libSBML is linked with bzip2. LibSBML supports reading and writing files compressed with either bzip2 or zip/gzip compression. The facility depends on libSBML having been compiled with the necessary support libraries. This method allows a calling program to inquire whether that is the case for the copy of libSBML it is running. Returns C if libSBML is linked with bzip2, C otherwise. @deprecated libSBML internal =item SBMLWriter::hasBzip2 Predicate returning C or C depending on whether underlying libSBML is linked with bzip2. LibSBML supports reading and writing files compressed with either bzip2 or zip/gzip compression. The facility depends on libSBML having been compiled with the necessary support libraries. This method allows a calling program to inquire whether that is the case for the copy of libSBML it is running. Returns C if libSBML is linked with bzip2, C otherwise. @deprecated libSBML internal =item writeSBML Writes the given SBML document to filename. This convenience function is functionally equivalent to: SBMLWriter_writeSBML(SBMLWriter_create(), d, filename); Returns non-zero on success and zero if the filename could not be opened for writing. =item writeSBMLToString Writes the given SBML document to an in-memory string and returns a pointer to it. The string is owned by the caller and should be freed (with free()) when no longer needed. This convenience function is functionally equivalent to: SBMLWriter_writeSBMLToString(SBMLWriter_create(), d); Returns the string on success and NULL if one of the underlying parser components fail (rare). =item SBMLTypeCode_toString This method takes an SBML type code and returns a string representing the code. @if clike LibSBML attaches an identifying code to every kind of SBML object. These are known as SBML type codes. The set of possible type codes is defined in the enumeration #SBMLTypeCode_t. The names of the type codes all begin with the characters C. @endif@if java LibSBML attaches an identifying code to every kind of SBML object. These are known as SBML type codes. In other languages, the set of type codes is stored in an enumeration; in the Java language interface for libSBML, the type codes are defined as static integer constants in interface class {@link libsbmlConstants}. The names of the type codes all begin with the characters C. @endif This method takes a type code as argument, and returns a string name corresponding to that code. For example, passing it the type code C will return the string "C". Returns a human readable name for the given SBMLTypeCode_t. @note The caller does not own the returned string and is therefore not allowed to modify it. =back =head2 SBase LibSBML implementation of SBase, the base class of all SBML objects. Most components in SBML are derived from a single abstract base type, SBase. In addition to serving as the parent class for most other classes of objects in SBML, this base type is designed to allow a modeler or a software package to attach arbitrary information to each major element or list in an SBML model. SBase has an optional subelement called "notes". It is intended to serve as a place for storing optional information intended to be seen by humans. An example use of the "notes" element would be to contain formatted user comments about the model element in which the "notes" element is enclosed. There are certain conditions on the XHTML content permitted inside the "notes" element; these are described separately below. SBase has another optional subelement called "annotation". Whereas the "notes" element described above is a container for content to be shown directly to humans, the "annotation" element is a container for optional software-generated content I meant to be shown to humans. The element's content type is XML type C, allowing essentially arbitrary data content. SBML places only a few restrictions on the organization of the content; these are intended to help software tools read and write the data as well as help reduce conflicts between annotations added by different tools. They are described separately below. It is worth pointing out that the "annotation" element in the definition of SBase exists in order that software developers may attach optional application-specific data to the elements in an SBML model. However, it is important that this facility not be misused. In particular, it is critical that data essential to a model definition or that can be encoded in existing SBML elements is not stored in "annotation". Parameter values, functional dependencies between model elements, etc., should not be recorded as annotations. It is crucial to keep in mind the fact that data placed in annotations can be freely ignored by software applications. If such data affects the interpretation of a model, then software interoperability is greatly impeded. Beginning with SBML Level 2, SBase also has an optional attribute named "metaid" for supporting metadata annotations using RDF (Resource Description Format). The attribute value has the data type XML ID, the XML identifier type, which means each "metaid" value must be globally unique within an SBML file. (Importantly, this uniqueness criterion applies across any attribute with type XML ID, not just the "metaid" attribute used by SBML—something to be aware of if your application-specific XML content inside the "annotation" subelement happens to use XML ID.) The "metaid" value serves to identify a model component for purposes such as referencing that component from metadata placed within "annotation" subelements. Beginning with SBML Level 2 Version 3, SBase also has an optional attribute named "sboTerm" for supporting the use of the Systems Biology Ontology. In SBML proper, the data type of the attribute is a string of the form SBO:NNNNNNN, where NNNNNNN is a seven digit integer number; libSBML simplifies the representation by only storing the NNNNNNN integer portion. Thus, in libSBML, the "sboTerm" attribute on SBase has data type C, and SBO identifiers are stored simply as integers. SBO terms are a type of optional annotation, and each different class of SBML object derived from SBase imposes its own requirements about the values permitted for "sboTerm". Please consult the SBML Level 2 Version 4 specification for more information about the use of SBO and the "sboTerm" attribute. Finally, note that, in the list of methods on SBase, there is no public constructor because SBase is an abstract class. The constructors reside in the subclasses derived from SBase. @section sbase-notes Requirements for the content of the "notes" subelement The content of "notes" elements must be in XHTML 1.0 format. (Plain HTML would not be usable because whatever appears inside the "notes" element must be compatible with XML, which HTML is not, and in any case, the requirement for using XHTML does not prevent users from entering plain-text content ,which they can do using the standard C<<pre> ... </pre>> elements of [X]HTML.) The XML content of a "notes" subelement must declare the use of the XHTML XML namespace. This can be done in multiple ways. One way is to place a namespace declaration for the appropriate namespace URI (which for XHTML is "http://www.w3.org/1999/xhtml") on the top-level C element and then reference the namespace in the "notes" element content using a prefix. The following example illustrates this approach: @verbatim ... A Simple Mitotic Oscillator A minimal cascade model for the mitotic oscillator involving cyclin and cdc2 kinase ... @endverbatim Another approach is to declare the XHTML namespace within the "notes" element content itself, as in the following example: @verbatim ...

A Simple Mitotic Oscillator

A minimal cascade model for the mitotic oscillator involving cyclin and cdc2 kinase

... @endverbatim The C declaration on @c body as shown above changes the default XML namespace within it, such that all of its content is by default in the XHTML namespace. This is a particularly convenient approach because it obviates the need to prefix every element with a namespace prefix (i.e., C in the previous case). Other approaches are also possible. SBML does not require the content of the "notes" subelement to be any particular XHTML element; the content can be almost any well-formed XHTML content. SBML Level 2 Versions 2, 3 and 4 added some small restrictions and clarifications for the allowable content in order to promote greater interoperability between software tools. The first restriction comes from the requirements of XML: the "notes" element must not contain an XML declaration nor a DOCTYPE declaration. That is, "notes" must I contain @verbatim @endverbatim nor (where the following is only one specific example of a DOCTYPE declaration) @verbatim @endverbatim The second restriction is intended to balance freedom of content with the complexity of implementing software that can interpret the content. The content of the "notes" subelement in SBML can consist only of the following possibilities: =over =item A complete XHTML document (minus the XML and DOCTYPE declarations, of course), that is, XHTML content beginning with the C tag. @verbatim ... @endverbatim =item The C element from an XHTML document. The following is an example skeleton: @verbatim ... @endverbatim =item Any XHTML content that would be permitted within a C element. If this consists of multiple elements, each one must declare the XML namespace separately. The following is an example fragment: @verbatim

...

...

@endverbatim =back Another way to summarize the restrictions above is simply to say that the content of an SBML "notes" element can be only be a complete C element, a C element, or whatever is permitted inside a C element. In practice, this does not limit in any meaningful way what can be placed inside a "notes" element; for example, if an application or modeler wants to put a complete XHTML page, including a C element, it can be done by putting in everything starting with the @c html container. However, the restrictions above do make it somewhat simpler to write software that can read and write the "notes" content. @section sbase-annotation Requirements for the content of the "annotation" subelement At the outset, software developers should keep in mind that multiple software tools may attempt to read and write annotation content. To reduce the potential for collisions between annotations written by different applications, SBML Level 2 stipulates that tools must use XML namespaces to specify the intended vocabulary of every annotation. The application's developers must choose a URI (Universal Resource Identifier) reference that uniquely identifies the vocabulary the application will use, and a prefix string for the annotations. A important requirement is that application-specific annotation data is entirely contained inside a single top-level element within the SBML "annotation" subelement. SBML Level 2 Versions 2, 3 and 4 place the following restrictions on annotations: =over =item Within a given SBML "annotation" element, there can only be one top-level element using a given namespace. An annotation element can contain multiple top-level elements but each must be in a different namespace. =item No top-level element in an "annotation" may use an SBML XML namespace, either explicitly by referencing one of the SBML XML namespace URIs or implicitly by failing to specify any namespace on the annotation. =item The ordering of top-level elements within a given "annotation" element is not significant. An application should not expect that its annotation content appears first in the "annotation" element, nor in any other particular location. Moreover, the ordering of top-level annotation elements may be changed by different applications as they read and write the same SBML file. =back The use of XML namespaces in this manner is intended to improve the ability of multiple applications to place annotations on SBML model elements with reduced risks of interference or name collisions. Annotations stored by different simulation packages can therefore coexist in the same model definition. The rules governing the content of "annotation" elements are designed to enable applications to easily add, change, and remove their annotations from SBML elements while simultaneously preserving annotations inserted by other applications when mapping SBML from input to output. As a further simplification for developers of software and to improve software interoperability, applications are only required to preserve other annotations (i.e., annotations they do not recognize) when those annotations are self-contained entirely within "annotation", complete with namespace declarations. The following is an example: @verbatim ... content in the namespace identified by "URI" ... @endverbatim Some more examples hopefully will make these points more clear. The next example is invalid because it contains a top-level element in the SBML XML namespace—this happens because no namespace is declared for the C<<cytoplasm>> element, which means by default it falls into the enclosing SBML namespace: @verbatim @endverbatim The following example is also invalid, this time because it contains two top-level elements using the same XML namespace. Note that it does not matter that these are two different top-level elements (C<<nodecolors>> and C<<textcolors>>); what matters is that these separate elements are both in the same namespace rather than having been collected and placed inside one overall container element for that namespace. @verbatim @endverbatim On the other hand, the following example is valid: @verbatim WS2002 @endverbatim It is worth keeping in mind that although XML namespace names must be URIs, they are (like all XML namespace names) not required to be directly usable in the sense of identifying an actual, retrieval document or resource on the Internet. URIs such as C<"http://www.mysim.org/"> may appear as though they are (e.g.) Internet addresses, but there are not the same thing. This style of URI strings, using a domain name and other parts, is only a simple and commonly-used way of creating a unique name string. @section sbase-miriam Standard format for annotations linking data resources SBML Level 2 Versions 2, 3 and 4 define a proposed regular format for encoding two particular categories of annotations: (a) references to controlled vocabulary terms and database identifiers which define and describe biological and biochemical entities in a model; and (b) descriptions of the provenance of a model, including its author(s) and modification history. =over =item SBase::accept Accepts the given SBMLVisitor for this instance of SBase. @param v the SBMLVisitor instance to be used. Returns the result of calling C. =item SBase::clone Creates and returns a deep copy of this SBase object. Returns a (deep) copy of this SBase object =item SBase::getMetaId Returns the value of the "metaid" attribute of this object. The optional attribute named "metaid", present on every major SBML component type, is for supporting metadata annotations using RDF (Resource Description Format). The attribute value has the data type XML ID, the XML identifier type, which means each "metaid" value must be globally unique within an SBML file. (Importantly, this uniqueness criterion applies across any attribute with type XML ID, not just the "metaid" attribute used by SBML—something to be aware of if your application-specific XML content inside the "annotation" subelement happens to use XML ID.) The "metaid" value serves to identify a model component for purposes such as referencing that component from metadata placed within "annotation" subelements. Returns the metaid of this SBML object. @see isSetMetaId() @see setMetaId(const std::string& metaid) =item SBase::getMetaId Returns the value of the "metaid" attribute of this object. The optional attribute named "metaid", present on every major SBML component type, is for supporting metadata annotations using RDF (Resource Description Format). The attribute value has the data type XML ID, the XML identifier type, which means each "metaid" value must be globally unique within an SBML file. (Importantly, this uniqueness criterion applies across any attribute with type XML ID, not just the "metaid" attribute used by SBML—something to be aware of if your application-specific XML content inside the "annotation" subelement happens to use XML ID.) The "metaid" value serves to identify a model component for purposes such as referencing that component from metadata placed within "annotation" subelements. Returns the metaid of this SBML object. @see isSetMetaId() @see setMetaId(const std::string& metaid) =item SBase::getId Returns the value of the "id" attribute of this object, if it has one. Most (but not all) objects in SBML include two common attributes: "id" and "name". The identifier given by an object's "id" attribute value is used to identify the object within the SBML model definition. Other objects can refer to the component using this identifier. The data type of "id" is always either C or C, depending on the object in question. Both data types are defined as follows: C letter ::= 'a'..'z','A'..'Z' digit ::= '0'..'9' idChar ::= letter | digit | '_' SId ::= ( letter | '_' ) idChar @endcode The equality of C and C type values in SBML is determined by an exact character sequence match; i.e., comparisons of these identifiers must be performed in a case-sensitive manner. This applies to all uses of C and C. Returns the id of this SBML object. @note The fact that the value of attribute "id" is defined on the SBase parent class object is a convenience provided by libSBML, and B. This libSBML implementation of SBase allows client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have identifiers), but beware that not all SBML object classes provide an "id" attribute. LibSBML will allow the identifier to be set, but it will not read nor write "id" attributes for objects that do not possess them according to the SBML specification for the Level and Version in use. @see setId(const std::string& sid) @see isSetId() @see unsetId() =item SBase::getName Returns the value of the "name" attribute of this object, if it has one. Most (but not all) objects in SBML include two common attributes: "id" and "name". In contrast to the "id" attribute, the "name" attribute is optional and is not intended to be used for cross-referencing purposes within a model. Its purpose instead is to provide a human-readable label for the component. The data type of "name" is the type C defined in XML Schema. SBML imposes no restrictions as to the content of "name" attributes beyond those restrictions defined by the C type in XML Schema. The recommended practice for handling "name" is as follows. If a software tool has the capability for displaying the content of "name" attributes, it should display this content to the user as a component's label instead of the component's "id". If the user interface does not have this capability (e.g., because it cannot display or use special characters in symbol names), or if the "name" attribute is missing on a given component, then the user interface should display the value of the "id" attribute instead. (Script language interpreters are especially likely to display "id" instead of "name".) As a consequence of the above, authors of systems that automatically generate the values of "id" attributes should be aware some systems may display the "id"'s to the user. Authors therefore may wish to take some care to have their software create "id" values that are: (a) reasonably easy for humans to type and read; and (b) likely to be meaningful, for example by making the "id" attribute be an abbreviated form of the name attribute value. An additional point worth mentioning is although there are restrictions on the uniqueness of "id" values, there are no restrictions on the uniqueness of "name" values in a model. This allows software packages leeway in assigning component identifiers. Returns the name of this SBML object. @note The fact that the "name" attribute is defined on the SBase parent class object is a convenience provided by libSBML, and B. This libSBML implementation of SBase allows client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have identifiers), but beware that not all SBML object classes provide an "id" attribute. LibSBML will allow the identifier to be set, but it will not read nor write "id" attributes for objects that do not possess them according to the SBML specification for the Level and Version in use. @see isSetName() @see setName(const std::string& name) @see unsetName() =item SBase::getNotes Returns the content of the "notes" subelement of this object as a tree of XML nodes. The optional element named "notes", present on every major SBML component type, is intended as a place for storing optional information intended to be seen by humans. An example use of the "notes" element would be to contain formatted user comments about the model element in which the "notes" element is enclosed. Every object derived directly or indirectly from type SBase can have a separate value for "notes", allowing users considerable freedom when adding comments to their models. The format of "notes" elements must be XHTML 1.0. The SBML Level 2 specification has considerable detail about how "notes" element content must be handled; please refer to the specifications. The "notes" element content returned by this method will be in XML form, but libSBML does not provide an object model specifically for the content of notes. Callers will need to traverse the XML tree structure using the facilities available on XMLNode and related objects. Returns the content of the "notes" subelement of this SBML object. @see getNotesString() @see isSetNotes() @see setNotes(const XMLNode notes) @see setNotes(const std::string& notes) @see appendNotes(const XMLNode notes) @see appendNotes(const std::string& notes) @see unsetNotes() =item SBase::getNotesString Returns the content of the "notes" subelement of this object as a string. The optional element named "notes", present on every major SBML component type, is intended as a place for storing optional information intended to be seen by humans. An example use of the "notes" element would be to contain formatted user comments about the model element in which the "notes" element is enclosed. Every object derived directly or indirectly from type SBase can have a separate value for "notes", allowing users considerable freedom when adding comments to their models. The format of "notes" elements must be XHTML 1.0. The SBML Level 2 specification has considerable detail about how "notes" element content must be handled; please refer to the specifications. Returns the content of the "notes" subelement of this SBML object. @see getNotes() @see isSetNotes() @see setNotes(const XMLNode notes) @see setNotes(const std::string& notes) @see appendNotes(const XMLNode notes) @see appendNotes(const std::string& notes) @see unsetNotes() =item SBase::getAnnotation Returns the content of the "annotation" subelement of this object as an XML node tree. Whereas the SBase "notes" subelement is a container for content to be shown directly to humans, the "annotation" element is a container for optional software-generated content I meant to be shown to humans. Every object derived from SBase can have its own value for "annotation". The element's content type is XML type C, allowing essentially arbitrary well-formed XML data content. SBML places a few restrictions on the organization of the content of annotations; these are intended to help software tools read and write the data as well as help reduce conflicts between annotations added by different tools. Please see the SBML specifications for more details. The annotations returned by this method will be in XML form. LibSBML provides an object model and related interfaces for certain specific kinds of annotations, namely model history information and RDF content. See the ModelHistory, CVTerm and RDFAnnotationParser classes for more information about the facilities available. Returns the annotation of this SBML object as an XMLNode @see getAnnotationString() @see isSetAnnotation() @see setAnnotation(const XMLNode annotation) @see setAnnotation(const std::string& annotation) @see appendAnnotation(const XMLNode annotation) @see appendAnnotation(const std::string& annotation) @see unsetAnnotation() =item SBase::getAnnotationString Returns the content of the "annotation" subelement of this object as a character string. Whereas the SBase "notes" subelement is a container for content to be shown directly to humans, the "annotation" element is a container for optional software-generated content I meant to be shown to humans. Every object derived from SBase can have its own value for "annotation". The element's content type is XML type C, allowing essentially arbitrary well-formed XML data content. SBML places a few restrictions on the organization of the content of annotations; these are intended to help software tools read and write the data as well as help reduce conflicts between annotations added by different tools. Please see the SBML specifications for more details. The annotations returned by this method will be in string form. Returns the annotation string of this SBML object. @see getAnnotation() @see isSetAnnotation() @see setAnnotation(const XMLNode annotation) @see setAnnotation(const std::string& annotation) @see appendAnnotation(const XMLNode annotation) @see appendAnnotation(const std::string& annotation) @see unsetAnnotation() =item SBase::getNamespaces Returns a list of the XML Namespaces declared on this SBML document. Returns the XML Namespaces associated with this SBML object =item SBase::getSBMLDocument Returns the parent SBMLDocument object. LibSBML uses the class SBMLDocument as a top-level container for storing SBML content and data associated with it (such as warnings and error messages). An SBML model in libSBML is contained inside an SBMLDocument object. SBMLDocument corresponds roughly to the class Sbml defined in the SBML Level 2 specification, but it does not have a direct correspondence in SBML Level 1. (But, it is created by libSBML no matter whether the model is Level 1 or Level 2.) This method allows the SBMLDocument for the current object to be retrieved. Returns the parent SBMLDocument object of this SBML object. =item SBase::getSBMLDocument Returns the parent SBMLDocument object. LibSBML uses the class SBMLDocument as a top-level container for storing SBML content and data associated with it (such as warnings and error messages). An SBML model in libSBML is contained inside an SBMLDocument object. SBMLDocument corresponds roughly to the class Sbml defined in the SBML Level 2 specification, but it does not have a direct correspondence in SBML Level 1. (But, it is created by libSBML no matter whether the model is Level 1 or Level 2.) This method allows the SBMLDocument for the current object to be retrieved. Returns the parent SBMLDocument object of this SBML object. =item SBase::getParentSBMLObject Returns the parent SBML object. This method is convenient when holding an object nested inside other objects in an SBML model. It allows direct access to the C<<model>> element containing it. Returns the parent SBML object of this SBML object. =item SBase::getAncestorOfType Returns the ancestor SBML object that corresponds to the given SBMLTypeCode_t. This function allows any object to determine its exact location/function within a model. For example a StoichiometryMath object has ancestors of type SpeciesReference, ListOfProducts/ListOfReactants/ListOfModifiers, Reaction, ListOfReactions and Model; any of which can be accessed via this function. @param type the SBMLTypeCode_t of the ancestor to be returned. Returns the ancestor SBML object of this SBML object, that corresponds to the given SBMLTypeCode_t, NULL if none exists. =item SBase::getSBOTerm Returns the integer portion of the value of the "sboTerm" attribute of this object. In SBML Level 2 Versions 2, 3 and 4, the data type of the attribute is a string of the form SBO:NNNNNNN, where NNNNNNN is a seven digit integer number; libSBML simplifies the representation by only storing the NNNNNNN integer portion. Thus, in libSBML, the "sboTerm" attribute on SBase has data type C, and SBO identifiers are stored simply as integers. SBO terms are a type of optional annotation, and each different class of SBML object derived from SBase imposes its own requirements about the values permitted for "sboTerm". Please consult the SBML Level 2 Version 4 specification for more information about the use of SBO and the "sboTerm" attribute. Returns the value of the "sboTerm" attribute as an integer, or C<-1> if the value is not set. =item SBase::getSBOTermID Returns the string representation of the "sboTerm" attribute of this object. In SBML Level 2 Versions 2, 3 and 4, the data type of the attribute is a string of the form SBO:NNNNNNN, where NNNNNNN is a seven digit integer number; libSBML simplifies the representation by only storing the NNNNNNN integer portion. Thus, in libSBML, the "sboTerm" attribute on SBase has data type C, and SBO identifiers are stored simply as integers. This function recreates the string representation from the stored value. SBO terms are a type of optional annotation, and each different class of SBML object derived from SBase imposes its own requirements about the values permitted for "sboTerm". Please consult the SBML Level 2 Version 4 specification for more information about the use of SBO and the "sboTerm" attribute. Returns the value of the "sboTerm" attribute as a string of the form SBO:NNNNNNN, or an empty string if the value is not set. =item SBase::getLine Returns the line number on which this object first appears in the XML representation of the SBML document. Returns the line number of this SBML object. @see getColumn() =item SBase::getColumn Returns the column number on which this object first appears in the XML representation of the SBML document. Returns the column number of this SBML object. @see getLine() =item SBase::isSetMetaId Predicate returning C or C depending on whether this object's "metaid" attribute has been set. The optional attribute named "metaid", present on every major SBML component type, is for supporting metadata annotations using RDF (Resource Description Format). The attribute value has the data type XML ID, the XML identifier type, which means each "metaid" value must be globally unique within an SBML file. (Importantly, this uniqueness criterion applies across any attribute with type XML ID, not just the "metaid" attribute used by SBML—something to be aware of if your application-specific XML content inside the "annotation" subelement happens to use XML ID.) The "metaid" value serves to identify a model component for purposes such as referencing that component from metadata placed within "annotation" subelements. @htmlinclude libsbml-comment-set-methods.html Returns C if the "metaid" attribute of this SBML object has been set, C otherwise. @see getMetaId() @see setMetaId(const std::string& metaid) =item SBase::isSetId Predicate returning C or C depending on whether this object's "id" attribute has been set. Most (but not all) objects in SBML include two common attributes: "id" and "name". The identifier given by an object's "id" attribute value is used to identify the object within the SBML model definition. Other objects can refer to the component using this identifier. The data type of "id" is always either C or C, depending on the object in question. Both data types are defined as follows: C letter ::= 'a'..'z','A'..'Z' digit ::= '0'..'9' idChar ::= letter | digit | '_' SId ::= ( letter | '_' ) idChar @endcode The equality of C and C type values in SBML is determined by an exact character sequence match; i.e., comparisons of these identifiers must be performed in a case-sensitive manner. This applies to all uses of C and C. @htmlinclude libsbml-comment-set-methods.html Returns C if the "id" attribute of this SBML object has been set, C otherwise. @note The fact that the value of attribute "id" is defined on the SBase parent class object is a convenience provided by libSBML, and B. This libSBML implementation of SBase allows client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have identifiers), but beware that not all SBML object classes provide an "id" attribute. LibSBML will allow the identifier to be set, but it will not read nor write "id" attributes for objects that do not possess them according to the SBML specification for the Level and Version in use. @see getId() @see setId(const std::string& sid) @see unsetId() =item SBase::isSetName Predicate returning C or C depending on whether this object's "name" attribute has been set. Most (but not all) objects in SBML include two common attributes: "id" and "name". In contrast to the "id" attribute, the "name" attribute is optional and is not intended to be used for cross-referencing purposes within a model. Its purpose instead is to provide a human-readable label for the component. The data type of "name" is the type C defined in XML Schema. SBML imposes no restrictions as to the content of "name" attributes beyond those restrictions defined by the C type in XML Schema. The recommended practice for handling "name" is as follows. If a software tool has the capability for displaying the content of "name" attributes, it should display this content to the user as a component's label instead of the component's "id". If the user interface does not have this capability (e.g., because it cannot display or use special characters in symbol names), or if the "name" attribute is missing on a given component, then the user interface should display the value of the "id" attribute instead. (Script language interpreters are especially likely to display "id" instead of "name".) As a consequence of the above, authors of systems that automatically generate the values of "id" attributes should be aware some systems may display the "id"'s to the user. Authors therefore may wish to take some care to have their software create "id" values that are: (a) reasonably easy for humans to type and read; and (b) likely to be meaningful, for example by making the "id" attribute be an abbreviated form of the name attribute value. An additional point worth mentioning is although there are restrictions on the uniqueness of "id" values, there are no restrictions on the uniqueness of "name" values in a model. This allows software packages leeway in assigning component identifiers. @htmlinclude libsbml-comment-set-methods.html Returns C if the "name" attribute of this SBML object has been set, C otherwise. @note The fact that the "name" attribute is defined on the SBase parent class object is a convenience provided by libSBML, and B. This libSBML implementation of SBase allows client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have identifiers), but beware that not all SBML object classes provide an "id" attribute. LibSBML will allow the identifier to be set, but it will not read nor write "id" attributes for objects that do not possess them according to the SBML specification for the Level and Version in use. @see getName() @see setName(const std::string& name) @see unsetName() =item SBase::isSetNotes Predicate returning C or C depending on whether this object's "notes" subelement exists and has content. The optional element named "notes", present on every major SBML component type, is intended as a place for storing optional information intended to be seen by humans. An example use of the "notes" element would be to contain formatted user comments about the model element in which the "notes" element is enclosed. Every object derived directly or indirectly from type SBase can have a separate value for "notes", allowing users considerable freedom when adding comments to their models. The format of "notes" elements must be XHTML 1.0. The SBML Level 2 specification has considerable detail about how "notes" element content must be handled; please refer to the specifications. @htmlinclude libsbml-comment-set-methods.html Returns C if a "notes" subelement exists, C otherwise. @see getNotes() @see getNotesString() @see setNotes(const XMLNode notes) @see setNotes(const std::string& notes) @see appendNotes(const XMLNode notes) @see appendNotes(const std::string& notes) @see unsetNotes() =item SBase::isSetAnnotation Predicate returning C or C depending on whether this object's "annotation" subelement exists and has content. Whereas the SBase "notes" subelement is a container for content to be shown directly to humans, the "annotation" element is a container for optional software-generated content I meant to be shown to humans. Every object derived from SBase can have its own value for "annotation". The element's content type is XML type C, allowing essentially arbitrary well-formed XML data content. SBML places a few restrictions on the organization of the content of annotations; these are intended to help software tools read and write the data as well as help reduce conflicts between annotations added by different tools. Please see the SBML specifications for more details. @htmlinclude libsbml-comment-set-methods.html Returns C if a "annotation" subelement exists, C otherwise. @see getAnnotation() @see getAnnotationString() @see setAnnotation(const XMLNode annotation) @see setAnnotation(const std::string& annotation) @see appendAnnotation(const XMLNode annotation) @see appendAnnotation(const std::string& annotation) @see unsetAnnotation() =item SBase::isSetSBOTerm Predicate returning C or C depending on whether this object's "sboTerm" attribute has been set. @htmlinclude libsbml-comment-set-methods.html Returns C if the "sboTerm" attribute of this SBML object has been set, C otherwise. =item SBase::setMetaId Sets the value of the "metaid" attribute of this object. The string C is copied. The value of C must be an identifier conforming to the syntax defined by the XML 1.0 data type ID. Among other things, this type requires that a value is unique among all the values of type XML ID in an SBMLDocument. Although SBML only uses XML ID for the "metaid" attribute, callers should be careful if they use XML ID's in XML portions of a model that are not defined by SBML, such as in the application-specific content of the "annotation" subelement. @htmlinclude libsbml-comment-set-methods.html @param metaid the identifier string to use as the value of the "metaid" attribute @see getMetaId() @see isSetMetaId() =item SBase::setId Sets the value of the "id" attribute of this SBML object to a copy of C. The string C is copied. Note that SBML has strict requirements for the syntax of identifiers. The following is summary of the definition of the SBML identifier type C (here expressed in an extended form of BNF notation): C letter ::= 'a'..'z','A'..'Z' digit ::= '0'..'9' idChar ::= letter | digit | '_' SId ::= ( letter | '_' ) idChar @endcode The equality of SBML identifiers is determined by an exact character sequence match; i.e., comparisons must be performed in a case-sensitive manner. In addition, there are a few conditions for the uniqueness of identifiers in an SBML model. Please consult the SBML specifications for the exact formulations. @htmlinclude libsbml-comment-set-methods.html @param sid the string to use as the identifier of this object @note The fact that the value of attribute "id" is defined on the SBase parent class object is a convenience provided by libSBML, and B. This libSBML implementation of SBase allows client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have identifiers), but beware that not all SBML object classes provide an "id" attribute. LibSBML will allow the identifier to be set, but it will not read nor write "id" attributes for objects that do not possess them according to the SBML specification for the Level and Version in use. @see isSetId() @see getId() @see unsetId() =item SBase::setName Sets the value of the "name" attribute of this SBML object to a copy of C. Most (but not all) objects in SBML include two common attributes: "id" and "name". In contrast to the "id" attribute, the "name" attribute is optional and is not intended to be used for cross-referencing purposes within a model. Its purpose instead is to provide a human-readable label for the component. The data type of "name" is the type C defined in XML Schema. SBML imposes no restrictions as to the content of "name" attributes beyond those restrictions defined by the C type in XML Schema. The recommended practice for handling "name" is as follows. If a software tool has the capability for displaying the content of "name" attributes, it should display this content to the user as a component's label instead of the component's "id". If the user interface does not have this capability (e.g., because it cannot display or use special characters in symbol names), or if the "name" attribute is missing on a given component, then the user interface should display the value of the "id" attribute instead. (Script language interpreters are especially likely to display "id" instead of "name".) As a consequence of the above, authors of systems that automatically generate the values of "id" attributes should be aware some systems may display the "id"'s to the user. Authors therefore may wish to take some care to have their software create "id" values that are: (a) reasonably easy for humans to type and read; and (b) likely to be meaningful, for example by making the "id" attribute be an abbreviated form of the name attribute value. An additional point worth mentioning is although there are restrictions on the uniqueness of "id" values, there are no restrictions on the uniqueness of "name" values in a model. This allows software packages leeway in assigning component identifiers. @htmlinclude libsbml-comment-set-methods.html @param name the new name for the object; the string will be copied @note The fact that the "name" attribute is defined on the SBase parent class object is a convenience provided by libSBML, and B. This libSBML implementation of SBase allows client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have identifiers), but beware that not all SBML object classes provide an "id" attribute. LibSBML will allow the identifier to be set, but it will not read nor write "id" attributes for objects that do not possess them according to the SBML specification for the Level and Version in use. @see getName() @see isSetName() @see unsetName() =item SBase::setAnnotation Resets the value of the "annotation" subelement of this SBML object to a copy of C. Whereas the SBase "notes" subelement is a container for content to be shown directly to humans, the "annotation" element is a container for optional software-generated content I meant to be shown to humans. Every object derived from SBase can have its own value for "annotation". The element's content type is XML type C, allowing essentially arbitrary well-formed XML data content. SBML places a few restrictions on the organization of the content of annotations; these are intended to help software tools read and write the data as well as help reduce conflicts between annotations added by different tools. Please see the SBML specifications for more details. Call this method will result in any existing content of the "annotation" subelement to be discarded. Unless you have taken steps to first copy and reconstitute any existing annotations into the @p annotation that is about to be assigned, it is likely that performing such wholesale replacement is unfriendly towards other software applications whose annotations are discarded. An alternative may be to use SBase::appendAnnotation(const XMLNode annotation) or SBase::appendAnnotation(const std::string& annotation). @htmlinclude libsbml-comment-set-methods.html @param annotation an XML structure that is to be used as the new content of the "annotation" subelement of this object @see getAnnotationString() @see isSetAnnotation() @see setAnnotation(const std::string& annotation) @see appendAnnotation(const XMLNode annotation) @see appendAnnotation(const std::string& annotation) @see unsetAnnotation() =item SBase::setAnnotation Sets the value of the "annotation" subelement of this SBML object to a copy of C given as a character string. Whereas the SBase "notes" subelement is a container for content to be shown directly to humans, the "annotation" element is a container for optional software-generated content I meant to be shown to humans. Every object derived from SBase can have its own value for "annotation". The element's content type is XML type C, allowing essentially arbitrary well-formed XML data content. SBML places a few restrictions on the organization of the content of annotations; these are intended to help software tools read and write the data as well as help reduce conflicts between annotations added by different tools. Please see the SBML specifications for more details. Call this method will result in any existing content of the "annotation" subelement to be discarded. Unless you have taken steps to first copy and reconstitute any existing annotations into the @p annotation that is about to be assigned, it is likely that performing such wholesale replacement is unfriendly towards other software applications whose annotations are discarded. An alternative may be to use SBase::appendAnnotation(const XMLNode annotation) or SBase::appendAnnotation(const std::string& annotation). @htmlinclude libsbml-comment-set-methods.html @param annotation an XML string that is to be used as the content of the "annotation" subelement of this object @see getAnnotationString() @see isSetAnnotation() @see setAnnotation(const XMLNode annotation) @see appendAnnotation(const XMLNode annotation) @see appendAnnotation(const std::string& annotation) @see unsetAnnotation() =item SBase::appendAnnotation Appends the annotation content given by C to any existing content in the "annotation" subelement of this object. Whereas the SBase "notes" subelement is a container for content to be shown directly to humans, the "annotation" element is a container for optional software-generated content I meant to be shown to humans. Every object derived from SBase can have its own value for "annotation". The element's content type is XML type C, allowing essentially arbitrary well-formed XML data content. SBML places a few restrictions on the organization of the content of annotations; these are intended to help software tools read and write the data as well as help reduce conflicts between annotations added by different tools. Please see the SBML specifications for more details. Unlike SBase::setAnnotation(const XMLNode annotation) or SBase::setAnnotation(const std::string& annotation), this method allows other annotations to be preserved when an application adds its own data. @htmlinclude libsbml-comment-set-methods.html @param annotation an XML structure that is to be copied and appended to the content of the "annotation" subelement of this object @see getAnnotationString() @see isSetAnnotation() @see setAnnotation(const XMLNode annotation) @see setAnnotation(const std::string& annotation) @see appendAnnotation(const std::string& annotation) @see unsetAnnotation() =item SBase::appendAnnotation Appends the annotation content given by C to any existing content in the "annotation" subelement of this object. Whereas the SBase "notes" subelement is a container for content to be shown directly to humans, the "annotation" element is a container for optional software-generated content I meant to be shown to humans. Every object derived from SBase can have its own value for "annotation". The element's content type is XML type C, allowing essentially arbitrary well-formed XML data content. SBML places a few restrictions on the organization of the content of annotations; these are intended to help software tools read and write the data as well as help reduce conflicts between annotations added by different tools. Please see the SBML specifications for more details. Unlike SBase::setAnnotation(const XMLNode annotation) or SBase::setAnnotation(const std::string& annotation), this method allows other annotations to be preserved when an application adds its own data. @htmlinclude libsbml-comment-set-methods.html @param annotation an XML string that is to be copied and appended to the content of the "annotation" subelement of this object @see getAnnotationString() @see isSetAnnotation() @see setAnnotation(const XMLNode annotation) @see setAnnotation(const std::string& annotation) @see appendAnnotation(const XMLNode annotation) @see unsetAnnotation() =item SBase::setNotes Sets the value of the "notes" subelement of this SBML object to a copy of the XML structure given by C. Any existing content of the "notes" subelement is discarded. The optional element named "notes", present on every major SBML component type, is intended as a place for storing optional information intended to be seen by humans. An example use of the "notes" element would be to contain formatted user comments about the model element in which the "notes" element is enclosed. Every object derived directly or indirectly from type SBase can have a separate value for "notes", allowing users considerable freedom when adding comments to their models. The format of "notes" elements must be XHTML 1.0. The SBML Level 2 specification has considerable detail about how "notes" element content must be handled; please refer to the specifications. @htmlinclude libsbml-comment-set-methods.html @param notes an XML structure that is to be used as the content of the "notes" subelement of this object @see getNotesString() @see isSetNotes() @see setNotes(const std::string& notes) @see appendNotes(const XMLNode notes) @see appendNotes(const std::string& notes) @see unsetNotes() =item SBase::setNotes Sets the value of the "notes" subelement of this SBML object to a copy of the string C. Any existing content of the "notes" subelement is discarded. The optional element named "notes", present on every major SBML component type, is intended as a place for storing optional information intended to be seen by humans. An example use of the "notes" element would be to contain formatted user comments about the model element in which the "notes" element is enclosed. Every object derived directly or indirectly from type SBase can have a separate value for "notes", allowing users considerable freedom when adding comments to their models. The format of "notes" elements must be XHTML 1.0. The SBML Level 2 specification has considerable detail about how "notes" element content must be handled; please refer to the specifications. @htmlinclude libsbml-comment-set-methods.html @param notes an XML string that is to be used as the content of the "notes" subelement of this object @see getNotesString() @see isSetNotes() @see setNotes(const XMLNode notes) @see appendNotes(const XMLNode notes) @see appendNotes(const std::string& notes) @see unsetNotes() =item SBase::appendNotes Appends notes content to the "notes" element attached to this object. The content in C is copied. The optional element named "notes", present on every major SBML component type, is intended as a place for storing optional information intended to be seen by humans. An example use of the "notes" element would be to contain formatted user comments about the model element in which the "notes" element is enclosed. Every object derived directly or indirectly from type SBase can have a separate value for "notes", allowing users considerable freedom when adding comments to their models. The format of "notes" elements must be XHTML 1.0. The SBML Level 2 specification has considerable detail about how "notes" element content must be handled; please refer to the specifications. @param notes an XML node structure that is to appended to the content of the "notes" subelement of this object @see getNotesString() @see isSetNotes() @see setNotes(const XMLNode notes) @see setNotes(const std::string& notes) @see appendNotes(const std::string& notes) @see unsetNotes() =item SBase::appendNotes Appends notes content to the "notes" element attached to this object. The content in C is copied. The optional element named "notes", present on every major SBML component type, is intended as a place for storing optional information intended to be seen by humans. An example use of the "notes" element would be to contain formatted user comments about the model element in which the "notes" element is enclosed. Every object derived directly or indirectly from type SBase can have a separate value for "notes", allowing users considerable freedom when adding comments to their models. The format of "notes" elements must be XHTML 1.0. The SBML Level 2 specification has considerable detail about how "notes" element content must be handled; please refer to the specifications. @param notes an XML string that is to appended to the content of the "notes" subelement of this object @see getNotesString() @see isSetNotes() @see setNotes(const XMLNode notes) @see setNotes(const std::string& notes) @see appendNotes(const XMLNode notes) @see unsetNotes() =item SBase::setSBMLDocument Sets the parent SBMLDocument of this SBML object. @param d the SBMLDocument object to use @deprecated libSBML internal =item SBase::setParentSBMLObject Sets the parent SBML object of this SBML object. @param sb the SBML object to use @deprecated libSBML internal =item SBase::setSBOTerm Sets the value of the "sboTerm" attribute. In SBML Level 2 Versions 2, 3 and 4, the data type of the SBML "sboTerm" attribute is a string of the form SBO:NNNNNNN, where NNNNNNN is a seven digit integer number; libSBML simplifies the representation by only storing the NNNNNNN integer portion. Thus, in libSBML, the "sboTerm" attribute on SBase has data type C, and SBO identifiers are stored simply as integers. SBO terms are a type of optional annotation, and each different class of SBML object derived from SBase imposes its own requirements about the values permitted for "sboTerm". Please consult the SBML Level 2 Version 4 specification for more information about the use of SBO and the "sboTerm" attribute. @htmlinclude libsbml-comment-set-methods.html @param value the NNNNNNN integer portion of the SBO identifier =item SBase::setNamespaces Sets the namespaces relevant of this SBML object. @param xmlns the namespaces to set =item SBase::unsetMetaId Unsets the value of the "metaid" attribute of this SBML object. The optional attribute named "metaid", present on every major SBML component type, is for supporting metadata annotations using RDF (Resource Description Format). The attribute value has the data type XML ID, the XML identifier type, which means each "metaid" value must be globally unique within an SBML file. (Importantly, this uniqueness criterion applies across any attribute with type XML ID, not just the "metaid" attribute used by SBML—something to be aware of if your application-specific XML content inside the "annotation" subelement happens to use XML ID.) The "metaid" value serves to identify a model component for purposes such as referencing that component from metadata placed within "annotation" subelements. @htmlinclude libsbml-comment-set-methods.html =item SBase::unsetId Unsets the value of the "id" attribute of this SBML object. Most (but not all) objects in SBML include two common attributes: "id" and "name". The identifier given by an object's "id" attribute value is used to identify the object within the SBML model definition. Other objects can refer to the component using this identifier. The data type of "id" is always either C or C, depending on the object in question. Both data types are defined as follows: C letter ::= 'a'..'z','A'..'Z' digit ::= '0'..'9' idChar ::= letter | digit | '_' SId ::= ( letter | '_' ) idChar @endcode The equality of C and C type values in SBML is determined by an exact character sequence match; i.e., comparisons of these identifiers must be performed in a case-sensitive manner. This applies to all uses of C and C. @htmlinclude libsbml-comment-set-methods.html @note The fact that the value of attribute "id" is defined on the SBase parent class object is a convenience provided by libSBML, and B. This libSBML implementation of SBase allows client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have identifiers), but beware that not all SBML object classes provide an "id" attribute. LibSBML will allow the identifier to be set, but it will not read nor write "id" attributes for objects that do not possess them according to the SBML specification for the Level and Version in use. @see setId(const std::string& sid) @see getId() @see isSetId() =item SBase::unsetName Unsets the value of the "name" attribute of this SBML object. Most (but not all) objects in SBML include two common attributes: "id" and "name". In contrast to the "id" attribute, the "name" attribute is optional and is not intended to be used for cross-referencing purposes within a model. Its purpose instead is to provide a human-readable label for the component. The data type of "name" is the type C defined in XML Schema. SBML imposes no restrictions as to the content of "name" attributes beyond those restrictions defined by the C type in XML Schema. The recommended practice for handling "name" is as follows. If a software tool has the capability for displaying the content of "name" attributes, it should display this content to the user as a component's label instead of the component's "id". If the user interface does not have this capability (e.g., because it cannot display or use special characters in symbol names), or if the "name" attribute is missing on a given component, then the user interface should display the value of the "id" attribute instead. (Script language interpreters are especially likely to display "id" instead of "name".) As a consequence of the above, authors of systems that automatically generate the values of "id" attributes should be aware some systems may display the "id"'s to the user. Authors therefore may wish to take some care to have their software create "id" values that are: (a) reasonably easy for humans to type and read; and (b) likely to be meaningful, for example by making the "id" attribute be an abbreviated form of the name attribute value. An additional point worth mentioning is although there are restrictions on the uniqueness of "id" values, there are no restrictions on the uniqueness of "name" values in a model. This allows software packages leeway in assigning component identifiers. @htmlinclude libsbml-comment-set-methods.html @note The fact that the "name" attribute is defined on the SBase parent class object is a convenience provided by libSBML, and B. This libSBML implementation of SBase allows client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have identifiers), but beware that not all SBML object classes provide an "id" attribute. LibSBML will allow the identifier to be set, but it will not read nor write "id" attributes for objects that do not possess them according to the SBML specification for the Level and Version in use. @see isSetName() @see setName(const std::string& name) @see getName() =item SBase::unsetNotes Unsets the value of the "notes" subelement of this SBML object. The optional element named "notes", present on every major SBML component type, is intended as a place for storing optional information intended to be seen by humans. An example use of the "notes" element would be to contain formatted user comments about the model element in which the "notes" element is enclosed. Every object derived directly or indirectly from type SBase can have a separate value for "notes", allowing users considerable freedom when adding comments to their models. The format of "notes" elements must be XHTML 1.0. The SBML Level 2 specification has considerable detail about how "notes" element content must be handled; please refer to the specifications. @htmlinclude libsbml-comment-set-methods.html @see getNotesString() @see isSetNotes() @see setNotes(const XMLNode notes) @see setNotes(const std::string& notes) @see appendNotes(const XMLNode notes) @see appendNotes(const std::string& notes) =item SBase::unsetAnnotation Unsets the value of the "annotation" subelement of this SBML object. Whereas the SBase "notes" subelement is a container for content to be shown directly to humans, the "annotation" element is a container for optional software-generated content I meant to be shown to humans. Every object derived from SBase can have its own value for "annotation". The element's content type is XML type C, allowing essentially arbitrary well-formed XML data content. SBML places a few restrictions on the organization of the content of annotations; these are intended to help software tools read and write the data as well as help reduce conflicts between annotations added by different tools. Please see the SBML specifications for more details. @htmlinclude libsbml-comment-set-methods.html @see getAnnotation() @see getAnnotationString() @see isSetAnnotation() @see setAnnotation(const XMLNode annotation) @see setAnnotation(const std::string& annotation) @see appendAnnotation(const XMLNode annotation) @see appendAnnotation(const std::string& annotation) =item SBase::unsetSBOTerm Unsets the value of the "sboTerm" attribute of this SBML object. @htmlinclude libsbml-comment-set-methods.html =item SBase::addCVTerm Adds a copy of the given CVTerm to this SBML object. @param term the CVTerm to assign @note Since the CV Term uses the metaid of the object as a reference, if the object has no metaid set the CVTerm will not be added. @warning The fact that this method I the object passed to it means that the caller will be left holding a physically different object instance than the one contained in I object. Changes made to the original object instance (such as resetting attribute values) will not affect the instance added here. In addition, the caller should make sure to free the original object if it is no longer being used, or else a memory leak will result. =item SBase::getCVTerms Returns a list of CVTerm objects in the annotations of this SBML object. Returns the list of CVTerms for this SBML object. =item SBase::getCVTerms Returns a list of CVTerm objects in the annotations of this SBML object. Returns the list of CVTerms for this SBML object. =item SBase::getNumCVTerms Returns the number of CVTerm objects in the annotations of this SBML object. Returns the number of CVTerms for this SBML object. =item SBase::getCVTerm Returns the nth CVTerm in the list of CVTerms of this SBML object. @param n unsigned int the index of the CVTerm to retrieve Returns the nth CVTerm in the list of CVTerms for this SBML object. =item SBase::unsetCVTerms Clears the list of CVTerms of this SBML object. =item SBase::getResourceBiologicalQualifier Returns the BiologicalQualifier associated with this resource, or BQB_UNKNOWN if the resource does not exist. @param resource string representing the resource; e.g., "http://www.geneontology.org/#GO:0005892" Returns the #BiolQualifierType_t value associated with the resource =item SBase::getResourceModelQualifier Returns the ModelQualifier associated with this resource, or BQM_UNKNOWN if the resource does not exist. @param resource string representing the resource; e.g., "http://www.geneontology.org/#GO:0005892" Returns the #ModelQualifierType_t value associated with the resource =item SBase::getModel Returns the Model object in which the current object is located. Returns the parent Model of this SBML object. =item SBase::getLevel Returns the SBML Level of the overall SBML document. Returns the SBML level of this SBML object. @see getVersion() =item SBase::getVersion Returns the Version within the SBML Level of the overall SBML document. Returns the SBML version of this SBML object. @see getLevel() =item SBase::getTypeCode Returns the libSBML type code for this object. This method MAY return the typecode of this SBML object or it MAY return SBML_UNKNOWN. That is, subclasses of SBase are not required to implement this method to return a typecode. This method is meant primarily for the LibSBML C interface where class and subclass information is not readily available. Returns the #SBMLTypeCode_t value of this SBML object or SBML_UNKNOWN (default). @see getElementName() =item SBase::getElementName Returns the XML element name of this object. This is overridden by subclasses to return a string appropriate to the SBML component. For example, Model defines it as returning "model", CompartmentType defines it as returning "compartmentType", etc. =item SBase::toSBML Returns a string that consists of the partial SBML describing this object. This is primarily provided for testing and debugging purposes. It may be removed in a future version of libSBML. Returns the partial SBML that describes this SBML object. =item SBase::read Reads (initializes) this SBML object by reading from XMLInputStream. @deprecated libSBML internal =item SBase::write Writes (serializes) this SBML object by writing it to XMLOutputStream. @deprecated libSBML internal =item SBase::writeElements Subclasses should override this method to write out their contained SBML objects as XML elements. Be sure to call your parents implementation of this method as well. For example: SBase::writeElements(stream); mReactans.write(stream); mProducts.write(stream); ... @deprecated libSBML internal =item SBase::removeDuplicateAnnotations Subclasses should override this method to write out their contained SBML objects as XML elements. Be sure to call your parents implementation of this method as well. For example: SBase::writeElements(stream); mReactans.write(stream); mProducts.write(stream); ... @deprecated libSBML internal =item SBase::SBase Only subclasses may create SBase objects. @docnote The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be I for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation. @deprecated libSBML internal =item SBase::SBase Creates a new SBase object with the given sboTerm. Only subclasses may create SBase objects. @deprecated libSBML internal =item SBase::SBase Copy constructor. Creates a copy of this SBase object. @deprecated libSBML internal =item SBase::createObject Subclasses should override this method to create, store, and then return an SBML object corresponding to the next XMLToken in the XMLInputStream. Returns the SBML object corresponding to next XMLToken in the XMLInputStream or NULL if the token was not recognized. @deprecated libSBML internal =item SBase::readOtherXML Subclasses should override this method to read (and store) XHTML, MathML, etc. directly from the XMLInputStream. Returns true if the subclass read from the stream, false otherwise. @deprecated libSBML internal =item SBase::getElementPosition The SBML XML Schema is written such that the order of child elements is significant. LibSBML can read elements out of order. If you override this method to indicate the ordinal position of element with respect to its siblings, libSBML will log an error if the element is read out of order. Returns the ordinal position of the element with respect to its siblings or -1 (default) to indicate the position is not significant. @deprecated libSBML internal =item SBase::getErrorLog Returns the SBMLErrorLog used to log errors during while reading and validating SBML. @deprecated libSBML internal =item SBase::logError Convenience method for easily logging problems from within method implementations. This is essentially a short form of getErrorLog()->logError(...) @docnote The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be I for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation. @deprecated libSBML internal =item SBase::logUnknownAttribute Helper to log a common type of error. @deprecated libSBML internal =item SBase::logUnknownElement Helper to log a common type of error. @deprecated libSBML internal =item SBase::logEmptyString Helper to log a common type of error. @deprecated libSBML internal =item SBase::readAttributes Subclasses should override this method to read values from the given XMLAttributes set into their specific fields. Be sure to call your parents implementation of this method as well. @deprecated libSBML internal =item SBase::writeAttributes Subclasses should override this method to write their XML attributes to the XMLOutputStream. Be sure to call your parents implementation of this method as well. For example: SBase::writeAttributes(stream); stream.writeAttribute( "id" , mId ); stream.writeAttribute( "name", mName ); ... @deprecated libSBML internal =item SBase::syncAnnotation Synchronizes the annotation of this SBML object. Annotation element (XMLNode mAnnotation) is synchronized with the current CVTerm objects (List mCVTerm). Currently, this method is called in getAnnotation, isSetAnnotation, and writeElements methods. @deprecated libSBML internal =item SBase::checkOrderAndLogError Checks that SBML element has been read in the proper order. If object is not in the expected position, an error is logged. @deprecated libSBML internal =item SBase::checkListOfPopulated Checks that an SBML ListOf element has been populated. If a listOf element has been declared with no elements, an error is logged. @deprecated libSBML internal =item SBase::checkMetaIdSyntax Checks the syntax of a metaid attribute. The optional attribute named "metaid", present on every major SBML component type, is for supporting metadata annotations using RDF (Resource Description Format). The attribute value has the data type XML ID, the XML identifier type, which means each "metaid" value must be globally unique within an SBML file. (Importantly, this uniqueness criterion applies across any attribute with type XML ID, not just the "metaid" attribute used by SBML—something to be aware of if your application-specific XML content inside the "annotation" subelement happens to use XML ID.) The "metaid" value serves to identify a model component for purposes such as referencing that component from metadata placed within "annotation" subelements. If the syntax of the metaid attribute of this object is incorrect, this method logs an error in the SBMLDocument's error log. @deprecated libSBML internal =item SBase::checkIdSyntax Checks the syntax of the id attribute. The syntax of an id is of type SId which is defined as: - letter ::= 'a'..'z','A'..'Z' - digit ::= '0'..'9' - idChar ::= letter | digit | '_' - SId ::= ( letter | '_' ) idChar If the syntax of the id attribute of this object is incorrect, an error is logged @deprecated libSBML internal =item SBase::checkUnitSyntax Checks the syntax of the unit attribute. The syntax of an unit is of type UnitSId which is defined as: - letter ::= 'a'..'z','A'..'Z' - digit ::= '0'..'9' - idChar ::= letter | digit | '_' - UnitSId ::= ( letter | '_' ) idChar If the syntax of the unit attribute of this object is incorrect, an error is logged @docnote The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be I for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation. @deprecated libSBML internal =item SBase::checkAnnotation Checks the annotation does not declare an sbml namespace. If the annotation declares an sbml namespace an error is logged. @deprecated libSBML internal =item SBase::checkXHTML Checks that the XHTML is valid. If the xhtml does not conform to the specification of valid xhtml within an sbml document, an error is logged. @deprecated libSBML internal =item SBase::isUnicodeLetter Checks if a character is part of the Unicode Letter set. Returns true if the character is a part of the set, false otherwise. @deprecated libSBML internal =item SBase::isUnicodeDigit Checks if a character is part of the Unicode Digit set. Returns true if the character is a part of the set, false otherwise. @deprecated libSBML internal =item SBase::isCombiningChar Checks if a character is part of the Unicode CombiningChar set. Returns true if the character is a part of the set, false otherwise. @deprecated libSBML internal =item SBase::isExtender Checks if a character is part of the Unicode Extender set. Returns true if the character is a part of the set, false otherwise. @deprecated libSBML internal =item SBase::isExtender Checks if a character is part of the Unicode Extender set. Returns true if the character is a part of the set, false otherwise. @deprecated libSBML internal =item SBase::isExtender Checks if a character is part of the Unicode Extender set. Returns true if the character is a part of the set, false otherwise. @deprecated libSBML internal =item SBase::isExtender Checks if a character is part of the Unicode Extender set. Returns true if the character is a part of the set, false otherwise. @deprecated libSBML internal =item SBase::isExtender Checks if a character is part of the Unicode Extender set. Returns true if the character is a part of the set, false otherwise. @deprecated libSBML internal =item SBase::isExtender Checks if a character is part of the Unicode Extender set. Returns true if the character is a part of the set, false otherwise. @deprecated libSBML internal =item SBase::isExtender Checks if a character is part of the Unicode Extender set. Returns true if the character is a part of the set, false otherwise. @deprecated libSBML internal =item SBase::isExtender Checks if a character is part of the Unicode Extender set. Returns true if the character is a part of the set, false otherwise. @deprecated libSBML internal =item SBase::isExtender Checks if a character is part of the Unicode Extender set. Returns true if the character is a part of the set, false otherwise. @deprecated libSBML internal =item SBase::isExtender Checks if a character is part of the Unicode Extender set. Returns true if the character is a part of the set, false otherwise. @deprecated libSBML internal =item SBase::isExtender Checks if a character is part of the Unicode Extender set. Returns true if the character is a part of the set, false otherwise. @deprecated libSBML internal =item SBase::isExtender Checks if a character is part of the Unicode Extender set. Returns true if the character is a part of the set, false otherwise. @deprecated libSBML internal =item SBase::isExtender Checks if a character is part of the Unicode Extender set. Returns true if the character is a part of the set, false otherwise. @deprecated libSBML internal =item SBase::isExtender Checks if a character is part of the Unicode Extender set. Returns true if the character is a part of the set, false otherwise. @deprecated libSBML internal =item SBase::isExtender Checks if a character is part of the Unicode Extender set. Returns true if the character is a part of the set, false otherwise. @deprecated libSBML internal =item SBase::isExtender Checks if a character is part of the Unicode Extender set. Returns true if the character is a part of the set, false otherwise. @deprecated libSBML internal =item SBase::setSBaseFields Stores the location (line and column) and any XML namespaces (for roundtripping) declared on this SBML (XML) element. @deprecated libSBML internal =item SBase::readAnnotation Returns true if read an element from the stream @deprecated libSBML internal =item SBase::readNotes Returns true if read a element from the stream @deprecated libSBML internal =item SBase::getHasBeenDeleted Returns true if read a element from the stream @deprecated libSBML internal =back =head2 ListOf Parent class for the various SBML "ListOfXYZ" classes. @htmlinclude libsbml-not-sbml-warning.html =over =item ListOf::ListOf Creates a new ListOf. =item ListOf::ListOf Copy constructor. Creates a copy of this ListOf. =item ListOf::accept Accepts the given SBMLVisitor. @param v the SBMLVisitor instance to be used. Returns the result of calling C, which indicates whether the Visitor would like to visit the next item in the list. =item ListOf::clone Creates and returns a deep copy of this ListOf. Returns a (deep) copy of this ListOf. =item ListOf::append Adds item to the end of this ListOf. This variant of the method makes a clone of the C handed to it. This means that when the ListOf is destroyed, the original items will not be destroyed. @param item the item to be added to the list. @see appendAndOwn(SBase item) =item ListOf::appendAndOwn Adds item to the end of this ListOf. This variant of the method does not clone the C handed to it; instead, it assumes ownership of it. This means that when the ListOf is destroyed, the item will be destroyed along with it. @param item the item to be added to the list. @see append(const SBase item) =item ListOf::get Get an item from the list. @param n the index number of the item to get. Returns the nth item in this ListOf items. @see size() =item ListOf::get Get an item from the list. @param n the index number of the item to get. Returns the nth item in this ListOf items. @see size() =item ListOf::get Get an item from the list based on its identifier. @param sid a string representing the the identifier of the item to get. Returns item in this ListOf items with the given id or NULL if no such item exists. @see get(unsigned int n) @see size() =item ListOf::get Get an item from the list based on its identifier. @param sid a string representing the the identifier of the item to get. Returns item in this ListOf items with the given id or NULL if no such item exists. @see get(unsigned int n) @see size() =item ListOf::clear Removes all items in this ListOf object. If doDelete is true (default), all items in this ListOf object are deleted and cleared, and thus the caller doesn't have to delete those items. Otherwise, all items are just cleared from this ListOf object and the caller is responsible for deleting all items (In this case, pointers to all items should be stored elsewhere before calling this function by the caller). @param doDelete if true (default), all items are deleted and cleared. Otherwise, all items are just cleared and not deleted. =item ListOf::remove Removes the nth item from this ListOf items and returns a pointer to it. The caller owns the returned item and is responsible for deleting it. @param n the index of the item to remove @see size() =item ListOf::remove Removes item in this ListOf items with the given identifier. The caller owns the returned item and is responsible for deleting it. If none of the items in this list have the identifier C, then @c NULL is returned. @param sid the identifier of the item to remove Returns the item removed. As mentioned above, the caller owns the returned item. =item ListOf::size Get the size of this ListOf. Returns the number of items in this ListOf items. =item ListOf::setSBMLDocument Sets the parent SBMLDocument of this SBML object. @param d the SBMLDocument that should become the parent of this ListOf. @deprecated libSBML internal =item ListOf::setParentSBMLObject Sets the parent SBML object of this SBML object. @param sb the SBML object to use @deprecated libSBML internal =item ListOf::getTypeCode Returns the libSBML type code for this object, namely, @c SBML_LIST_OF. @if clike LibSBML attaches an identifying code to every kind of SBML object. These are known as SBML type codes. The set of possible type codes is defined in the enumeration #SBMLTypeCode_t. The names of the type codes all begin with the characters C. @endif@if java LibSBML attaches an identifying code to every kind of SBML object. These are known as SBML type codes. In other languages, the set of type codes is stored in an enumeration; in the Java language interface for libSBML, the type codes are defined as static integer constants in interface class {@link libsbmlConstants}. The names of the type codes all begin with the characters C. @endif Returns the SBML type code for this object, or C (default). @see getElementName() =item ListOf::getItemTypeCode Get the type code of the objects contained in this ListOf. @if clike LibSBML attaches an identifying code to every kind of SBML object. These are known as SBML type codes. The set of possible type codes is defined in the enumeration #SBMLTypeCode_t. The names of the type codes all begin with the characters C. @endif@if java LibSBML attaches an identifying code to every kind of SBML object. These are known as SBML type codes. In other languages, the set of type codes is stored in an enumeration; in the Java language interface for libSBML, the type codes are defined as static integer constants in interface class {@link libsbmlConstants}. The names of the type codes all begin with the characters C. @endif Returns the SBML type code for the objects contained in this ListOf instance, or C (default). =item ListOf::getElementName Returns the XML element name of this object, which for ListOf, is always C<"listOf">. Returns the XML name of this element. =item ListOf::writeElements Subclasses should override this method to write out their contained SBML objects as XML elements. Be sure to call your parents implementation of this method as well. @deprecated libSBML internal =item ListOf::readAttributes Subclasses should override this method to read values from the given XMLAttributes set into their specific fields. Be sure to call your parents implementation of this method as well. @deprecated libSBML internal =item ListOf::writeAttributes Subclasses should override this method to write their XML attributes to the XMLOutputStream. Be sure to call your parents implementation of this method as well. For example: SBase::writeAttributes(stream); stream.writeAttribute( "id" , mId ); stream.writeAttribute( "name", mName ); ... @deprecated libSBML internal =item ListOf::writeAttributes Subclasses should override this method to write their XML attributes to the XMLOutputStream. Be sure to call your parents implementation of this method as well. For example: SBase::writeAttributes(stream); stream.writeAttribute( "id" , mId ); stream.writeAttribute( "name", mName ); ... @deprecated libSBML internal =back =head2 Model LibSBML implementation of SBML's Model construct. In an SBML model definition, a single object of class Model serves as the overall container for the lists of the various model components. All of the lists are optional, but if a given list container is present within the model, the list must not be empty; that is, it must have length one or more. The following are the components and lists permitted in different Levels and Versions of SBML as of this version of libSBML (3.3): =over =item In SBML Level 1, the components are: UnitDefinition, Compartment, Species, Parameter, Rule, and Reaction. Instances of the classes are placed inside instances of classes ListOfUnitDefinitions, ListOfCompartments, ListOfSpecies, ListOfParameters, ListOfRules, and ListOfReactions. =item In SBML Level 2 Version 1, the components are: FunctionDefinition, UnitDefinition, Compartment, Species, Parameter, Rule, Reaction and Event. Instances of the classes are placed inside instances of classes ListOfFunctionDefinitions, ListOfUnitDefinitions, ListOfCompartments, ListOfSpecies, ListOfParameters, ListOfRules, ListOfReactions, and ListOfEvents. =item In SBML Level 2 Versions 2, 3 and 4, the components are: FunctionDefinition, UnitDefinition, CompartmentType, SpeciesType, Compartment, Species, Parameter, InitialAssignment, Rule, Constraint, Reaction and Event. Instances of the classes are placed inside instances of classes ListOfFunctionDefinitions, ListOfUnitDefinitions, ListOfCompartmentTypes, ListOfSpeciesTypes, ListOfCompartments, ListOfSpecies, ListOfParameters, ListOfInitialAssignments, ListOfRules, ListOfConstraints, ListOfReactions, and ListOfEvents. =back Although all the lists are optional, there are dependencies between SBML components such that defining some components requires defining others. An example is that defining a species requires defining a compartment, and defining a reaction requires defining a species. The dependencies are explained in more detail in the SBML specifications. @section approaches Approaches to creating objects using the libSBML API LibSBML provides two main mechanisms for creating objects: class constructors (e.g., @if clike @link Species::Species() Species() @endlink @endif@if java Species() @endif), and createObject() methods (such as Model::createSpecies()) provided by certain object classes such as Model. These multiple mechanisms are provided by libSBML for flexibility and to support different use-cases, but they also have different implications for the overall model structure. In general, the recommended approach is to use the createObject() methods. These methods both create an object I link it to the parent in one step. Here is an example: @verbatim // Create an SBMLDocument object in Level 2 Version 4 format: SBMLDocument sbmlDoc = new SBMLDocument(2, 4); // Create a Model object inside the SBMLDocument object and set // its identifier. The call returns a pointer to the Model object // created, and methods called on that object affect the attributes // of the object attached to the model (as expected). Model model = sbmlDoc->createModel(); model->setId("MyModel"); // Create a Species object inside the Model and set its identifier. // Similar to the lines above, this call returns a pointer to the Species // object created, and methods called on that object affect the attributes // of the object attached to the model (as expected). Species sp = model->createSpecies(); sp->setId("MySpecies"); @endverbatim The createObject() methods return a pointer to the object created, but they also add the object to the relevant list of object instances contained in the parent. (These lists become the <listOfObjects> elements in the finished XML rendition of SBML.) In the example above, Model::createSpecies() adds the created species directly to the C<<listOfSpecies>> list in the model. Subsequently, methods called on the species change the species in the model (which is what is expected in most situations). By contrast, the other main way of creating an object and adding it to a parent makes a I of the object, and requires more care on the part of the caller. Here is an example of this alternative approach: @verbatim // Create a Species object and add it to the model. // This uses the Species class constructor: Species newsp = Species("MySpecies"); model->addSpecies(newsp); // Warning! This makes a COPY inside 'model'. // addSpecies(...) copies the object, with the result that // 'newsp' still refers to the original. The following may not // do what is expected: newsp.setId("NewId"); // Warning -- doesn't change the species in 'model'! // If 'newsp' object isn't going to be used further, it needs // to be deleted to avoid a memory leak. delete newsp; @endverbatim The key point of the example above is that, because the @if clike Model::addSpecies() @endif@if java Model::addSpecies(Species s) @endif call makes a copy of the object handed to it, care is needed both when attempting to make changes to the object, and when the original object is no longer needed. @section checking Consistency and adherence to SBML specifications To make it easier for applications to do whatever they need, libSBML 3.x is relatively lax when it comes to enforcing correctness and completeness of models during model construction and editing. Essentially, libSBML I I in most cases check automatically that a model's components have valid attribute values, or that the overall model is consistent and free of errors—even obvious errors such as duplication of identifiers. This allows applications great leeway in how they build their models, but it means that software authors must take deliberate steps to ensure that the model will be, in the end, valid SBML. These steps include such things as keeping track of the identifiers used in a model, manually performing updates in certain situations where an entity is referenced in more than one place (e.g., a species that is referenced by multiple SpeciesReference objects), and so on. That said, libSBML does provide powerful features for deliberately performing validation of SBML when an application decides it is time to do so. The interfaces to these facilities are on the SBMLDocument class, in the form of SBMLDocument::checkInternalConsistency() and SBMLDocument::checkConsistency(). Please refer to the documentation for SBMLDocument for more information about this. While applications may play fast and loose and live like free spirits during the construction and editing of SBML models, they should always make sure to call SBMLDocument::checkInternalConsistency() and/or SBMLDocument::checkConsistency() before writing out the final version of an SBML model. =over =item Model::Model Creates a new Model, optionally with a given identifier and name. @param id a string, the optional identifier of this Model @param name a string, the optional name of this Model. @docnote The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be I for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation. =item Model::Model Creates a new Model using the given SBML C and C values and optionally a set of XMLNamespaces. @param level an unsigned int, the SBML Level to assign to this Model @param version an unsigned int, the SBML Version to assign to this Model @param xmlns XMLNamespaces, a pointer to an array of XMLNamespaces to assign to this Model @note Once a Model has been added to an SBMLDocument, the C, C and C namespaces for the document I those used to create the Model. Despite this, the ability to supply the values at creation time is an important aid to creating valid SBML. Knowledge of the intented SBML Level and Version determine whether it is valid to assign a particular value to an attribute, or whether it is valid to add an object to an existing SBMLDocument. @docnote The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be I for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation. =item Model::Model Creates a new Model using the given SBMLNamespaces object C. The SBMLNamespaces object encapsulates SBML Level/Version/namespaces information. It is used to communicate the SBML Level, Version, and (in Level 3) packages used in addition to SBML Level  Core. A common approach to using this class constructor is to create an SBMLNamespaces object somewhere in a program, once, then pass it to object constructors such as this one when needed. @param sbmlns an SBMLNamespaces object. @note Once a Model has been added to an SBMLDocument, the C, C and C namespaces for the document I those used to create the Model. Despite this, the ability to supply the values at creation time is an important aid to creating valid SBML. Knowledge of the intented SBML Level and Version determine whether it is valid to assign a particular value to an attribute, or whether it is valid to add an object to an existing SBMLDocument. @docnote The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be I for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation. =item Model::Model Copy constructor; creates a (deep) copy of the given Model object. =item Model::accept Accepts the given SBMLVisitor for this instance of Constraint. @param v the SBMLVisitor instance to be used. Returns the result of calling C. =item Model::clone Creates and returns a deep copy of this Model object. Returns a (deep) copy of this Model. =item Model::getModelHistory Returns the ModelHistory of this Model. Returns ModelHistory of this Model. =item Model::getModelHistory Returns the ModelHistory of this Model. Returns ModelHistory of this Model. =item Model::isSetModelHistory Predicate returning C or C depending on whether this Model's ModelHistory has been set. @htmlinclude libsbml-comment-set-methods.html Returns C if the ModelHistory of this Model has been set, C otherwise. =item Model::setModelHistory Sets the ModelHistory of this Model. @htmlinclude libsbml-comment-set-methods.html @param history ModelHistory of this Model. =item Model::unsetModelHistory Unsets the ModelHistory of this Model. @htmlinclude libsbml-comment-set-methods.html =item Model::addFunctionDefinition Adds a copy of the given FunctionDefinition object to this Model. @param fd the FunctionDefinition to add @note This method should be used with some caution. The fact that this method I the object passed to it means that the caller will be left holding a physically different object instance than the one contained in this Model. Changes made to the original object instance (such as resetting attribute values) will not affect the instance in the Model. In addition, the caller should make sure to free the original object if it is no longer being used, or else a memory leak will result. Please see Model::createFunctionDefinition() for a method that does not lead to these issues. @see createFunctionDefinition() =item Model::addUnitDefinition Adds a copy of the given UnitDefinition object to this Model. @param ud the UnitDefinition object to add @note This method should be used with some caution. The fact that this method I the object passed to it means that the caller will be left holding a physically different object instance than the one contained in this Model. Changes made to the original object instance (such as resetting attribute values) will not affect the instance in the Model. In addition, the caller should make sure to free the original object if it is no longer being used, or else a memory leak will result. Please see Model::createUnitDefinition() for a method that does not lead to these issues. @see createUnitDefinition() =item Model::addCompartmentType Adds a copy of the given CompartmentType object to this Model. @param ct the CompartmentType object to add @note This method should be used with some caution. The fact that this method I the object passed to it means that the caller will be left holding a physically different object instance than the one contained in this Model. Changes made to the original object instance (such as resetting attribute values) will not affect the instance in the Model. In addition, the caller should make sure to free the original object if it is no longer being used, or else a memory leak will result. Please see Model::createCompartmentType() for a method that does not lead to these issues. @see createCompartmentType() =item Model::addSpeciesType Adds a copy of the given SpeciesType object to this Model. @param st the SpeciesType object to add @note This method should be used with some caution. The fact that this method I the object passed to it means that the caller will be left holding a physically different object instance than the one contained in this Model. Changes made to the original object instance (such as resetting attribute values) will not affect the instance in the Model. In addition, the caller should make sure to free the original object if it is no longer being used, or else a memory leak will result. Please see Model::createSpeciesType() for a method that does not lead to these issues. @see createSpeciesType() =item Model::addCompartment Adds a copy of the given Compartment object to this Model. @param c the Compartment object to add @note This method should be used with some caution. The fact that this method I the object passed to it means that the caller will be left holding a physically different object instance than the one contained in this Model. Changes made to the original object instance (such as resetting attribute values) will not affect the instance in the Model. In addition, the caller should make sure to free the original object if it is no longer being used, or else a memory leak will result. Please see Model::createCompartment() for a method that does not lead to these issues. @see createCompartment() =item Model::addSpecies Adds a copy of the given Species object to this Model. @param s the Species object to add @note This method should be used with some caution. The fact that this method I the object passed to it means that the caller will be left holding a physically different object instance than the one contained in this Model. Changes made to the original object instance (such as resetting attribute values) will not affect the instance in the Model. In addition, the caller should make sure to free the original object if it is no longer being used, or else a memory leak will result. Please see Model::createSpecies() for a method that does not lead to these issues. @see createSpecies() =item Model::addParameter Adds a copy of the given Parameter object to this Model. @param p the Parameter object to add @note This method should be used with some caution. The fact that this method I the object passed to it means that the caller will be left holding a physically different object instance than the one contained in this Model. Changes made to the original object instance (such as resetting attribute values) will not affect the instance in the Model. In addition, the caller should make sure to free the original object if it is no longer being used, or else a memory leak will result. Please see Model::createParameter() for a method that does not lead to these issues. @see createParameter() =item Model::addInitialAssignment Adds a copy of the given InitialAssignment object to this Model. @param ia the InitialAssignment object to add @note This method should be used with some caution. The fact that this method I the object passed to it means that the caller will be left holding a physically different object instance than the one contained in this Model. Changes made to the original object instance (such as resetting attribute values) will not affect the instance in the Model. In addition, the caller should make sure to free the original object if it is no longer being used, or else a memory leak will result. Please see Model::createInitialAssignment() for a method that does not lead to these issues. @see createInitialAssignment() =item Model::addRule Adds a copy of the given Rule object to this Model. @param r the Rule object to add @note This method should be used with some caution. The fact that this method I the object passed to it means that the caller will be left holding a physically different object instance than the one contained in this Model. Changes made to the original object instance (such as resetting attribute values) will not affect the instance in the Model. In addition, the caller should make sure to free the original object if it is no longer being used, or else a memory leak will result. Please see the methods Model::createAlgebraicRule(), Model::createAssignmentRule() and Model::createRateRule() for methods that do not lead to these issues. @see createAlgebraicRule() @see createAssignmentRule() @see createRateRule() =item Model::addConstraint Adds a copy of the given Constraint object to this Model. @param c the Constraint object to add @note This method should be used with some caution. The fact that this method I the object passed to it means that the caller will be left holding a physically different object instance than the one contained in this Model. Changes made to the original object instance (such as resetting attribute values) will not affect the instance in the Model. In addition, the caller should make sure to free the original object if it is no longer being used, or else a memory leak will result. Please see Model::createConstraint() for a method that does not lead to these issues. @see createConstraint() =item Model::addReaction Adds a copy of the given Reaction object to this Model. @param r the Reaction object to add @note This method should be used with some caution. The fact that this method I the object passed to it means that the caller will be left holding a physically different object instance than the one contained in this Model. Changes made to the original object instance (such as resetting attribute values) will not affect the instance in the Model. In addition, the caller should make sure to free the original object if it is no longer being used, or else a memory leak will result. Please see Model::createReaction() for a method that does not lead to these issues. @see createReaction() =item Model::addEvent Adds a copy of the given Event object to this Model. @param e the Event object to add @note This method should be used with some caution. The fact that this method I the object passed to it means that the caller will be left holding a physically different object instance than the one contained in this Model. Changes made to the original object instance (such as resetting attribute values) will not affect the instance in the Model. In addition, the caller should make sure to free the original object if it is no longer being used, or else a memory leak will result. Please see Model::createEvent() for a method that does not lead to these issues. @see createEvent() =item Model::createFunctionDefinition Creates a new FunctionDefinition inside this Model and returns it. Returns the FunctionDefinition object created @see addFunctionDefinition(const FunctionDefinition fd) =item Model::createUnitDefinition Creates a new UnitDefinition inside this Model and returns it. Returns the UnitDefinition object created @see addUnitDefinition(const UnitDefinition ud) =item Model::createUnit Creates a new Unit object within the last UnitDefinition object created in this model and returns a pointer to it. The mechanism by which the UnitDefinition was created is not significant. If a UnitDefinition object does not exist in this model, a new Unit is I created and NULL is returned instead. Returns the Unit object created @see addUnitDefinition(const UnitDefinition ud) =item Model::createCompartmentType Creates a new CompartmentType inside this Model and returns it. Returns the CompartmentType object created @see addCompartmentType(const CompartmentType ct) =item Model::createSpeciesType Creates a new SpeciesType inside this Model and returns it. Returns the SpeciesType object created @see addSpeciesType(const SpeciesType st) =item Model::createCompartment Creates a new Compartment inside this Model and returns it. Returns the Compartment object created @see addCompartment(const Compartment c) =item Model::createSpecies Creates a new Species inside this Model and returns it. Returns the Species object created @see addSpecies(const Species s) =item Model::createParameter Creates a new Parameter inside this Model and returns it. Returns the Parameter object created @see addParameter(const Parameter p) =item Model::createInitialAssignment Creates a new InitialAssignment inside this Model and returns it. Returns the InitialAssignment object created @see addInitialAssignment(const InitialAssignment ia) =item Model::createAlgebraicRule Creates a new AlgebraicRule inside this Model and returns it. Returns the AlgebraicRule object created @see addRule(const Rule r) =item Model::createAssignmentRule Creates a new AssignmentRule inside this Model and returns it. Returns the AssignmentRule object created @see addRule(const Rule r) =item Model::createRateRule Creates a new RateRule inside this Model and returns it. Returns the RateRule object created @see addRule(const Rule r) =item Model::createConstraint Creates a new Constraint inside this Model and returns it. Returns the Constraint object created @see addConstraint(const Constraint c) =item Model::createReaction Creates a new Reaction inside this Model and returns it. Returns the Reaction object created @see addReaction(const Reaction r) =item Model::createReactant Creates a new SpeciesReference object for a reactant inside the last Reaction object in this Model, and returns a pointer to it. The mechanism by which the last Reaction object was created and added to this Model is not significant. It could have been created in a variety of ways, for example using createReaction(). If a Reaction does not exist for this model, a new SpeciesReference is I created and NULL is returned instead. Returns the SpeciesReference object created =item Model::createProduct Creates a new SpeciesReference object for a product inside the last Reaction object in this Model, and returns a pointer to it. The mechanism by which the last Reaction object was created and added to this Model is not significant. It could have been created in a variety of ways, for example using createReaction(). If a Reaction does not exist for this model, a new SpeciesReference is I created and NULL is returned instead. Returns the SpeciesReference object created =item Model::createModifier Creates a new ModifierSpeciesReference object for a modifier species inside the last Reaction object in this Model, and returns a pointer to it. The mechanism by which the last Reaction object was created and added to this Model is not significant. It could have been created in a variety of ways, for example using createReaction(). If a Reaction does not exist for this model, a new ModifierSpeciesReference is @em not created and NULL is returned instead. Returns the SpeciesReference object created =item Model::createKineticLaw Creates a new KineticLaw inside the last Reaction object created in this Model, and returns a pointer to it. The mechanism by which the last Reaction object was created and added to this Model is not significant. It could have been created in a variety of ways, for example using createReaction(). If a Reaction does not exist for this model, or a Reaction exists but already has a KineticLaw, a new KineticLaw is I created and NULL is returned instead. Returns the KineticLaw object created =item Model::createKineticLawParameter Creates a new local Parameter inside the KineticLaw object of the last Reaction created inside this Model, and returns a pointer to it. The last KineticLaw object in this Model could have been created in a variety of ways. For example, it could have been added using createKineticLaw(), or it could be the result of using Reaction::createKineticLaw() on the Reaction object created by a createReaction(). If a Reaction does not exist for this model, or the last Reaction does not contain a KineticLaw object, a new Parameter is I created and NULL is returned instead. Returns the Parameter object created =item Model::createEvent Creates a new Event inside this Model and returns it. Returns the Event object created =item Model::createEventAssignment Creates a new EventAssignment inside the last Event object created in this Model, and returns a pointer to it. The mechanism by which the last Event object in this model was created is not significant. It could have been created in a variety of ways, for example by using createEvent(). If no Event object exists in this Model object, a new EventAssignment is I created and NULL is returned instead. Returns the EventAssignment object created =item Model::createTrigger Creates a new Trigger inside the last Event object created in this Model, and returns a pointer to it. The mechanism by which the last Event object in this model was created is not significant. It could have been created in a variety of ways, for example by using createEvent(). If no Event object exists in this Model object, a new Trigger is I created and NULL is returned instead. Returns the Trigger object created =item Model::createDelay Creates a new Delay inside the last Event object created in this Model, and returns a pointer to it. The mechanism by which the last Event object in this model was created is not significant. It could have been created in a variety of ways, for example by using createEvent(). If no Event object exists in this Model object, a new Delay is I created and NULL is returned instead. Returns the Delay object created =item Model::setAnnotation Sets the value of the "annotation" subelement of this SBML object to a copy of C. Any existing content of the "annotation" subelement is discarded. Unless you have taken steps to first copy and reconstitute any existing annotations into the C that is about to be assigned, it is likely that performing such wholesale replacement is unfriendly towards other software applications whose annotations are discarded. An alternative may be to use appendAnnotation(). @param annotation an XML structure that is to be used as the content of the "annotation" subelement of this object @see appendAnnotation(const XMLNode annotation) =item Model::setAnnotation Sets the value of the "annotation" subelement of this SBML object to a copy of C. Any existing content of the "annotation" subelement is discarded. Unless you have taken steps to first copy and reconstitute any existing annotations into the C that is about to be assigned, it is likely that performing such wholesale replacement is unfriendly towards other software applications whose annotations are discarded. An alternative may be to use appendAnnotation(). @param annotation an XML string that is to be used as the content of the "annotation" subelement of this object @see appendAnnotation(const std::string& annotation) =item Model::appendAnnotation Appends annotation content to any existing content in the "annotation" subelement of this object. The content in C is copied. Unlike setAnnotation(), this method allows other annotations to be preserved when an application adds its own data. @param annotation an XML structure that is to be copied and appended to the content of the "annotation" subelement of this object @see setAnnotation(const XMLNode annotation) =item Model::appendAnnotation Appends annotation content to any existing content in the "annotation" subelement of this object. The content in C is copied. Unlike setAnnotation(), this method allows other annotations to be preserved when an application adds its own data. @param annotation an XML string that is to be copied and appended to the content of the "annotation" subelement of this object @see setAnnotation(const std::string& annotation) =item Model::getListOfFunctionDefinitions Get the ListOfFunctionDefinitions object in this Model. Returns the list of FunctionDefinitions for this Model. =item Model::getListOfFunctionDefinitions Get the ListOfFunctionDefinitions object in this Model. Returns the list of FunctionDefinitions for this Model. =item Model::getListOfUnitDefinitions Get the ListOfUnitDefinitions object in this Model. Returns the list of UnitDefinitions for this Model. =item Model::getListOfUnitDefinitions Get the ListOfUnitDefinitions object in this Model. Returns the list of UnitDefinitions for this Model. =item Model::getListOfCompartmentTypes Get the ListOfCompartmentTypes object in this Model. Returns the list of CompartmentTypes for this Model. =item Model::getListOfCompartmentTypes Get the ListOfCompartmentTypes object in this Model. Returns the list of CompartmentTypes for this Model. =item Model::getListOfSpeciesTypes Get the ListOfSpeciesTypes object in this Model. Returns the list of SpeciesTypes for this Model. =item Model::getListOfSpeciesTypes Get the ListOfSpeciesTypes object in this Model. Returns the list of SpeciesTypes for this Model. =item Model::getListOfCompartments Get the ListOfCompartments object in this Model. Returns the list of Compartments for this Model. =item Model::getListOfCompartments Get the ListOfCompartments object in this Model. Returns the list of Compartments for this Model. =item Model::getListOfSpecies Get the ListOfSpecies object in this Model. Returns the list of Species for this Model. =item Model::getListOfSpecies Get the ListOfSpecies object in this Model. Returns the list of Species for this Model. =item Model::getListOfParameters Get the ListOfParameters object in this Model. Returns the list of Parameters for this Model. =item Model::getListOfParameters Get the ListOfParameters object in this Model. Returns the list of Parameters for this Model. =item Model::getListOfInitialAssignments Get the ListOfInitialAssignments object in this Model. Returns the list of InitialAssignments for this Model. =item Model::getListOfInitialAssignments Get the ListOfInitialAssignments object in this Model. Returns the list of InitialAssignment for this Model. =item Model::getListOfRules Get the ListOfRules object in this Model. Returns the list of Rules for this Model. =item Model::getListOfRules Get the ListOfRules object in this Model. Returns the list of Rules for this Model. =item Model::getListOfConstraints Get the ListOfConstraints object in this Model. Returns the list of Constraints for this Model. =item Model::getListOfConstraints Get the ListOfConstraints object in this Model. Returns the list of Constraints for this Model. =item Model::getListOfReactions Get the ListOfReactions object in this Model. Returns the list of Reactions for this Model. =item Model::getListOfReactions Get the ListOfReactions object in this Model. Returns the list of Reactions for this Model. =item Model::getListOfEvents Get the ListOfEvents object in this Model. Returns the list of Events for this Model. =item Model::getListOfEvents Get the ListOfEvents object in this Model. Returns the list of Events for this Model. =item Model::getFunctionDefinition Get the nth FunctionDefinitions object in this Model. Returns the nth FunctionDefinition of this Model. =item Model::getFunctionDefinition Get the nth FunctionDefinitions object in this Model. Returns the nth FunctionDefinition of this Model. =item Model::getFunctionDefinition Get a FunctionDefinition object based on its identifier. Returns the FunctionDefinition in this Model with the identifier C or NULL if no such FunctionDefinition exists. =item Model::getFunctionDefinition Get a FunctionDefinition object based on its identifier. Returns the FunctionDefinition in this Model with the identifier C or NULL if no such FunctionDefinition exists. =item Model::getUnitDefinition Get the nth UnitDefinition object in this Model. Returns the nth UnitDefinition of this Model. =item Model::getUnitDefinition Get the nth UnitDefinition object in this Model. Returns the nth UnitDefinition of this Model. =item Model::getUnitDefinition Get a UnitDefinition based on its identifier. Returns the UnitDefinition in this Model with the identifier C or NULL if no such UnitDefinition exists. =item Model::getUnitDefinition Get a UnitDefinition based on its identifier. Returns the UnitDefinition in this Model with the identifier C or NULL if no such UnitDefinition exists. =item Model::getCompartmentType Get the nth CompartmentType object in this Model. Returns the nth CompartmentType of this Model. =item Model::getCompartmentType Get the nth CompartmentType object in this Model. Returns the nth CompartmentType of this Model. =item Model::getCompartmentType Get a CompartmentType object based on its identifier. Returns the CompartmentType in this Model with the identifier C or NULL if no such CompartmentType exists. =item Model::getCompartmentType Get a CompartmentType object based on its identifier. Returns the CompartmentType in this Model with the identifier C or NULL if no such CompartmentType exists. =item Model::getSpeciesType Get the nth SpeciesType object in this Model. Returns the nth SpeciesType of this Model. =item Model::getSpeciesType Get the nth SpeciesType object in this Model. Returns the nth SpeciesType of this Model. =item Model::getSpeciesType Get a SpeciesType object based on its identifier. Returns the SpeciesType in this Model with the identifier C or NULL if no such SpeciesType exists. =item Model::getSpeciesType Get a SpeciesType object based on its identifier. Returns the SpeciesType in this Model with the identifier C or NULL if no such SpeciesType exists. =item Model::getCompartment Get the nth Compartment object in this Model. Returns the nth Compartment of this Model. =item Model::getCompartment Get the nth Compartment object in this Model. Returns the nth Compartment of this Model. =item Model::getCompartment Get a Compartment object based on its identifier. Returns the Compartment in this Model with the identifier C or NULL if no such Compartment exists. =item Model::getCompartment Get a Compartment object based on its identifier. Returns the Compartment in this Model with the identifier C or NULL if no such Compartment exists. =item Model::getSpecies Get the nth Species object in this Model. Returns the nth Species of this Model. =item Model::getSpecies Get the nth Species object in this Model. Returns the nth Species of this Model. =item Model::getSpecies Get a Species object based on its identifier. Returns the Species in this Model with the identifier C or NULL if no such Species exists. =item Model::getSpecies Get a Species object based on its identifier. Returns the Species in this Model with the identifier C or NULL if no such Species exists. =item Model::getParameter Get the nth Parameter object in this Model. Returns the nth Parameter of this Model. =item Model::getParameter Get the nth Parameter object in this Model. Returns the nth Parameter of this Model. =item Model::getParameter Get a Parameter object based on its identifier. Returns the Parameter in this Model with the identifier C or NULL if no such Parameter exists. =item Model::getParameter Get a Parameter object based on its identifier. Returns the Parameter in this Model with the identifier C or NULL if no such Parameter exists. =item Model::getInitialAssignment Get the nth InitialAssignment object in this Model. Returns the nth InitialAssignment of this Model. =item Model::getInitialAssignment Get the nth InitialAssignment object in this Model. Returns the nth InitialAssignment of this Model. =item Model::getInitialAssignment Get an InitialAssignment object based on the symbol to which it assigns a value. Returns the InitialAssignment in this Model with the given "symbol" attribute value or NULL if no such InitialAssignment exists. =item Model::getInitialAssignment Get an InitialAssignment object based on the symbol to which it assigns a value. Returns the InitialAssignment in this Model with the given "symbol" attribute value or NULL if no such InitialAssignment exists. =item Model::getRule Get the nth Rule object in this Model. Returns the nth Rule of this Model. =item Model::getRule Get the nth Rule object in this Model. Returns the nth Rule of this Model. =item Model::getRule Get a Rule object based on the variable to which it assigns a value. Returns the Rule in this Model with the given "variable" attribute value or NULL if no such Rule exists. =item Model::getRule Get a Rule object based on the variable to which it assigns a value. Returns the Rule in this Model with the given "variable" attribute value or NULL if no such Rule exists. =item Model::getConstraint Get the nth Constraint object in this Model. Returns the nth Constraint of this Model. =item Model::getConstraint Get the nth Constraint object in this Model. Returns the nth Constraint of this Model. =item Model::getReaction Get the nth Reaction object in this Model. Returns the nth Reaction of this Model. =item Model::getReaction Get the nth Reaction object in this Model. Returns the nth Reaction of this Model. =item Model::getReaction Get a Reaction object based on its identifier. Returns the Reaction in this Model with the identifier C or NULL if no such Reaction exists. =item Model::getReaction Get a Reaction object based on its identifier. Returns the Reaction in this Model with the identifier C or NULL if no such Reaction exists. =item Model::getEvent Get the nth Event object in this Model. Returns the nth Event of this Model. =item Model::getEvent Get the nth Event object in this Model. Returns the nth Event of this Model. =item Model::getEvent Get an Event object based on its identifier. Returns the Event in this Model with the identifier C or NULL if no such Event exists. =item Model::getEvent Get an Event object based on its identifier. Returns the Event in this Model with the identifier C or NULL if no such Event exists. =item Model::getNumFunctionDefinitions Get the number of FunctionDefinition objects in this Model. Returns the number of FunctionDefinitions in this Model. =item Model::getNumUnitDefinitions Get the number of UnitDefinition objects in this Model. Returns the number of UnitDefinitions in this Model. =item Model::getNumCompartmentTypes Get the number of CompartmentType objects in this Model. Returns the number of CompartmentTypes in this Model. =item Model::getNumSpeciesTypes Get the number of SpeciesType objects in this Model. Returns the number of SpeciesTypes in this Model. =item Model::getNumCompartments Get the number of Compartment objects in this Model. Returns the number of Compartments in this Model. =item Model::getNumSpecies Get the number of Specie objects in this Model. Returns the number of Species in this Model. =item Model::getNumSpeciesWithBoundaryCondition Get the number of Species in this Model having their "boundaryCondition" attribute value set to C. Returns the number of Species in this Model with boundaryCondition set to true. =item Model::getNumParameters Get the number of Parameter objects in this Model. Returns the number of Parameters in this Model. Parameters defined in KineticLaws are not included. =item Model::getNumInitialAssignments Get the number of InitialAssignment objects in this Model. Returns the number of InitialAssignments in this Model. =item Model::getNumRules Get the number of Rule objects in this Model. Returns the number of Rules in this Model. =item Model::getNumConstraints Get the number of Constraint objects in this Model. Returns the number of Constraints in this Model. =item Model::getNumReactions Get the number of Reaction objects in this Model. Returns the number of Reactions in this Model. =item Model::getNumEvents Get the number of Event objects in this Model. Returns the number of Events in this Model. =item Model::convertToL1 Converts the model to a from SBML Level 2 to Level 1. Most of the necessary changes occur during the various writeAttributes() methods, however there are some difference between L1 and L2 that require the underlying Model to be changed. =item Model::convertToL2 Converts the model to a from SBML Level 1 to Level 2. Most of the necessary changes occur during the various writeAttributes() methods, however there are some difference between L1 and L2 that require the underlying Model to be changed. =item Model::isBoolean Predicate returning C or C depending on whether the given ASTNode is a boolean. Often times, this question can be answered with the ASTNode's own isBoolean() method, but if the AST is an expression that calls a function defined in the Model's ListOfFunctionDefinitions, the model is needed for lookup context. Returns true if the given ASTNode is a boolean. =item Model::removeDuplicateTopLevelAnnotations Predicate returning C or C depending on whether the given ASTNode is a boolean. Often times, this question can be answered with the ASTNode's own isBoolean() method, but if the AST is an expression that calls a function defined in the Model's ListOfFunctionDefinitions, the model is needed for lookup context. Returns true if the given ASTNode is a boolean. @deprecated libSBML internal =item Model::setSBMLDocument Sets the parent SBMLDocument of this SBML object. @param d the SBMLDocument object to set @deprecated libSBML internal =item Model::setParentSBMLObject Sets the parent SBML object of this SBML object. @param sb the SBML object to use @deprecated libSBML internal =item Model::getTypeCode Returns the libSBML type code for this SBML object. @if clike LibSBML attaches an identifying code to every kind of SBML object. These are known as SBML type codes. The set of possible type codes is defined in the enumeration #SBMLTypeCode_t. The names of the type codes all begin with the characters C. @endif@if java LibSBML attaches an identifying code to every kind of SBML object. These are known as SBML type codes. In other languages, the set of type codes is stored in an enumeration; in the Java language interface for libSBML, the type codes are defined as static integer constants in interface class {@link libsbmlConstants}. The names of the type codes all begin with the characters C. @endif Returns the SBML type code for this object, or C (default). @see getElementName() =item Model::getElementName Returns the XML element name of this object, which for Model, is always C<"model">. Returns the name of this element, i.e., C<"model">. =item Model::getElementPosition Returns the ordinal position of the element with respect to its siblings or -1 (default) to indicate the position is not significant. @deprecated libSBML internal =item Model::writeElements Subclasses should override this method to write out their contained SBML objects as XML elements. Be sure to call your parents implementation of this method as well. @deprecated libSBML internal =item Model::getListOfLayouts Returns the ListOf Layouts for this Model. =item Model::getListOfLayouts Returns the ListOf Layouts for this Model. =item Model::getLayout Returns the layout object that belongs to the given index. If the index is invalid, NULL is returned. =item Model::getLayout Returns the layout object that belongs to the given index. If the index is invalid, NULL is returned. =item Model::addLayout Adds a copy of the layout object to the list of layouts. =item Model::createLayout Creates a new layout object and adds it to the list of layout objects and returns it. =item Model::populateListFormulaUnitsData Populates the list of FormulaDataUnits with the units derived for the model. The list contains elements of class FormulaUnitsData. The first element of the list refers to the default units of 'substance per time' derived from the model and has the unitReferenceId 'subs_per_time'. This facilitates the comparison of units derived from mathematical formula with the expected units. The next elements of the list record the units of the compartments and species established from either explicitly declared or default units. The next elements record the units of any parameters. Subsequent elements of the list record the units derived for each mathematical expression encountered within the model. @note This function is utilised by the Unit Consistency Validator. The list is populated prior to running the validation and thus the consistency of units can be checked by accessing the members of the list and comparing the appropriate data. =item Model::isPopulatedListFormulaUnitsData Predicate returning C or C depending on whether the list of FormulaUnitsData has been populated. Returns C if the list of FormulaUnitsData has been populated, C otherwise. =item Model::addFormulaUnitsData Adds a copy of the given FormulaUnitsData object to this Model. @param fud the FormulaUnitsData to add @deprecated libSBML internal =item Model::createFormulaUnitsData Creates a new FormulaUnitsData inside this Model and returns it. Returns the FormulaUnitsData object created @deprecated libSBML internal =item Model::getFormulaUnitsData Get the nth FormulaUnitsData object in this Model. Returns the nth FormulaUnitsData of this Model. @deprecated libSBML internal =item Model::getFormulaUnitsData Get the nth FormulaUnitsData object in this Model. Returns the nth FormulaUnitsData of this Model. @deprecated libSBML internal =item Model::getFormulaUnitsData Get a FormulaUnitsData object based on its unitReferenceId and typecode. Returns the FormulaUnitsData in this Model with the unitReferenceId C and the SBMLTypeCode_t C or NULL if no such FormulaUnitsData exists. @note The SBMLTypecode_t parameter is necessary as the unitReferenceId of the FormulaUnitsData need not be unique. For example if a Species with id 's' is assigned by an AssignmentRule there will be two elements of the FormulaUnitsData list with the unitReferenceId 's'; one with typecode 'SBML_SPECIES' referring to the units related to the species, the other with typecode 'SBML_ASSIGNMENT_RULE' referring to the units derived from the math element of the AssignmentRule. @deprecated libSBML internal =item Model::getFormulaUnitsData Get a FormulaUnitsData object based on its unitReferenceId and typecode. Returns the FormulaUnitsData in this Model with the unitReferenceId C and the SBMLTypeCode_t C or NULL if no such FormulaUnitsData exists. @note The SBMLTypecode_t parameter is necessary as the unitReferenceId of the FormulaUnitsData need not be unique. For example if a Species with id 's' is assigned by an AssignmentRule there will be two elements of the FormulaUnitsData list with the unitReferenceId 's'; one with typecode 'SBML_SPECIES' referring to the units related to the species, the other with typecode 'SBML_ASSIGNMENT_RULE' referring to the units derived from the math element of the AssignmentRule. @deprecated libSBML internal =item Model::getNumFormulaUnitsData Get the number of FormulaUnitsData objects in this Model. Returns the number of FormulaUnitsData in this Model. @deprecated libSBML internal =item Model::getListFormulaUnitsData Get the list of FormulaUnitsData object in this Model. Returns the list of FormulaUnitsData for this Model. @deprecated libSBML internal =item Model::getListFormulaUnitsData Get the list of FormulaUnitsData object in this Model. Returns the list of FormulaUnitsData for this Model. @deprecated libSBML internal =item Model::readOtherXML Subclasses should override this method to read (and store) XHTML, MathML, etc. directly from the XMLInputStream. Returns true if the subclass read from the stream, false otherwise. @deprecated libSBML internal =item Model::createObject Returns the SBML object corresponding to next XMLToken in the XMLInputStream or NULL if the token was not recognized. @deprecated libSBML internal =item Model::readAttributes Subclasses should override this method to read values from the given XMLAttributes set into their specific fields. Be sure to call your parents implementation of this method as well. @deprecated libSBML internal =item Model::writeAttributes Subclasses should override this method to write their XML attributes to the XMLOutputStream. Be sure to call your parents implementation of this method as well. @deprecated libSBML internal =item Model::syncAnnotation Synchronizes the annotation of this SBML object. Annotation element (XMLNode mAnnotation) is synchronized with the current CVTerm objects (List mCVTerm), ModelHistory object (ModelHistory mHistory) and ListOfLayouts object (ListOfLayouts mLayouts). Currently, this method is called in getAnnotation, isSetAnnotation, and writeElements methods. @deprecated libSBML internal =item Model::syncAnnotation Synchronizes the annotation of this SBML object. Annotation element (XMLNode mAnnotation) is synchronized with the current CVTerm objects (List mCVTerm), ModelHistory object (ModelHistory mHistory) and ListOfLayouts object (ListOfLayouts mLayouts). Currently, this method is called in getAnnotation, isSetAnnotation, and writeElements methods. @deprecated libSBML internal =item Model::syncAnnotation Synchronizes the annotation of this SBML object. Annotation element (XMLNode mAnnotation) is synchronized with the current CVTerm objects (List mCVTerm), ModelHistory object (ModelHistory mHistory) and ListOfLayouts object (ListOfLayouts mLayouts). Currently, this method is called in getAnnotation, isSetAnnotation, and writeElements methods. @deprecated libSBML internal =item Model::syncAnnotation Synchronizes the annotation of this SBML object. Annotation element (XMLNode mAnnotation) is synchronized with the current CVTerm objects (List mCVTerm), ModelHistory object (ModelHistory mHistory) and ListOfLayouts object (ListOfLayouts mLayouts). Currently, this method is called in getAnnotation, isSetAnnotation, and writeElements methods. @deprecated libSBML internal =item Model::syncAnnotation Synchronizes the annotation of this SBML object. Annotation element (XMLNode mAnnotation) is synchronized with the current CVTerm objects (List mCVTerm), ModelHistory object (ModelHistory mHistory) and ListOfLayouts object (ListOfLayouts mLayouts). Currently, this method is called in getAnnotation, isSetAnnotation, and writeElements methods. @deprecated libSBML internal =item Model::syncAnnotation Synchronizes the annotation of this SBML object. Annotation element (XMLNode mAnnotation) is synchronized with the current CVTerm objects (List mCVTerm), ModelHistory object (ModelHistory mHistory) and ListOfLayouts object (ListOfLayouts mLayouts). Currently, this method is called in getAnnotation, isSetAnnotation, and writeElements methods. @deprecated libSBML internal =item Model::syncAnnotation Synchronizes the annotation of this SBML object. Annotation element (XMLNode mAnnotation) is synchronized with the current CVTerm objects (List mCVTerm), ModelHistory object (ModelHistory mHistory) and ListOfLayouts object (ListOfLayouts mLayouts). Currently, this method is called in getAnnotation, isSetAnnotation, and writeElements methods. @deprecated libSBML internal =item Model::syncAnnotation Synchronizes the annotation of this SBML object. Annotation element (XMLNode mAnnotation) is synchronized with the current CVTerm objects (List mCVTerm), ModelHistory object (ModelHistory mHistory) and ListOfLayouts object (ListOfLayouts mLayouts). Currently, this method is called in getAnnotation, isSetAnnotation, and writeElements methods. @deprecated libSBML internal =item Model::syncAnnotation Synchronizes the annotation of this SBML object. Annotation element (XMLNode mAnnotation) is synchronized with the current CVTerm objects (List mCVTerm), ModelHistory object (ModelHistory mHistory) and ListOfLayouts object (ListOfLayouts mLayouts). Currently, this method is called in getAnnotation, isSetAnnotation, and writeElements methods. @deprecated libSBML internal =item Model::syncAnnotation Synchronizes the annotation of this SBML object. Annotation element (XMLNode mAnnotation) is synchronized with the current CVTerm objects (List mCVTerm), ModelHistory object (ModelHistory mHistory) and ListOfLayouts object (ListOfLayouts mLayouts). Currently, this method is called in getAnnotation, isSetAnnotation, and writeElements methods. @deprecated libSBML internal =item Model::syncAnnotation Synchronizes the annotation of this SBML object. Annotation element (XMLNode mAnnotation) is synchronized with the current CVTerm objects (List mCVTerm), ModelHistory object (ModelHistory mHistory) and ListOfLayouts object (ListOfLayouts mLayouts). Currently, this method is called in getAnnotation, isSetAnnotation, and writeElements methods. @deprecated libSBML internal =item Model::syncAnnotation Synchronizes the annotation of this SBML object. Annotation element (XMLNode mAnnotation) is synchronized with the current CVTerm objects (List mCVTerm), ModelHistory object (ModelHistory mHistory) and ListOfLayouts object (ListOfLayouts mLayouts). Currently, this method is called in getAnnotation, isSetAnnotation, and writeElements methods. @deprecated libSBML internal =item Model::syncAnnotation Synchronizes the annotation of this SBML object. Annotation element (XMLNode mAnnotation) is synchronized with the current CVTerm objects (List mCVTerm), ModelHistory object (ModelHistory mHistory) and ListOfLayouts object (ListOfLayouts mLayouts). Currently, this method is called in getAnnotation, isSetAnnotation, and writeElements methods. @deprecated libSBML internal =item Model::syncAnnotation Synchronizes the annotation of this SBML object. Annotation element (XMLNode mAnnotation) is synchronized with the current CVTerm objects (List mCVTerm), ModelHistory object (ModelHistory mHistory) and ListOfLayouts object (ListOfLayouts mLayouts). Currently, this method is called in getAnnotation, isSetAnnotation, and writeElements methods. @deprecated libSBML internal =item Model::syncAnnotation Synchronizes the annotation of this SBML object. Annotation element (XMLNode mAnnotation) is synchronized with the current CVTerm objects (List mCVTerm), ModelHistory object (ModelHistory mHistory) and ListOfLayouts object (ListOfLayouts mLayouts). Currently, this method is called in getAnnotation, isSetAnnotation, and writeElements methods. @deprecated libSBML internal =back =head2 SBMLDocument Container for an SBML document and interface for global operations on SBML documents. @if clike LibSBML uses the class SBMLDocument as a top-level container for storing SBML content and data associated with it (such as warnings and error messages). The two primary means of reading an SBML model, SBMLReader::readSBML() and SBMLReader::readSBMLFromString(), both return a pointer to an SBMLDocument object. From there, callers can inquire about any errors encountered (e.g., using SBMLDocument::getNumErrors()), access the Model object, and perform other actions such as consistency-checking and model translation. @endif@if java LibSBML uses the class SBMLDocument as a top-level container for storing SBML content and data associated with it (such as warnings and error messages). The two primary means of reading an SBML model, SBMLReader::readSBML(String filename) and SBMLReader::readSBMLFromString(String xml), both return a pointer to an SBMLDocument object. From there, callers can inquire about any errors encountered (e.g., using SBMLDocument::getNumErrors()), access the Model object, and perform other actions such as consistency-checking and model translation. @endif When creating fresh models programmatically, the starting point is typically the creation of an SBMLDocument object instance. The SBMLDocument constructor accepts arguments for the SBML Level and Version of the model to be created. After creating the SBMLDocument object, calling programs then typically call SBMLDocument::createModel() almost immediately, and then proceed to call the methods on the Model object to fill out the model's contents. SBMLDocument corresponds roughly to the class Sbml defined in the SBML Level 2 specification. It does not have a direct correspondence in SBML Level 1. (However, to make matters simpler for applications, libSBML creates an SBMLDocument no matter whether the model is Level 1 or Level 2.) In its barest form, when written out in XML format for SBML Level 2 Version 4, the corresponding structure is the following: @verbatim @endverbatim SBMLDocument is derived from SBase, and therefore contains the usual SBase attributes (in SBML Level 2 Version 4) of "metaid" and "sboTerm", as well as the subelements "notes" and "annotation". It also contains the attributes "level" and "version" indicating the Level and Version of the SBML data structure. These can be accessed using the methods defined by the SBase class for that purpose. @section checking Checking consistency and adherence to SBML specifications One of the most important features of libSBML is its ability to perform SBML validation to ensure that a model adheres to the SBML specification for whatever Level+Version combination the model uses. SBMLDocument provides the methods for running consistency-checking and validation rules on the SBML content. First, a brief explanation of the rationale is in order. In libSBML versions up to and including the version 3.3.x series, the individual methods for creating and setting attributes and other components are quite lenient, and allow a caller to compose SBML entities that may not, in the end, represent valid SBML. This allows applications the freedom to do things such as save incomplete models (which is useful when models are being developed over long periods of time), but at the same time, it means that a separate validation step is necessary when a calling program finally wants to finish a complete SBML document. The primary interface to this facility is SBMLDocument's SBMLDocument::checkInternalConsistency() and SBMLDocument::checkConsistency(). The former verifies the basic internal consistency and syntax of an SBML document, and the latter implements more elaborate validation rules (both those defined by the SBML specifications, as well as additional rules offered by libSBML). @if clike The checks performed by SBMLDocument::checkInternalConsistency() are hardwired and cannot be changed by calling programs, but the validation performed by SBMLDocument::checkConsistency() is under program control using the method SBMLDocument::setConsistencyChecks(). Applications can selectively disable specific kinds of checks that they may not be interested in, by calling SBMLDocument::setConsistencyChecks() with appropriate parameters. @endif@if java The checks performed by SBMLDocument::checkInternalConsistency() are hardwired and cannot be changed by calling programs, but the validation performed by SBMLDocument::checkConsistency() is under program control using the method SBMLDocument::setConsistencyChecks(int categ, boolean onoff). Applications can selectively disable specific kinds of checks that they may not be interested by calling SBMLDocument::setConsistencyChecks(int categ, boolean onoff) with appropriate parameters. @endif These methods have slightly different relevance depending on whether a model is created programmaticaly from scratch, or whether it is read in from a file or data stream. The following table summarizes the possible scenarios.
Scenario Relevant methods
Creating a model from scratch Before writing out the model:
  1. Call SBMLDocument::checkInternalConsistency(), then inquire about the results by calling SBMLDocument::getNumErrors()
  2. Call @if clike SBMLDocument::setConsistencyChecks() @endif@if java SBMLDocument::setConsistencyChecks(int categ, boolean onoff) @endif to configure which checks will be performed by SBMLDocument::checkConsistency()
  3. Call SBMLDocument::checkConsistency(), then inquire about the results by calling SBMLDocument::getNumErrors()
Reading a model from a file or data stream After reading the model:
  1. Basic consistency checks will have been performed automatically by libSBML upon reading the content—only need to inquire about the results by using SBMLDocument::getNumErrors()
  2. Call @if clike SBMLDocument::setConsistencyChecks() @endif@if java SBMLDocument::setConsistencyChecks(int categ, boolean onoff) @endif to configure which checks are performed by SBMLDocument::checkConsistency()
  3. Call SBMLDocument::checkConsistency(), then inquire about the results by calling SBMLDocument::getNumErrors()
@if clike An example of using the consistency-checking and validation facilities is provided in this manual in the section @ref libsbml-example. @endif @section converting Converting documents between Levels and Versions of SBML LibSBML provides facilities for limited translation of SBML between Levels and Versions of the SBML specifications. The method for doing is is @if clike SBMLDocument::setLevelAndVersion() @endif@if java SBMLDocument::setLevelAndVersion(long lev, long ver) @endif. In general, models can be converted upward without difficulty (e.g., from SBML Level 1 to Level 2, or from an earlier Version of Level 2 to the latest Version of Level 2). Sometimes models can be translated downward as well, if they do not use constructs specific to more advanced Levels of SBML. Calling @if clike SBMLDocument::setLevelAndVersion() @endif@if java SBMLDocument::setLevelAndVersion(long lev, long ver) @endif will not I lead to a successful conversion. The method will return a boolean value to indicate success or failure. Callers must check the error log (see next section) attached to the SBMLDocument object after calling @if clike SBMLDocument::setLevelAndVersion() @endif@if java SBMLDocument::setLevelAndVersion(long lev, long ver) @endif in order to assess whether any problems arose. If an application is interested in translating to a lower Level and/or Version of SBML within a Level, the following methods allow for prior assessment of whether there is sufficient compatibility to make a translation possible: @li SBMLDocument::checkL1Compatibility(), @li SBMLDocument::checkL2v1Compatibility(), @li SBMLDocument::checkL2v2Compatibility(), @li SBMLDocument::checkL2v3Compatibility(), and @li SBMLDocument::checkL2v4Compatibility(). Some changes between Versions of SBML Level 2 may lead to unexpected behaviors when attempting conversions in either direction. For example, SBML Level 2 Version 4 relaxed the requirement for consistency in units of measurement between expressions annd quantities in a model. As a result, a model written in Version 4, if converted to Version 3 with no other changes, may fail validation as a Version 3 model because Version 3 imposed stricter requirements on unit consistency. @section errors Error handling Upon reading a model, SBMLDocument logs any problems encountered while reading the model from the file or data stream. The log contains objects that record diagnostic information about any notable issues that arose. Whether the problems are warnings or errors, they are both reported through a single common interface involving the object class SBMLError. The methods SBMLDocument::getNumErrors(), @if clike SBMLDocument::getError() @endif@if java SBMLDocument::getError(long n) @endif and SBMLDocument::printErrors() allow callers to interact with the warnings or errors logged. Alternatively, callers may retrieve the entire log as an SBMLErrorLog object using the method SBMLDocument::getErrorLog(). The SBMLErrorLog object provides some alternative methods for interacting with the set of errors and warnings. In either case, applications typically should first call SBMLDocument::getNumErrors() to find out if any issues have been logged after specific libSBML operations such as the ones discussed in the sections above. If they have, then an application will should proceed to inspect the individual reports using either the direct interfaces on SBMLDocument or using the methods on the SBMLErrorLog object. @if clike An example of using the error facility is provided in this manual in the section @ref libsbml-example. @endif
=over =item SBMLDocument::getDefaultLevel The default SBML Level of new SBMLDocument objects. This "default level" corresponds to the most recent SBML specification Level available at the time this version of libSBML was released. For this copy of libSBML, the value is C<2>. The default Level is used by SBMLDocument if no Level is explicitly specified at the time of the construction of an SBMLDocument instance. Returns an integer indicating the most recent SBML specification Level @see getDefaultVersion() =item SBMLDocument::getDefaultVersion The default Version of new SBMLDocument objects. This "default version" corresponds to the most recent SBML Version within the most recent Level of SBML available at the time this version of libSBML was released. For this copy of libSBML, the value is C<4>. The default Version is used by SBMLDocument if no Version is explicitly specified at the time of the construction of an SBMLDocument instance. Returns an integer indicating the most recent SBML specification Version @see getDefaultLevel() =item SBMLDocument::SBMLDocument Creates a new SBMLDocument, optionally with given values for the SBML Level and Version. If both the SBML Level and Version attributes are not specified, the SBML document is treated as having the latest Level and Version of SBML as determined by SBMLDocument::getDefaultLevel() and SBMLDocument::getDefaultVersion(); however, the SBMLDocument object is otherwise left blank. In particular, the blank SBMLDocument object has no associated XML attributes, including (but not limited to) an XML namespace declaration. The XML namespace declaration is not added until the model is written out, or the method @if clike SBMLDocument::setLevelAndVersion() @endif@if java SBMLDocument::setLevelAndVersion(long lev, long ver) @endif is called. This may be important to keep in mind if an application needs to add additional XML namespace declarations on the C<<sbml>> element. Application writers should either provide values for C and C on the call to this constructor, or else call @if clike SBMLDocument::setLevelAndVersion() @endif@if java SBMLDocument::setLevelAndVersion(long lev, long ver) @endif shortly after creating the SBMLDocument object. @param level an integer for the SBML Level @param version an integer for the Version within the SBML Level @if clike @see SBMLDocument::setLevelAndVersion() @endif@if java @see SBMLDocument::setLevelAndVersion(long lev, long ver) @endif @see getDefaultLevel() @see getDefaultVersion() @docnote The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be I for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation. =item SBMLDocument::SBMLDocument Copy constructor; creates a copy of this SBMLDocument. =item SBMLDocument::accept Accepts the given SBMLVisitor for this instance of SBMLDocument. @param v the SBMLVisitor instance to be used. Returns the result of calling C. =item SBMLDocument::clone Creates and returns a deep copy of this SBMLDocument. Returns a (deep) copy of this SBMLDocument. =item SBMLDocument::getModel Returns the Model object stored in this 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 @if clike SBMLDocument::setModel() @endif@if java SBMLDocument::setModel(Model m) @endif. This method returns NULL if a model does not yet exist. Returns the Model contained in this SBMLDocument. @see createModel() =item SBMLDocument::getModel Returns the Model object stored in this 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 @if clike SBMLDocument::setModel() @endif@if java SBMLDocument::setModel(Model m) @endif. This method returns NULL if a model does not yet exist. Returns the Model contained in this SBMLDocument. @see createModel() =item SBMLDocument::setLevelAndVersion Sets the SBML Level and Version of this SBMLDocument instance, attempting to convert the model as needed. This method is the principal way in libSBML to convert models between Levels and Versions of SBML. Generally, models can be converted upward without difficulty (e.g., from SBML Level 1 to Level 2, or from an earlier Version of Level 2 to the latest Version of Level 2). Sometimes models can be translated downward as well, if they do not use constructs specific to more advanced Levels of SBML. Before calling this method, callers may check compatibility directly using the methods SBMLDocument::checkL1Compatibility(), SBMLDocument::checkL2v1Compatibility(), SBMLDocument::checkL2v2Compatibility(), SBMLDocument::checkL2v3Compatibility() and SBMLDocument::checkL2v4Compatibility(). The valid combinations of SBML Level and Version as of this release of libSBML are the following: =over =item Level 1 Version 2 =item Level 2 Version 1 =item Level 2 Version 2 =item Level 2 Version 3 =item Level 2 Version 4 =back @param level the desired SBML Level @param version the desired Version within the SBML Level @note Calling this method will not I lead to a successful conversion. If the conversion fails, it will be logged in the error list associated with this SBMLDocument. Callers should consult getNumErrors() to find out if the conversion succeeded without problems. For conversions from Level 2 to Level 1, callers can also check the Level of the model after calling this method to find out whether it is Level 1. (If the conversion to Level 1 failed, the Level of this model will be left unchanged.) @see checkL1Compatibility() @see checkL2v1Compatibility() @see checkL2v2Compatibility() @see checkL2v3Compatibility() @see checkL2v4Compatibility() =item SBMLDocument::setModel Sets the Model for this SBMLDocument to a copy of the given Model. @param m the new Model to use. @see createModel() @see getModel() =item SBMLDocument::createModel Creates a new Model inside this SBMLDocument, and returns a pointer to it. In SBML Level 2, the use of an identifier on a Model object is optional. This method takes an optional argument, C, for setting the identifier. If not supplied, the identifier attribute on the Model instance is not set. @param sid the identifier of the new Model to create. @docnote The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be I for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation. @see getModel() @see @if clike SBMLDocument::setModel() @endif@if java SBMLDocument::setModel(Model m) @endif =item SBMLDocument::setConsistencyChecks 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 (C) 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 (C, a boolean) indicates whether to turn it on (value of C) or off (value of C). The possible categories (values to the argument C) are the set of values from the enumeration #SBMLErrorCategory_t. The following are the possible choices in libSBML version 3.3.x: @li C: 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, 3 and 4 specifications. @li C: 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, 3 and 4 specifications. @li C: 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, 3 and 4 specifications. @li C: 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, 3 and 4 specifications. @li C: 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, 3 and 4 specifications. @li C: 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 SBML Level 2 Versions 2, 3 and 4 specifications. @li C: 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 I @if clike SBMLDocument::setConsistencyChecks() @endif@if java SBMLDocument::setConsistencyChecks(int categ, boolean onoff) @endif 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 @if clike SBMLReader::readSBML() @endif@if java SBMLReader::readSBML(String filename) @endif, @if clike SBMLReader::readSBMLFromString() @endif@if java SBMLReader::readSBMLFromString(String xml) @endif, 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 @if clike SBMLDocument::setConsistencyChecks() @endif@if java SBMLDocument::setConsistencyChecks(int categ, boolean onoff) @endif for each such new model if they wish to change the consistency checks applied. @param category a value drawn from #SBMLErrorCategory_t indicating the consistency checking/validation to be turned on or off @param apply a boolean indicating whether the checks indicated by C should be applied or not. @see SBMLDocument::checkConsistency() =item SBMLDocument::checkConsistency 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 I errors. Callers should inspect the severity flag in the individual SBMLError objects returned by @if clike SBMLDocument::getError() @endif@if java SBMLDocument::getError(long n) @endif to determine the nature of the failures. Returns the number of failed checks (errors) encountered. @see SBMLDocument::checkInternalConsistency() =item 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 @if clike SBMLDocument::getError() @endif@if java SBMLDocument::getError(long n) @endif. 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 SBMLDocument::checkConsistency() =item SBMLDocument::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. Callers should query the results of the consistency check by calling @if clike SBMLDocument::getError() @endif@if java SBMLDocument::getError(long n) @endif. Returns the number of failed checks (errors) encountered. =item SBMLDocument::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. Callers should query the results of the consistency check by calling @if clike SBMLDocument::getError() @endif@if java SBMLDocument::getError(long n) @endif. Returns the number of failed checks (errors) encountered. =item SBMLDocument::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. Callers should query the results of the consistency check by calling @if clike SBMLDocument::getError() @endif@if java SBMLDocument::getError(long n) @endif. Returns the number of failed checks (errors) encountered. =item SBMLDocument::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. Callers should query the results of the consistency check by calling @if clike SBMLDocument::getError() @endif@if java SBMLDocument::getError(long n) @endif. Returns the number of failed checks (errors) encountered. =item SBMLDocument::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. Callers should query the results of the consistency check by calling @if clike SBMLDocument::getError() @endif@if java SBMLDocument::getError(long n) @endif. Returns the number of failed checks (errors) encountered. =item SBMLDocument::getError Returns the nth error or warning encountered during parsing, consistency checking, or attempted translation of this model. Callers can use method XMLError::getSeverity() on the result to assess the severity of the problem. The possible severity levels range from informational messages to fatal errors. Returns the error or warning indexed by integer C, or return @c NULL if C. @param n the integer index of the error sought. @see SBMLDocument::getNumErrors() =item SBMLDocument::getNumErrors Returns the number of errors or warnings encountered during parsing, consistency checking, or attempted translation of this model. Returns the number of errors or warnings encountered =item SBMLDocument::printErrors Prints to the given output stream all the errors or warnings encountered during parsing, consistency checking, or attempted translation of this model. If no errors have occurred, i.e., C, no output will be sent to the stream. The format of the output is: @verbatim N error(s): line NNN: (id) message @endverbatim @docnote The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be I for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation. =item SBMLDocument::setSBMLDocument No-op; it is provided for consistency with the method available on other libSBML object classes but has no effect on SBMLDocument. @deprecated libSBML internal =item SBMLDocument::getTypeCode Returns the libSBML type code for this SBML object. @if clike LibSBML attaches an identifying code to every kind of SBML object. These are known as SBML type codes. The set of possible type codes is defined in the enumeration #SBMLTypeCode_t. The names of the type codes all begin with the characters C. @endif@if java LibSBML attaches an identifying code to every kind of SBML object. These are known as SBML type codes. In other languages, the set of type codes is stored in an enumeration; in the Java language interface for libSBML, the type codes are defined as static integer constants in interface class {@link libsbmlConstants}. The names of the type codes all begin with the characters C. @endif Returns the SBML type code for this object, or C (default). @see SBMLDocument::getElementName() =item SBMLDocument::getElementName Returns the XML element name of this object, which for SBMLDocument, is always C<"sbml">. Returns the name of this element, i.e., C<"sbml">. =item SBMLDocument::getErrorLog Returns the list of errors or warnings logged during parsing, consistency checking, or attempted translation of this model. Returns the SBMLErrorLog used for this SBMLDocument @see SBMLDocument::getNumErrors() =item SBMLDocument::getNamespaces Returns a list of XML Namespaces associated with the XML content of this SBML document. Returns the XML Namespaces associated with this SBML object =item SBMLDocument::getElementPosition Returns the ordinal position of the element with respect to its siblings or -1 (default) to indicate the position is not significant. @deprecated libSBML internal =item SBMLDocument::writeElements Subclasses should override this method to write out their contained SBML objects as XML elements. Be sure to call your parents implementation of this method as well. @deprecated libSBML internal =item SBMLDocument::createObject Returns the SBML object corresponding to next XMLToken in the XMLInputStream or NULL if the token was not recognized. @deprecated libSBML internal =item SBMLDocument::readAttributes Subclasses should override this method to read values from the given XMLAttributes set into their specific fields. Be sure to call your parents implementation of this method as well. @deprecated libSBML internal =item SBMLDocument::writeAttributes Subclasses should override this method to write their XML attributes to the XMLOutputStream. Be sure to call your parents implementation of this method as well. @deprecated libSBML internal =item SBMLDocument::conversion_errors Subclasses should override this method to write their XML attributes to the XMLOutputStream. Be sure to call your parents implementation of this method as well. @deprecated libSBML internal =item SBMLDocument::hasStrictUnits Subclasses should override this method to write their XML attributes to the XMLOutputStream. Be sure to call your parents implementation of this method as well. @deprecated libSBML internal =item SBMLDocument::hasStrictSBO Subclasses should override this method to write their XML attributes to the XMLOutputStream. Be sure to call your parents implementation of this method as well. @deprecated libSBML internal =item SBMLDocument::hasStrictSBO Subclasses should override this method to write their XML attributes to the XMLOutputStream. Be sure to call your parents implementation of this method as well. @deprecated libSBML internal =item SBMLDocument::hasStrictSBO Subclasses should override this method to write their XML attributes to the XMLOutputStream. Be sure to call your parents implementation of this method as well. @deprecated libSBML internal =item SBMLDocument::hasStrictSBO Subclasses should override this method to write their XML attributes to the XMLOutputStream. Be sure to call your parents implementation of this method as well. @deprecated libSBML internal =item SBMLDocument::hasStrictSBO Subclasses should override this method to write their XML attributes to the XMLOutputStream. Be sure to call your parents implementation of this method as well. @deprecated libSBML internal =item SBMLDocument::hasStrictSBO Subclasses should override this method to write their XML attributes to the XMLOutputStream. Be sure to call your parents implementation of this method as well. @deprecated libSBML internal =item SBMLDocument::hasStrictSBO Subclasses should override this method to write their XML attributes to the XMLOutputStream. Be sure to call your parents implementation of this method as well. @deprecated libSBML internal =item SBMLDocument::hasStrictSBO Subclasses should override this method to write their XML attributes to the XMLOutputStream. Be sure to call your parents implementation of this method as well. @deprecated libSBML internal =back =head2 FunctionDefinition LibSBML implementation of SBML's FunctionDefinition construct. The FunctionDefinition structure associates an identifier with a function definition. This identifier can then be used as the function called in subsequent MathML content elsewhere in an SBML model. FunctionDefinition has one required attribute, "id", to give the function a unique identifier by which other parts of an SBML model definition can refer to it. A FunctionDefinition instance can also have an optional "name" attribute of type C. Identifiers and names must be used according to the guidelines described in the SBML specification (e.g., Section 3.3 in the Level 2 Version 4 specification). FunctionDefinition has a required "math" subelement containing a MathML expression defining the function body. The content of this element can only be a MathML "lambda" element. The "lambda" element must begin with zero or more "bvar" elements, followed by any other of the elements in the MathML subset allowed in SBML Level 2 I "lambda" (i.e., a "lambda" element cannot contain another "lambda" element). This is the only place in SBML where a "lambda" element can be used. The function defined by a FunctionDefinition is only available for use in other MathML elements that I the FunctionDefinition definition in the model. (These restrictions prevent recursive and mutually-recursive functions from being expressed.) A further restriction on the content of "math" is that it cannot contain references to variables other than the variables declared to the "lambda" itself. That is, the contents of MathML "ci" elements inside the body of the "lambda" can only be the variables declared by its "bvar" elements, or the identifiers of other FunctionDefinition instances earlier in the model. This means must be written so that all variables or parameters used in the MathML content are passed to them via their function parameters. @note Function definitions (also informally known as user-defined functions) were introduced in SBML Level 2. They have purposefully limited capabilities. A function cannot reference parameters or other model quantities outside of itself; values must be passed as parameters to the function. Moreover, recursive and mutually-recursive functions are not permitted. The purpose of these limitations is to balance power against complexity of implementation. With the restrictions as they are, function definitions could be implemented as textual substitutions—they are simply macros. Software implementations therefore do not need the full function-definition machinery typically associated with programming languages. @note Another important point to note is FunctionDefinition does not have a separate attribute for defining the units of the value returned by the function. The units associated with the function's return value, when the function is called from within MathML expressions elsewhere in SBML, are simply the overall units of the expression in FunctionDefinition's "math" subelement when applied to the arguments supplied in the call to the function. Ascertaining these units requires performing dimensional analysis on the expression. (Readers may wonder why there is no attribute. The reason is that having a separate attribute for declaring the units would not only be redundant, but also lead to the potential for having conflicting information. In the case of a conflict between the declared units and those of the value actually returned by the function, the only logical resolution rule would be to assume that the correct units are those of the expression anyway.) =over =back =head2 ListOfFunctionDefinitions LibSBML implementation of SBML's ListOfFunctionDefinitions construct. The various ListOf___ classes in SBML are merely containers used for organizing the main components of an SBML model. All are derived from the abstract class SBase, and inherit the various attributes and subelements of SBase, such as "metaid" as and "annotation". The ListOf___ classes do not add any attributes of their own. The relationship between the lists and the rest of an SBML model is illustrated by the following (for SBML Level 2 Version 4): @image html listof-illustration.jpg "ListOf___ elements in an SBML Model" @image latex listof-illustration.jpg "ListOf___ elements in an SBML Model" Readers may wonder about the motivations for using the ListOf___ containers. A simpler approach in XML might be to place the components all directly at the top level of the model definition. We chose instead to group them within XML elements named after ListOfClassname, in part because we believe this helps organize the components and makes visual reading of models in XML easier. More importantly, the fact that the container classes are derived from SBase means that software tools can add information about the lists themselves into each list container's "annotation". @see ListOfFunctionDefinitions @see ListOfUnitDefinitions @see ListOfCompartmentTypes @see ListOfSpeciesTypes @see ListOfCompartments @see ListOfSpecies @see ListOfParameters @see ListOfInitialAssignments @see ListOfRules @see ListOfConstraints @see ListOfReactions @see ListOfEvents =over =item FunctionDefinition::FunctionDefinition Creates a new FunctionDefinition, optionally with a given identifier and mathematical formula. @param id a string, the identifier of this FunctionDefinition instance @param formula the formula of the function definition expressed as a string in infix notation @docnote The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be I for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation. =item FunctionDefinition::FunctionDefinition Creates a new FunctionDefinition, optionally with a given identifier and mathematical formula. @param id a string, the identifier of this FunctionDefinition instance @param math the formula of the function definition expressed as an AST. =item FunctionDefinition::FunctionDefinition Creates a new FunctionDefinition using the given SBML C and C values and optionally a set of XMLNamespaces. @param level an unsigned int, the SBML Level to assign to this FunctionDefinition @param version an unsigned int, the SBML Version to assign to this FunctionDefinition @param xmlns XMLNamespaces, a pointer to an array of XMLNamespaces to assign to this FunctionDefinition @note Once a FunctionDefinition has been added to an SBMLDocument, the C, C and C namespaces for the document I those used to create the FunctionDefinition. Despite this, the ability to supply the values at creation time is an important aid to creating valid SBML. Knowledge of the intented SBML Level and Version determine whether it is valid to assign a particular value to an attribute, or whether it is valid to add an object to an existing SBMLDocument. @docnote The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be I for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation. =item FunctionDefinition::FunctionDefinition Creates a new FunctionDefinition using the given SBMLNamespaces object C. The SBMLNamespaces object encapsulates SBML Level/Version/namespaces information. It is used to communicate the SBML Level, Version, and (in Level 3) packages used in addition to SBML Level  Core. A common approach to using this class constructor is to create an SBMLNamespaces object somewhere in a program, once, then pass it to object constructors such as this one when needed. @param sbmlns an SBMLNamespaces object. @note Once a FunctionDefinition has been added to an SBMLDocument, the C, C and C namespaces for the document I those used to create the FunctionDefinition. Despite this, the ability to supply the values at creation time is an important aid to creating valid SBML. Knowledge of the intented SBML Level and Version determine whether it is valid to assign a particular value to an attribute, or whether it is valid to add an object to an existing SBMLDocument. @docnote The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be I for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation. =item FunctionDefinition::FunctionDefinition Copy constructor; creates a copy of this FunctionDefinition. =item FunctionDefinition::accept Accepts the given SBMLVisitor for this instance of FunctionDefinition. @param v the SBMLVisitor instance to be used. Returns the result of calling C, which indicates whether the Visitor would like to visit the next FunctionDefinition in the list of function definitions. =item FunctionDefinition::clone Creates and returns a deep copy of this FunctionDefinition. Returns a (deep) copy of this FunctionDefinition. =item FunctionDefinition::getMath Get the mathematical formula of this FunctionDefinition. Returns an ASTNode, the value of the "math" subelement of this FunctionDefinition =item FunctionDefinition::isSetMath Predicate returning C or C depending on whether this FunctionDefinition's "math" subelement contains a value. Returns C if the "math" for this FunctionDefinition has been set, C otherwise. =item FunctionDefinition::setMath Sets the "math" subelement of this FunctionDefinition to the Abstract Syntax Tree given in C. @param math an AST containing the mathematical expression to be used as the formula for this FunctionDefinition. =item FunctionDefinition::getArgument Get the Cth argument to this function. Callers should first find out the number of arguments to the function by calling getNumArguments(). @param n an integer index for the argument sought. Returns the nth argument (bound variable) passed to this FunctionDefinition. @see getNumArguments() =item FunctionDefinition::getArgument Get the argument named C to this FunctionDefinition. @param name the exact name (case-sensitive) of the sought-after argument Returns the argument (bound variable) having the given name, or NULL if no such argument exists. =item FunctionDefinition::getBody Get the mathematical expression that is the body of this FunctionDefinition object. Returns the body of this FunctionDefinition as an Abstract Syntax Tree, or NULL if no body is defined. =item FunctionDefinition::getBody Get the mathematical expression that is the body of this FunctionDefinition object. Returns the body of this FunctionDefinition as an Abstract Syntax Tree, or NULL if no body is defined. =item FunctionDefinition::getNumArguments Get the number of arguments (bound variables) taken by this FunctionDefinition. Returns the number of arguments (bound variables) that must be passed to this FunctionDefinition. =item FunctionDefinition::getTypeCode Returns the libSBML type code for this SBML object. @if clike LibSBML attaches an identifying code to every kind of SBML object. These are known as SBML type codes. The set of possible type codes is defined in the enumeration #SBMLTypeCode_t. The names of the type codes all begin with the characters C. @endif@if java LibSBML attaches an identifying code to every kind of SBML object. These are known as SBML type codes. In other languages, the set of type codes is stored in an enumeration; in the Java language interface for libSBML, the type codes are defined as static integer constants in interface class {@link libsbmlConstants}. The names of the type codes all begin with the characters C. @endif Returns the SBML type code for this object, or C (default). @see getElementName() =item FunctionDefinition::getElementName Returns the XML element name of this object, which for FunctionDefinition, is always C<"functionDefinition">. Returns the name of this element, i.e., C<"functionDefinition">. =item FunctionDefinition::writeElements Subclasses should override this method to write out their contained SBML objects as XML elements. Be sure to call your parents implementation of this method as well. @deprecated libSBML internal =item FunctionDefinition::readOtherXML Subclasses should override this method to read (and store) XHTML, MathML, etc. directly from the XMLInputStream. Returns true if the subclass read from the stream, false otherwise. @deprecated libSBML internal =item FunctionDefinition::readAttributes Subclasses should override this method to read values from the given XMLAttributes set into their specific fields. Be sure to call your parents implementation of this method as well. @deprecated libSBML internal =item FunctionDefinition::writeAttributes Subclasses should override this method to write their XML attributes to the XMLOutputStream. Be sure to call your parents implementation of this method as well. @deprecated libSBML internal =item FunctionDefinition::writeAttributes Subclasses should override this method to write their XML attributes to the XMLOutputStream. Be sure to call your parents implementation of this method as well. @deprecated libSBML internal =item ListOfFunctionDefinitions::clone Creates and returns a deep copy of this ListOfFunctionDefinitions instance. Returns a (deep) copy of this ListOfFunctionDefinitions. =item ListOfFunctionDefinitions::getTypeCode Returns the libSBML type code for this SBML object. @if clike LibSBML attaches an identifying code to every kind of SBML object. These are known as SBML type codes. The set of possible type codes is defined in the enumeration #SBMLTypeCode_t. The names of the type codes all begin with the characters C. @endif@if java LibSBML attaches an identifying code to every kind of SBML object. These are known as SBML type codes. In other languages, the set of type codes is stored in an enumeration; in the Java language interface for libSBML, the type codes are defined as static integer constants in interface class {@link libsbmlConstants}. The names of the type codes all begin with the characters C. @endif Returns the SBML type code for this object, or C (default). @see getElementName() =item ListOfFunctionDefinitions::getItemTypeCode Returns the libSBML type code for the objects contained in this ListOf (i.e., FunctionDefinition objects, if the list is non-empty). @if clike LibSBML attaches an identifying code to every kind of SBML object. These are known as SBML type codes. The set of possible type codes is defined in the enumeration #SBMLTypeCode_t. The names of the type codes all begin with the characters C. @endif@if java LibSBML attaches an identifying code to every kind of SBML object. These are known as SBML type codes. In other languages, the set of type codes is stored in an enumeration; in the Java language interface for libSBML, the type codes are defined as static integer constants in interface class {@link libsbmlConstants}. The names of the type codes all begin with the characters C. @endif Returns the SBML type code for the objects contained in this ListOf instance, or C (default). @see getElementName() =item ListOfFunctionDefinitions::getElementName Returns the XML element name of this object. For ListOfFunctionDefinitions, the XML element name is @c "listOfFunctionDefinitions". Returns the name of this element, i.e., C<"listOfFunctionDefinitions">. =item ListOfFunctionDefinitions::get Get a FunctionDefinition from the ListOfFunctionDefinitions. @param n the index number of the FunctionDefinition to get. Returns the nth FunctionDefinition in this ListOfFunctionDefinitions. @see size() =item ListOfFunctionDefinitions::get Get a FunctionDefinition from the ListOfFunctionDefinitions. @param n the index number of the FunctionDefinition to get. Returns the nth FunctionDefinition in this ListOfFunctionDefinitions. @see size() =item ListOfFunctionDefinitions::get Get a FunctionDefinition from the ListOfFunctionDefinitions based on its identifier. @param sid a string representing the identifier of the FunctionDefinition to get. Returns FunctionDefinition in this ListOfFunctionDefinitions with the given id or NULL if no such FunctionDefinition exists. @see get(unsigned int n) @see size() =item ListOfFunctionDefinitions::get Get a FunctionDefinition from the ListOfFunctionDefinitions based on its identifier. @param sid a string representing the identifier of the FunctionDefinition to get. Returns FunctionDefinition in this ListOfFunctionDefinitions with the given id or NULL if no such FunctionDefinition exists. @see get(unsigned int n) @see size() =item ListOfFunctionDefinitions::remove Removes the nth item from this ListOfFunctionDefinitions items and returns a pointer to it. The caller owns the returned item and is responsible for deleting it. @param n the index of the item to remove @see size() =item ListOfFunctionDefinitions::remove Removes item in this ListOfFunctionDefinitions items with the given identifier. The caller owns the returned item and is responsible for deleting it. If none of the items in this list have the identifier C, then @c NULL is returned. @param sid the identifier of the item to remove Returns the item removed. As mentioned above, the caller owns the returned item. =item ListOfFunctionDefinitions::getElementPosition Get the ordinal position of this element in the containing object (which in this case is the Model object). The ordering of elements in the XML form of SBML is generally fixed for most components in SBML. So, for example, the ListOfFunctionDefinitions in a model is (in SBML Level 2 Version 4) the first ListOf___. (However, it differs for different Levels and Versions of SBML.) Returns the ordinal position of the element with respect to its siblings, or C<-1> (default) to indicate the position is not significant. @deprecated libSBML internal =item ListOfFunctionDefinitions::createObject Returns the SBML object corresponding to next XMLToken in the XMLInputStream or NULL if the token was not recognized. @deprecated libSBML internal =item UnitKind_equals Tests for logical equality between two given UnitKind_t values. This function behaves exactly like C's == operator, except for the following two cases: @li UNIT_KIND_LITER C<==> UNIT_KIND_LITRE @li UNIT_KIND_METER C<==> UNIT_KIND_METRE C equality comparison would yield false (because each of the above is a distinct enumeration value), but UnitKind_equals() returns true. @param uk1 a UnitKind_t enumeration value @param uk2 the UnitKind_t enumeration value to compare to C Returns nonzero (for true) if uk1 is logically equivalent to uk2, zero (0) otherwise. @note For more information about the UnitKind_t enumeration, please refer to the class documentation for Unit. =item UnitKind_forName Converts a string to its corresponding UnitKind_t enumeration value. @param name a string, the name of a predefined base unit in SBML Returns a value from UnitKind_t corresponding to the given name (determined in a case-insensitive manner). @note For more information about the UnitKind_t enumeration, please refer to the class documentation for Unit. =item UnitKind_toString Converts a UnitKind_t enumeration value to a text string equivalent. @param uk the UnitKind_t value to convert Returns the name of the given UnitKind. @note The string returned is a static data value. The caller does not own the returned string and is therefore not allowed to modify it. @note For more information about the UnitKind_t enumeration, please refer to the class documentation for Unit. =item UnitKind_isValidUnitKindString Predicate for testing whether a given string corresponds to a predefined UnitKind_t enumeration value. Returns nonzero (for true) if string is the name of a valid UnitKind_t enumeration value, zero (0) otherwise. @note For more information about the UnitKind_t enumeration, please refer to the class documentation for Unit. =back =head2 Unit LibSBML implementation of SBML's Unit construct. The SBML unit definition facility uses two classes of objects, UnitDefinition and Unit. The approach to defining units in SBML is compositional; for example, meter second –2 is constructed by combining a Unit object representing meter with another Unit object representing second –2. The combination is wrapped inside a UnitDefinition, which provides for assigning an identifier and optional name to the combination. The identifier can then be referenced from elsewhere in a model. Thus, the UnitDefinition class is the container, and Unit instances are placed inside UnitDefinition instances. A Unit structure has four attributes named "kind", "exponent", "scale" and "multiplier". It represents a (possibly transformed) reference to a base unit. The attribute "kind" on Unit indicates the chosen base unit. Its value in SBML Level 2 Version 4 must be one of the following predefined strings: @htmlinclude libsbml-base-units.html (See also the definition of the C constants in the section below.) For SBML Level 2 Version 1 models, the string C is also permitted. Note also that the table above contains two names not strictly defined in SBML Level 2: C and C. For convenience, libSBML defines the American English spellings of these units, although the SBML specification limits the valid unit names to those defined by SI. The optional attribute named "exponent" on Unit represents an exponent on the unit. Its default value is C<1> (one). A Unit structure also has an optional attribute called "scale"; its value must be an integer exponent for a power-of-ten multiplier used to set the scale of the unit. For example, a unit having a "kind" value of C and a "scale" value of C<-3> signifies 10 –3 \f$\times\f$ gram, or milligrams. The default value of "scale" is C<0> (zero), because 10 0 = 1. Lastly, the optional attribute named "multiplier" can be used to multiply the kind unit by a real-numbered factor; this enables the definition of units that are not power-of-ten multiples of SI units. For instance, a multiplier of 0.3048 could be used to define C as a measure of length in terms of a C. The "multiplier" attribute has a default value of C<1> (one).

UnitKind_t

SBML defines a set of base units which serves as the starting point for new unit definitions. This set of base units consists of the SI units and a small number of additional convenience units. @if clike Until SBML Level 2 Version 3, there existed a data type in the SBML specifications called C, enumerating the possible SBML base units. Although SBML Level 2 Version 3 removed this type from the language specification, libSBML maintains the corresponding enumeration type C as a convenience and as a way to provide backward compatibility to previous SBML Level/Version specifications. (The removal in SBML Level 2 Version 3 of the enumeration C was also accompanied by the redefinition of the data type C to include the previous @c UnitKind values as reserved symbols in the C space. This change has no net effect on permissible models, their representation or their syntax. The purpose of the change in the SBML specification was simply to clean up an inconsistency about the contexts in which these values were usable.) The C enumeration in libSBML has a small number of differences compared to the SBML specifications: @endif@if java In SBML Level 2 Versions before Version 3, there existed an enumeration of units called @c UnitKind. In Version 3, this enumeration was removed and the identifier class C redefined to include the previous @c UnitKind values as reserved symbols. This change has no net effect on permissible models, their representation or their syntax. The purpose of the change in the SBML specification was simply to clean up an inconsistency about the contexts in which these values were usable. However, LibSBML maintains UnitKind in the form of of a set of static integer constants whose names begin with the characters C. These constants are defined in the class libsbmlConstants This enumeration in libSBML has a small number of differences compared to the SBML specifications: @endif =over =item The alternate spelling C<"meter"> is included in addition to the official SI spelling C<"metre">. =item The alternate spelling C<"liter"> is included in addition to the official SI spelling C<"litre">. =item The unit C<"Celsius"> is included because of its presence in specifications of SBML prior to SBML Level 2 Version 3. =back @if clike The table below lists the symbols defined in the C enumeration, and their meanings. @endif@if java The table below lists the unit constants defined in libSBML, and their meanings. @endif @htmlinclude libsbml-unitkind-table.html =over =back =head2 ListOfUnits LibSBML implementation of SBML's ListOfUnits construct. The various ListOf___ classes in SBML are merely containers used for organizing the main components of an SBML model. All are derived from the abstract class SBase, and inherit the various attributes and subelements of SBase, such as "metaid" as and "annotation". The ListOf___ classes do not add any attributes of their own. ListOfUnits is entirely contained within UnitDefinition. =over =item Unit::Unit Creates a new Unit, optionally with specific values of C, C, C and C. @if clike If no arguments are passed to this constructor, the value of C defaults to C. Callers must reset the value to something appropriate using the Unit::setKind() method. The use of arguments to this constructor is functionally equivalent to the following: @endif@if java If no arguments are passed to this constructor, the value of C defaults to C. Callers must reset the value to something appropriate using the method Unit::setKind(int kind). The use of arguments to this constructor is functionally equivalent to the following: @endif C Unit u = new Unit(); u.setKind(kind); u.setExponent(exponent); u.setScale(scale); u.setMultiplier(multipler); @endcode Readers are urged to read the description of the Unit class (both the beginning of this page, and in the SBML specification documents) for more information about the meaning of the arguments to this constructor. @if clike @param kind a value from the UnitKind_t enumeration naming the base unit serving as the basis of this particular unit definition @endif@if java @param kind a value from the set of static integer constants having names beginning with the characters C in libsbmlConstants @endif @param exponent an integer, the "exponent" attribute of the unit definition @param scale an integer, the "scale" attribute of the unit definition @param multiplier a double, the "multiplier" attribute of the unit definition @docnote The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be I for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation. =item Unit::Unit Creates a new Unit of a specific C (given as a string), and optionally with C, C and C. @if clike This method accepts a base unit name as a string, and internally converts it to a value from the UnitKind_t enumeration. If the string passed as the value of C is not recognized as a valid unit name, this method sets the value to C. The following table lists the valid unit kind names: @endif@if java This method accepts a unit kind name as a string, and internally converts it to the appropriate C constants from libsbmlConstants. If the string passed as the value of C is not recognized as a valid unit name, this method sets the value to C. The following table lists the valid unit kind names: @endif @htmlinclude libsbml-base-units.html In addition to the strings above, the string C is accepted for models in SBML Level 2 Version 1 format. Readers are urged to read the description of the Unit class (both the beginning of this page, and in the SBML specification documents) for more information about the meaning of the arguments to this constructor. @param kind a string whose value is a valid unit name @param exponent an integer, the "exponent" attribute of the unit definition @param scale an integer, the "scale" attribute of the unit definition @param multiplier a double, the "multiplier" attribute of the unit definition @docnote The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be I for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation. =item Unit::Unit Creates a new Unit using the given SBML C and C values and optionally a set of XMLNamespaces. @param level an unsigned int, the SBML Level to assign to this Unit @param version an unsigned int, the SBML Version to assign to this Unit @param xmlns XMLNamespaces, a pointer to an array of XMLNamespaces to assign to this Unit @note Once a Unit has been added to an SBMLDocument, the C, C and C namespaces for the document I those used to create the Unit. Despite this, the ability to supply the values at creation time is an important aid to creating valid SBML. Knowledge of the intented SBML Level and Version determine whether it is valid to assign a particular value to an attribute, or whether it is valid to add an object to an existing SBMLDocument. @docnote The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be I for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation. =item Unit::Unit Creates a new Unit using the given SBMLNamespaces object C. The SBMLNamespaces object encapsulates SBML Level/Version/namespaces information. It is used to communicate the SBML Level, Version, and (in Level 3) packages used in addition to SBML Level  Core. A common approach to using this class constructor is to create an SBMLNamespaces object somewhere in a program, once, then pass it to object constructors such as this one when needed. @param sbmlns an SBMLNamespaces object. @note Once a Unit has been added to an SBMLDocument, the C, C and C namespaces for the document I those used to create the Unit. Despite this, the ability to supply the values at creation time is an important aid to creating valid SBML. Knowledge of the intented SBML Level and Version determine whether it is valid to assign a particular value to an attribute, or whether it is valid to add an object to an existing SBMLDocument. @docnote The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be I for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation. =item Unit::Unit Copy constructor; creates a copy of this Unit. =item Unit::accept Accepts the given SBMLVisitor for this instance of Unit. @param v the SBMLVisitor instance to be used. Returns the result of calling C, which indicates whether the Visitor would like to visit the next Unit in the list of units within which this Unit is embedded (i.e., in the ListOfUnits located in the enclosing UnitDefinition instance). =item Unit::clone Creates and returns a deep copy of this Unit. Returns a (deep) copy of this Unit. =item Unit::initDefaults Initializes the attributes of this Unit (except for "kind") to their defaults values. The default values are as follows: @li exponent = 1 @li scale = 0 @li multiplier = 1.0 The "kind" attribute is left unchanged. =item Unit::getKind Returns the "kind" of Unit this is. Returns the value of the "kind" attribute of this Unit as a value from the UnitKind_t enumeration =item Unit::getExponent Returns the value of the "exponent" attribute of this unit. Returns the "exponent" value of this Unit, as an integer =item Unit::getScale Returns the value of the "scale" attribute of this unit. Returns the "scale" value of this Unit, as an integer. =item Unit::getMultiplier Returns the value of the "multiplier" attribute of this Unit. Returns the "multiplier" value of this Unit, as a double =item Unit::getOffset Returns the value of the "offset" attribute of this Unit. @warning The "offset" attribute is only available in SBML Level 2 Version 1. This attribute is not present in SBML Level 2 Version 2 or above. When producing SBML models using these later specifications, modelers and software tools need to account for units with offsets explicitly. The SBML specification document offers a number of suggestions for how to achieve this. LibSBML methods such as this one related to "offset" are retained for compatibility with earlier versions of SBML Level 2, but their use is strongly discouraged. Returns the "offset" value of this Unit, as a double =item Unit::isAmpere Predicate for testing whether this Unit is of the kind C. Returns C if the kind of this Unit is C, C otherwise. =item Unit::isBecquerel Predicate for testing whether this Unit is of the kind C Returns C if the kind of this Unit is C, C otherwise. =item Unit::isCandela Predicate for testing whether this Unit is of the kind C Returns C if the kind of this Unit is C, C otherwise. =item Unit::isCelsius Predicate for testing whether this Unit is of the kind C Returns C if the kind of this Unit is C, C otherwise. @warning The predefined unit C was removed from the list of predefined units in SBML Level 2 Version 2 at the same time that the "offset" attribute was removed from Unit definitions. LibSBML methods such as this one related to C are retained in order to support SBML Level 2 Version 1, but their use is strongly discouraged. =item Unit::isCoulomb Predicate for testing whether this Unit is of the kind C Returns C if the kind of this Unit is C, C otherwise. =item Unit::isDimensionless Predicate for testing whether this Unit is of the kind @c dimensionless Returns C if the kind of this Unit is C, C otherwise. =item Unit::isFarad Predicate for testing whether this Unit is of the kind C Returns C if the kind of this Unit is C, C otherwise. =item Unit::isGram Predicate for testing whether this Unit is of the kind C Returns C if the kind of this Unit is C, C otherwise. =item Unit::isGray Predicate for testing whether this Unit is of the kind C Returns C if the kind of this Unit is C, C otherwise. =item Unit::isHenry Predicate for testing whether this Unit is of the kind C Returns C if the kind of this Unit is C, C otherwise. =item Unit::isHertz Predicate for testing whether this Unit is of the kind C Returns C if the kind of this Unit is C, C otherwise. =item Unit::isItem Predicate for testing whether this Unit is of the kind C Returns C if the kind of this Unit is C, C otherwise. =item Unit::isJoule Predicate for testing whether this Unit is of the kind C Returns C if the kind of this Unit is C, C otherwise. =item Unit::isKatal Predicate for testing whether this Unit is of the kind C Returns C if the kind of this Unit is C, C otherwise. =item Unit::isKelvin Predicate for testing whether this Unit is of the kind C Returns C if the kind of this Unit is C, C otherwise. =item Unit::isKilogram Predicate for testing whether this Unit is of the kind C Returns C if the kind of this Unit is C, C otherwise. =item Unit::isLitre Predicate for testing whether this Unit is of the kind C Returns C if the kind of this Unit is C or 'liter', @c false otherwise. =item Unit::isLumen Predicate for testing whether this Unit is of the kind C Returns C if the kind of this Unit is C, C otherwise. =item Unit::isLux Predicate for testing whether this Unit is of the kind C Returns C if the kind of this Unit is C, C otherwise. =item Unit::isMetre Predicate for testing whether this Unit is of the kind C Returns C if the kind of this Unit is C or 'meter', @c false otherwise. =item Unit::isMole Predicate for testing whether this Unit is of the kind C Returns C if the kind of this Unit is C, C otherwise. =item Unit::isNewton Predicate for testing whether this Unit is of the kind C Returns C if the kind of this Unit is C, C otherwise. =item Unit::isOhm Predicate for testing whether this Unit is of the kind C Returns C if the kind of this Unit is C, C otherwise. =item Unit::isPascal Predicate for testing whether this Unit is of the kind C Returns C if the kind of this Unit is C, C otherwise. =item Unit::isRadian Predicate for testing whether this Unit is of the kind C Returns C if the kind of this Unit is C, C otherwise. =item Unit::isSecond Predicate for testing whether this Unit is of the kind C Returns C if the kind of this Unit is C, C otherwise. =item Unit::isSiemens Predicate for testing whether this Unit is of the kind C Returns C if the kind of this Unit is C, C otherwise. =item Unit::isSievert Predicate for testing whether this Unit is of the kind C Returns C if the kind of this Unit is C, C otherwise. =item Unit::isSteradian Predicate for testing whether this Unit is of the kind C Returns C if the kind of this Unit is C, C otherwise. =item Unit::isTesla Predicate for testing whether this Unit is of the kind C Returns C if the kind of this Unit is C, C otherwise. =item Unit::isVolt Predicate for testing whether this Unit is of the kind C Returns C if the kind of this Unit is C, C otherwise. =item Unit::isWatt Predicate for testing whether this Unit is of the kind C Returns C if the kind of this Unit is C, C otherwise. =item Unit::isWeber Predicate for testing whether this Unit is of the kind C Returns C if the kind of this Unit is C, C otherwise. =item Unit::isSetKind Predicate to test whether the "kind" attribute of this Unit has been set. Returns C if the "kind" attribute of this Unit has been set, @c false otherwise. =item Unit::setKind Sets the "kind" attribute value of this Unit. @param kind a value from the UnitKind_t enumeration =item Unit::setExponent Sets the "exponent" attribute value of this Unit. @param value the integer to which the attribute "exponent" should be set =item Unit::setScale Sets the "scale" attribute value of this Unit. @param value the integer to which the attribute "scale" should be set =item Unit::setMultiplier Sets the "multipler" attribute value of this Unit. @param value the floating-point value to which the attribute "multiplier" should be set =item Unit::setOffset Sets the "offset" attribute value of this Unit. @param value the float-point value to which the attribute "offset" should set @warning The "offset" attribute is only available in SBML Level 2 Version 1. This attribute is not present in SBML Level 2 Version 2 or above. When producing SBML models using these later specifications, modelers and software tools need to account for units with offsets explicitly. The SBML specification document offers a number of suggestions for how to achieve this. LibSBML methods such as this one related to "offset" are retained for compatibility with earlier versions of SBML Level 2, but their use is strongly discouraged. =item Unit::getTypeCode Returns the libSBML type code of this object instance. @if clike LibSBML attaches an identifying code to every kind of SBML object. These are known as SBML type codes. The set of possible type codes is defined in the enumeration #SBMLTypeCode_t. The names of the type codes all begin with the characters C. @endif@if java LibSBML attaches an identifying code to every kind of SBML object. These are known as SBML type codes. In other languages, the set of type codes is stored in an enumeration; in the Java language interface for libSBML, the type codes are defined as static integer constants in interface class {@link libsbmlConstants}. The names of the type codes all begin with the characters C. @endif Returns the SBML type code for this object, or C (default). @see getElementName() =item Unit::getElementName Returns the XML element name of this object, which for Unit, is always C<"unit">. Returns the name of this element, i.e., C<"unit">. =item Unit::isBuiltIn Predicate to test whether a given string is the name of a predefined SBML unit. @param name a string to be tested against the predefined unit names @param level the Level of SBML for which the determination should be made. This is necessary because there are a few small differences in allowed units between SBML Level 1 and Level 2. Returns C if C is one of the five SBML predefined unit identifiers (C<"substance">, C<"volume">, C<"area">, C<"length"> or @c "time"), C otherwise. @note The predefined unit identifiers C<"length"> and C<"area"> were added in Level 2 Version 1 =item Unit::isUnitKind Predicate to test whether a given string is the name of a valid base unit in SBML (such as C<"gram"> or C<"mole">). This method exists because prior to SBML Level 2 Version 3, an enumeration called C was defined by SBML. This enumeration was removed in SBML Level 2 Version 3 and its values were folded into the space of values of a type called C. This method therefore has less significance in SBML Level 2 Version 3 and Level 2 Version 4, but remains for backward compatibility and support for reading models in older Versions of Level 2. @param name a string to be tested @param level an unsigned int representing the SBML specification Level @param version an unsigned int representing the SBML specification Version Returns C if name is a valid UnitKind, C otherwise @note The allowed unit names differ between SBML Levels 1 and 2 and again slightly between Level 2 Versions 1 and 2. =item Unit::areIdentical Predicate returning C or C depending on whether two Unit objects are identical. Two Unit objects are considered to be I if they match in all attributes. (Contrast this to the method Unit::areEquivalent(Unit unit1, Unit unit2), which compares Unit objects only with respect to certain attributes.) @param unit1 the first Unit object to compare @param unit2 the second Unit object to compare Returns C if all the attributes of unit1 are identical to the attributes of unit2, C otherwise. @see areEquivalent(Unit unit1, Unit unit2) =item Unit::areEquivalent Predicate returning C or C depending on whether Unit objects are equivalent. Two Unit objects are considered to be I if their "kind" and "exponent" attributes are equal. (Contrast this to the method Unit::areIdentical(Unit unit1, Unit unit2), which compares Unit objects with respect to all attributes, not just the kind and exponent.) @param unit1 the first Unit object to compare @param unit2 the second Unit object to compare Returns C if the "kind" and "exponent" attributes of unit1 are identical to the kind and exponent attributes of unit2, C otherwise. @see areIdentical(Unit unit1, Unit unit2) =item Unit::removeScale Manipulates the attributes of the Unit to express the unit with the value of the scale attribute reduced to zero. For example, 1 millimetre can be expressed as a Unit with kind=@c "metre" multiplier=C<"1"> scale=C<"-3"> exponent=C<"1">. It can also be expressed as a Unit with kind=C<"metre"> multiplier=C<"0.001"> scale=C<"0"> exponent=C<"1">. @param unit the Unit object to manipulate. =item Unit::merge Merges two Unit objects with the same "kind" attribute value into a single Unit. For example, the following, C @endcode would be merged to become C @endcode @param unit1 the first Unit object; the result of the operation is left as a new version of this unit, modified in-place. @param unit2 the second Unit object to merge with the first =item Unit::convertToSI Returns a UnitDefinition object which contains the argument Unit converted to the appropriate SI unit. @param unit the Unit object to convert to SI Returns a UnitDefinition object containing the SI unit. =item Unit::readAttributes Subclasses should override this method to read values from the given XMLAttributes set into their specific fields. Be sure to call your parents implementation of this method as well. @deprecated libSBML internal =item Unit::writeAttributes Subclasses should override this method to write their XML attributes to the XMLOutputStream. Be sure to call your parents implementation of this method as well. @deprecated libSBML internal =item Unit::isL1UnitKind Predicate to test whether a given string is the name of a valid base unit in SBML Level 1 (such as C<"gram"> or C<"mole">) @param name a string to be tested Returns C if name is a valid UnitKind, C otherwise @deprecated libSBML internal =item Unit::isL2V1UnitKind Predicate to test whether a given string is the name of a valid base unit in SBML Level 2 Version 1 (such as C<"gram"> or @c "mole") @param name a string to be tested Returns C if name is a valid UnitKind, C otherwise @deprecated libSBML internal =item Unit::isL2UnitKind Predicate to test whether a given string is the name of a valid base unit in SBML Level 2 Version 2, 3 or 4 (such as C<"gram"> or @c "mole") @param name a string to be tested Returns C if name is a valid UnitKind, C otherwise @deprecated libSBML internal =item Unit::isL2UnitKind Predicate to test whether a given string is the name of a valid base unit in SBML Level 2 Version 2, 3 or 4 (such as C<"gram"> or @c "mole") @param name a string to be tested Returns C if name is a valid UnitKind, C otherwise @deprecated libSBML internal =item Unit::isL2UnitKind Predicate to test whether a given string is the name of a valid base unit in SBML Level 2 Version 2, 3 or 4 (such as C<"gram"> or @c "mole") @param name a string to be tested Returns C if name is a valid UnitKind, C otherwise @deprecated libSBML internal =item Unit::isL2UnitKind Predicate to test whether a given string is the name of a valid base unit in SBML Level 2 Version 2, 3 or 4 (such as C<"gram"> or @c "mole") @param name a string to be tested Returns C if name is a valid UnitKind, C otherwise @deprecated libSBML internal =item Unit::isL2UnitKind Predicate to test whether a given string is the name of a valid base unit in SBML Level 2 Version 2, 3 or 4 (such as C<"gram"> or @c "mole") @param name a string to be tested Returns C if name is a valid UnitKind, C otherwise @deprecated libSBML internal =item Unit::isL2UnitKind Predicate to test whether a given string is the name of a valid base unit in SBML Level 2 Version 2, 3 or 4 (such as C<"gram"> or @c "mole") @param name a string to be tested Returns C if name is a valid UnitKind, C otherwise @deprecated libSBML internal =item ListOfUnits::clone Creates and returns a deep copy of this ListOfUnits. Returns a (deep) copy of this ListOfUnits. =item ListOfUnits::getTypeCode Returns the libSBML type code for this SBML object. @if clike LibSBML attaches an identifying code to every kind of SBML object. These are known as SBML type codes. The set of possible type codes is defined in the enumeration #SBMLTypeCode_t. The names of the type codes all begin with the characters C. @endif@if java LibSBML attaches an identifying code to every kind of SBML object. These are known as SBML type codes. In other languages, the set of type codes is stored in an enumeration; in the Java language interface for libSBML, the type codes are defined as static integer constants in interface class {@link libsbmlConstants}. The names of the type codes all begin with the characters C. @endif Returns the SBML type code for this object, or C (default). @see getElementName() =item ListOfUnits::getItemTypeCode Returns the libSBML type code for the objects contained in this ListOf (i.e., Unit objects, if the list is non-empty). @if clike LibSBML attaches an identifying code to every kind of SBML object. These are known as SBML type codes. The set of possible type codes is defined in the enumeration #SBMLTypeCode_t. The names of the type codes all begin with the characters C. @endif@if java LibSBML attaches an identifying code to every kind of SBML object. These are known as SBML type codes. In other languages, the set of type codes is stored in an enumeration; in the Java language interface for libSBML, the type codes are defined as static integer constants in interface class {@link libsbmlConstants}. The names of the type codes all begin with the characters C. @endif Returns the SBML type code for the objects contained in this ListOf instance, or C (default). @see getElementName() =item ListOfUnits::getElementName Returns the XML element name of this object. For ListOfUnits, the XML element name is C<"listOfUnits">. Returns the name of this element, i.e., C<"listOfUnits">. =item ListOfUnits::get Get a Unit from the ListOfUnits. @param n the index number of the Unit to get. Returns the nth Unit in this ListOfUnits. @see size() =item ListOfUnits::get Get a Unit from the ListOfUnits. @param n the index number of the Unit to get. Returns the nth Unit in this ListOfUnits. @see size() =item ListOfUnits::remove Removes the nth item from this ListOfUnits items and returns a pointer to it. The caller owns the returned item and is responsible for deleting it. @param n the index of the item to remove @see size() =item ListOfUnits::getElementPosition Get the ordinal position of this element in the containing object (which in this case is the Model object). Returns the ordinal position of the element with respect to its siblings, or C<-1> (default) to indicate the position is not significant. @deprecated libSBML internal =item ListOfUnits::createObject Create a ListOfUnits object corresponding to the next token in the XML input stream. Returns the SBML object corresponding to next XMLToken in the XMLInputStream, or C if the token was not recognized. @deprecated libSBML internal =back =head2 UnitDefinition LibSBML implementation of SBML's UnitDefinition construct. Units of measurement may be supplied in a number of contexts in an SBML model. The units of the following mathematical entities can be specified explicitly: the size of a compartment, the initial amount of a species, and the units of constant and variable parameter values. The overall units of any mathematical formula appearing in SBML are those that arise naturally from the components and mathematical expressions comprising the formula, or in other words, the units obtained by doing dimensional analysis on the formula. Rather than requiring a complete unit definition on every construct, SBML provides a facility for defining units that can be referenced throughout a model. In addition, every kind of SBML mathematical entity has units assigned to it from a set of predefined defaults (listed below); by redefining these predefined default units, it is possible to change the units used throughout a model in a simple and consistent manner. The SBML unit definition facility uses two classes of objects, UnitDefinition and Unit. The approach to defining units in SBML is compositional; for example, meter second –2 is constructed by combining a Unit object representing meter with another Unit object representing second –2. The combination is wrapped inside a UnitDefinition, which provides for assigning an identifier and optional name to the combination. The identifier can then be referenced from elsewhere in a model. Thus, the UnitDefinition class is the container, and Unit instances are placed inside UnitDefinition instances. @section unitdef-summary Summary of the UnitDefinition construct UnitDefinition in SBML Level 2 has two attributes and one subelement. The two attributes are "id" and "name", and the subelement is ListOfUnits. The required attribute "id" and optional attribute "name" are both strings. The "id" attribute is used to give the defined unit a unique identifier by which other parts of an SBML model definition can refer to it. The "name" attribute is intended to be used for giving the unit definition an optional human-readable name. There are two important restrictions about the use of unit definition "id" values in SBML Level 2 Versions 3–4: =over =item The "id" of a UnitDefinition must I contain a value from the list of reserved base unit names (i.e., the strings C, C, etc.; see the definition of Unit for the complete list). This constraint simply prevents the redefinition of the base units. =item There is a set of reserved identifiers for the predefined units in SBML; these identifiers are C, C, C, C, and C