5.18.1
A WebAssembly / JavaScript wrapper for the libSBML C++ library.
Unlike most JavaScript modules,
this module and associated WebAssembly file are loaded asynchronously
by the browser, so you can not begin using it immediately after importing it.
Instead, the module returns a promise-like object with a then()
method,
which is invoked with the module itself when it is fully loaded.
This is a standard convention for all Emscripten modules.
import libsbml from 'libsbml_stable'
// the module isn't usable yet - wait for it to load
libsbml().then((libsbml) => {
// now it is safe to use the module
const doc = new libsbml.SBMLDocument(3,2)
})
Despite this suggestive naming scheme, the libsbml().then() method does not return an authentic JavaScript Promise. For instance, the expected catch() method is missing. Instead, it is recommended that users use normal try/catch blocks to handle errors within the callback.
The mechanism for calling static methods is somewhat unconventional.
Static methods should be called via an class's prototype
.
For example, to get the namespace for the SBML comp extension,
one would normally call the getXmlnsL3V1V1 static method of the
C++ CompExtension class.
In libsbmljs, this method should be called on the class's prototype
instead.
import libsbml from 'libsbml_stable'
libsbml().then((libsbml) => {
const doc = new libsbml.SBMLDocument(3,2)
// call the getXmlnsL3V1V1 static method on the prototype, not the type itself
doc.enablePackage(libsbml.CompExtension.prototype.getXmlnsL3V1V1(), 'comp', true)
})
Objects in libSBML typically provide two types of methods for
adding a subobject. Methods that start with add
take a pre-existing
subobject and add it to the parent, whereas methods that
start with create
return a new subobject. You should generally
use the create
methods. While add
methods technically work in this
wrapper, they have very confusing ownership semantics and using them
will most likely result in bugs which are difficult to track down.
This advice also applies to C++, but debugging can
be harder in a JavaScript environment.
import libsbml from 'libsbml_stable'
libsbml().then((libsbml) => {
...
const model = ...
// prefer this way of creating species
const spec = model.createSpecies()
// this way is more awkward
const spec = new libsbml.Species(...)
model.addSpecies(spec)
})
The SBMLReader class provides the main interface for reading SBML content from 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. Consequently, immediately after calling a method on SBMLReader, callers should always check for errors and warnings using the methods for this purpose provided by SBMLDocument.
The libsbml.js wrapper does not include library-level compression support. Users who wish to utilize compressed models on the web should consider HTTP compression.
Creates a new SBMLReader object and returns it.
The libSBML SBMLReader object offers methods for reading SBML in XML form from files and text strings.
Reads an SBML document from a text 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 xml does not begin with the XML declaration
<?xml version='1.0' encoding='UTF-8'?>
then this method will automatically prepend the declaration to xml.
This method will log a fatal error if the content given in the parameter xml is not in SBML format.
(string)
a string containing a full SBML model
SBMLDocument
:
a pointer to the SBMLDocument created from the SBML content,
or a null pointer if xml is NULL.
The SBMLWriter class is the converse of SBMLReader, and provides the main interface for serializing SBML models into XML and writing the result to an output stream or to files and text strings. The methods for writing SBML all take an SBMLDocument object and a destination. They return a boolean or integer value to indicate success or failure.
The libsbml.js wrapper does not include library-level compression support. Users who wish to utilize compressed models on the web should consider HTTP compression.
Creates a new SBMLWriter.
The libSBML SBMLWriter objects offer methods for writing SBML in XML form to files and text strings.
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, the following XML comment, intended for human consumption, will be written at the beginning of the document:
<!-- Created by <program name> version <program version>
on yyyy-MM-dd HH:mm with libSBML version <libsbml version>. -->
If the program version and name are not set at some point before calling the writeSBML() methods, no such comment is written out.
(string)
the version of this program (where "this program"
refers to program in which libSBML is embedded, not libSBML itself
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, the following XML comment, intended for human consumption, will be written at the beginning of the XML document:
<!-- Created by <program name> version <program version>
on yyyy-MM-dd HH:mm with libSBML version <libsbml version>. -->
If the program name and version are not set at some point before calling the writeSBML() methods, no such comment is written out.
(string)
the name of this program (where "this program" refers to
program in which libSBML is embedded, not libSBML itself
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 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.
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 and SBML in the Level 3 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, Level 2 or Level 3.) In its barest form, when written out in XML format for (e.g.) SBML Level 2 Version 4, the corresponding structure is the following:
<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
...
</sbml>
SBMLDocument is derived from SBase, and therefore contains the usual SBase attributes (in SBML Level 2 and Level 3) 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.
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 were quite lenient, and allowed a caller to compose SBML entities that might not, in the end, represent valid SBML. This allowed applications the freedom to do things such as save incomplete models (which is useful when models are being developed over long periods of time). In the version 4.x series, libSBML is somewhat stricter, but still permits structures to be created independently and the results to be combined in a separate step. In all these cases, 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 validation 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).
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 setConsistencyChecks with appropriate parameters.
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 list summarizes the possible scenarios.
Scenario 1: Creating a model from scratch. Before writing out the model,
Call SBMLDocument::checkInternalConsistency(), then inquire about the results by calling SBMLDocument::getNumErrors()
Call SBMLDocument#setConsistencyChecks to configure which checks will be performed by SBMLDocument::checkConsistency()
Call SBMLDocument::checkConsistency(), then inquire about the results by calling SBMLDocument::getNumErrors()
Scenario 2: Reading a model from a file or data stream. After reading the model,
Basic consistency checks will have been performed automatically by libSBML upon reading the content, so you only need to inquire about the results by using SBMLDocument::getNumErrors()
Call SBMLDocument#setConsistencyChecks to configure which checks are performed by SBMLDocument#checkConsistency
Call SBMLDocument#checkConsistency, then inquire about the results by calling SBMLDocument#getNumErrors
It should be noted that as of SBML Level 3 Version 2, the Model became an optional child of SBMLDocument, instead of being required. This means that one can no longer use SBMLDocument#getModel as a cheap method of checking if an SBML document was read in properly: the more robust getError methods detailed above must be used instead.
LibSBML provides facilities for limited translation of SBML between Levels and Versions of the SBML specifications. The method for doing is is SBMLDocument#setLevelAndVersion. 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 setLevelAndVersion will not necessarily 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 setLevelAndVersion 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:
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.
Other changes between SBML Level 2 and Level 3 make downward conversions challenging. In some cases, it means that a model converted to Level 2 from Level 3 will contain attributes that were not explicitly given in the Level 3 model, because in Level 2 these attributes may have been optional or have default values.
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, SBMLDocument#getError 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 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.
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 any of the methods:
The valid combinations of SBML Level and Version as of this release of libSBML are the following:
Strict conversion applies the additional criteria that both the source and the target model must be consistent SBML. Users can control the consistency checks that are applied using the SBMLDocument#setConsistencyChecksForConversion method. If either the source or the potential target model have validation errors, the conversion is not performed. When a strict conversion is successful, the underlying SBML object model is altered to reflect the new level and version. Thus, information that cannot be converted (e.g. sboTerms) will be lost.
(number)
the desired SBML Level
(number)
the desired Version within the SBML Level
(boolean)
boolean indicating whether to check consistency
of both the source and target model when performing
conversion (defaults to true)
(boolean)
boolean indicating whether the presence of
packages should be ignored by the conversion routine
(defaults to false)
boolean
:
true if the level and version of the document were
successfully set to the requested values (which may have required
conversion of the model), false otherwise.
Note: Calling this method will not necessarily 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.) }
The SBMLDocumentPlugin class is a specialization of SBasePlugin designed specifically for extending SBMLDocument. All package extensions must extend SBMLDocument to implement support for SBML Level 3 packages; these extensions can be subclasses of this class or from a derived class of this class.
All packages must additionally define a
required flag named required
, which indicates whether
that package's constructs can be used to change the core mathematics of the
<model>
child of the <sbml>
element.
If they can, this attribute must be set true, and if they cannot, this
attribute must be set false.
Unsets the value of the "required" attribute of this SBMLDocumentPlugin.
Returns the XML namespace URI for the package to which this object belongs.
In the XML representation of an SBML document, XML namespaces are used to identify the origin of each XML construct used. XML namespaces are identified by their unique resource identifiers (URIs). The core SBML specifications stipulate the namespaces that must be used for core SBML constructs; for example, all XML elements that belong to SBML Level 3 Version 1 Core must be placed in the XML namespace identified by the URI "http://www.sbml.org/sbml/level3/version1/core". Individual SBML Level 3 packages define their own XML namespaces; for example, all elements belonging to the SBML Level 3 Layout Version 1 package must be placed in the XML namespace "http://www.sbml.org/sbml/level3/version1/layout/version1/".
This method first looks into the SBMLNamespaces object possessed by the parent SBMLDocument object of the current object. If this cannot be found, this method returns the result of getElementNamespace().
string
:
a string, the URI of the XML namespace to which this object belongs.
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 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.
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.
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.
In SBML Level 3 Version 1, the components are: FunctionDefinition, UnitDefinition, Compartment, Species, Parameter, InitialAssignment, Rule, Constraint, Reaction and Event. Instances of the classes are placed inside instances of classes ListOfFunctionDefinitions, ListOfUnitDefinitions, ListOfCompartments, ListOfSpecies, ListOfParameters, ListOfInitialAssignments, ListOfRules, ListOfConstraints, ListOfReactions, and ListOfEvents.
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.
In addition to the above lists and attributes, the Model class in both SBML Level 2 and Level 3 has the usual two attributes of "id" and "name", and both are optional. As is the case for other SBML components with "id" and "name" attributes, they must be used according to the guidelines described in the SBML specifications. (Within the frameworks of SBML Level 2 and Level 3, a Model object identifier has no assigned meaning, but extension packages planned for SBML Level 3 are likely to make use of this identifier.)
Finally, SBML Level 3 has introduced a number of additional Model attributes. They are discussed in a separate section below.
LibSBML provides two main mechanisms for creating objects: class
constructors
(e.g., libsbml.Species()),
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 and link it to the parent in one step.
Here is an example:
import libsbml from 'libsbml_experimental'
libsbml.then((libsbml) => {
// Create an SBMLDocument object in Level 3 Version 1 format:
const SBMLDocument sbmlDoc = new libsbml.SBMLDocument(3, 1)
// 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).
const Model model = sbmlDoc.createModel()
model.setId("BestModelEver")
// 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).
const Species sp = model->createSpecies()
sp.setId("MySpecies")
})
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
<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).
To make it easier for applications to do whatever they need, libSBML is relatively lax when it comes to enforcing correctness and completeness of models during model construction and editing. Essentially, libSBML will not 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.
As mentioned above, the Model class has a number of optional attributes in SBML Level 3. These are "substanceUnits", "timeUnits", "volumeUnits", "areaUnits", "lengthUnits", "extentUnits", and "conversionFactor. The following provide more information about them.
The "substanceUnits" attribute is used to specify the unit of measurement associated with substance quantities of Species objects that do not specify units explicitly. If a given Species object definition does not specify its unit of substance quantity via the "substanceUnits" attribute on the Species object instance, then that species inherits the value of the Model "substanceUnits" attribute. If the Model does not define a value for this attribute, then there is no unit to inherit, and all species that do not specify individual "substanceUnits" attribute values then have no declared units for their quantities. The SBML Level 3 specifications provide more details.
Note that when the identifier of a species appears in a model's mathematical expressions, the unit of measurement associated with that identifier is not solely determined by setting "substanceUnits" on Model or Species. Please see the discussion about units given in the documentation for the Species class.
The "timeUnits" attribute on SBML Level 3's Model object is used to specify the unit in which time is measured in the model. This attribute on Model is the only way to specify a unit for time in a model. It is a global attribute; time is measured in the model everywhere in the same way. This is particularly relevant to Reaction and RateRule objects in a model: all Reaction and RateRule objects in SBML define per-time values, and the unit of time is given by the "timeUnits" attribute on the Model object instance. If the Model "timeUnits" attribute has no value, it means that the unit of time is not defined for the model's reactions and rate rules. Leaving it unspecified in an SBML model does not result in an invalid model in SBML Level 3; however, as a matter of best practice, we strongly recommend that all models specify units of measurement for time.
The attributes "volumeUnits", "areaUnits" and "lengthUnits" together are used to set the units of measurements for the sizes of Compartment objects in an SBML Level 3 model when those objects do not otherwise specify units. The three attributes correspond to the most common cases of compartment dimensions: "volumeUnits" for compartments having a "spatialDimensions" attribute value of "3", "areaUnits" for compartments having a "spatialDimensions" attribute value of "2", and "lengthUnits" for compartments having a "spatialDimensions" attribute value of "1". The attributes are not applicable to compartments whose "spatialDimensions" attribute values are not one of "1", "2" or "3".
If a given Compartment object instance does not provide a value for its "units" attribute, then the unit of measurement of that compartment's size is inherited from the value specified by the Model "volumeUnits", "areaUnits" or "lengthUnits" attribute, as appropriate based on the Compartment object's "spatialDimensions" attribute value. If the Model object does not define the relevant attribute, then there are no units to inherit, and all Compartment objects that do not set a value for their "units" attribute then have no units associated with their compartment sizes.
The use of three separate attributes is a carry-over from SBML Level 2. Note that it is entirely possible for a model to define a value for two or more of the attributes "volumeUnits", "areaUnits" and "lengthUnits" simultaneously, because SBML models may contain compartments with different numbers of dimensions.
Reactions are processes that occur over time. These processes involve
events of some sort, where a single reaction event'' is one in which
some set of entities (known as reactants, products and modifiers in
SBML) interact, once. The extent of a reaction is a measure of
how many times the reaction has occurred, while the time derivative of
the extent gives the instantaneous rate at which the reaction is
occurring. Thus, what is colloquially referred to as the "rate of the
reaction" is in fact equal to the rate of change of reaction extent.
In SBML Level 3, the combination of "extentUnits" and "timeUnits" defines the units of kinetic laws in SBML and establishes how the numerical value of each KineticLaw object's mathematical formula is meant to be interpreted in a model. The units of the kinetic laws are taken to be "extentUnits" divided by "timeUnits".
Note that this embodies an important principle in SBML Level 3 models: all reactions in an SBML model must have the same units for the rate of change of extent. In other words, the units of all reaction rates in the model must be the same. There is only one global value for "extentUnits" and one global value for "timeUnits".
The attribute "conversionFactor" in SBML Level 3's Model object defines a global value inherited by all Species object instances that do not define separate values for their "conversionFactor" attributes. The value of this attribute must refer to a Parameter object instance defined in the model. The Parameter object in question must be a constant; ie it must have its "constant" attribute value set to "true".
If a given Species object definition does not specify a conversion factor via the "conversionFactor" attribute on Species, then the species inherits the conversion factor specified by the Model "conversionFactor" attribute. If the Model does not define a value for this attribute, then there is no conversion factor to inherit. More information about conversion factors is provided in the SBML Level 3 specifications.
Adds the given Reaction object to this Model.
❗DANGER: in libSBML, addX methods can have complex ownership semantics. Model#createReaction should be used instead.
(Reaction)
the Reaction object to add
Removes the nth Reaction object from this Model object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
(number)
the index of the Reaction object to remove.
Reaction
:
the Reaction object removed, or NULL if the given index is
out of range.
Adds the given Species object to this Model.
❗DANGER: in libSBML, addX methods can have complex ownership semantics. Model#createSpecies should be used instead.
(Species)
the Species object to add
Removes the nth Species object from this Model object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
(number)
the index of the Species object to remove.
Species
:
the Species object removed, or NULL if the given index is out
of range.
Get the nth UnitDefinition object in this Model.
(number)
the index of the object to return
UnitDefinition
:
the nth UnitDefinition of this Model.
If the index n is invalid, NULL is returned.
Get the nth Compartment object in this Model.
(number)
the index of the object to return.
Compartment
:
the nth Compartment of this Model.
If the index n is invalid, NULL is returned.
Creates a new Compartment inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as any SBML package namespaces, are used to initialize this object's corresponding attributes.
Compartment
:
the Compartment object created.
Removes the nth Compartment object from this Model object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
(number)
the index of the Compartment object to remove.
Compartment
:
the Compartment object removed, or @c NULL if the given index is
out of range.
Get the nth FunctionDefinitions object in this Model.
(number)
the index of the object to return
FunctionDefinition
:
the nth FunctionDefinition of this Model.
If the index n is invalid, NULL is returned.
Get a SpeciesReference object based on its identifier.
(string)
the identifier to search for
SpeciesReference
:
the SpeciesReference in this Model with the identifier sid or NULL
if no such SpeciesReference exists.
Get a ModifierSpeciesReference object based on its identifier.
(string)
the identifier to search for
ModifierSpeciesReference
:
the ModifierSpeciesReference in this Model with the
identifier sid or NULL
if no such ModifierSpeciesReference exists.
Get the nth InitialAssignment object in this Model.
(number)
the index of the object to return
InitialAssignment
:
the nth InitialAssignment of this Model.
If the index n is invalid, NULL is returned.
Get an InitialAssignment object based on the symbol to which it assigns a value.
(string)
the symbol to search for
InitialAssignment
:
the InitialAssignment in this Model with the given "symbol"
attribute value or NULL if no such InitialAssignment exists.
Creates a new InitialAssignment inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as any SBML package namespaces, are used to initialize this object's corresponding attributes.
InitialAssignment
:
the InitialAssignment object created.
Creates a new AlgebraicRule inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as any SBML package namespaces, are used to initialize this object's corresponding attributes.
AlgebraicRule
:
the AlgebraicRule object created.
Creates a new AssignmentRule inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as any SBML package namespaces, are used to initialize this object's corresponding attributes.
AssignmentRule
:
the AssignmentRule object created.
Creates a new Constraint inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as any SBML package namespaces, are used to initialize this object's corresponding attributes.
Constraint
:
the Constraint object created.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Returns the nth plug-in object (extension interface) for an SBML Level 3 package extension.
If no such plugin exists, NULL is returned.
Note: To get a plugin corresponding to a given id, use the findPlugin method. Calling Model.findPlugin("fbc") will return an FbcModelPlugin; calling Parameter.findPlugin("comp") will return CompSBasePlugin, etc. However, these instances must be cast to the derived type using castObject
(number)
the index of the plug-in to return
SBasePlugin
:
the nth plug-in object (the libSBML extension interface) of a
package extension.
If the index n is invalid, NULL is returned.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
In SBML Level 2, product and reactant stoichiometries can be specified using either the "stoichiometry" attribute or a "stoichiometryMath" element in a SpeciesReference object. The "stoichiometry" attribute is of type double and should contain values greater than zero (0). The "stoichiometryMath" element is implemented as an element containing a MathML expression. These two are mutually exclusive; only one of "stoichiometry" or "stoichiometryMath" should be defined in a given SpeciesReference instance. When neither the attribute nor the element is present, the value of "stoichiometry" in the enclosing SpeciesReference instance defaults to 1.
For maximum interoperability, SpeciesReference's "stoichiometry" attribute should be used in preference to "stoichiometryMath" when a species' stoichiometry is a simple scalar number (integer or decimal). When the stoichiometry is a rational number, or when it is a more complicated formula, "stoichiometryMath" must be used. The MathML expression in "stoichiometryMath" may also refer to identifiers of entities in a model (except reaction identifiers). However, the only species identifiers that can be used in "stoichiometryMath" are those referenced in the enclosing Reaction's list of reactants, products and modifiers.
The "stoichiometry" attribute and the "stoichiometryMath" element, when either is used, is each interpreted as a factor applied to the reaction rate to produce the rate of change of the species identified by the "species" attribute in the enclosing SpeciesReference. This is the normal interpretation of a stoichiometry, but in SBML, one additional consideration has to be taken into account. The reaction rate, which is the result of the KineticLaw's "math" element, is always in the model's substance per time units. However, the rate of change of the species will involve the species' substance units (i.e., the units identified by the Species object's "substanceUnits" attribute), and these units may be different from the model's default substance units. If the units are different, the stoichiometry must incorporate a conversion factor for converting the model's substance units to the species' substance units. The conversion factor is assumed to be included in the scalar value of the "stoichiometry" attribute if "stoichiometry" is used. If instead "stoichiometryMath" is used, then the product of the model's "substance" units times the "stoichiometryMath" units must match the substance units of the species. Note that in either case, if the species' units and the model's default substance units are the same, the stoichiometry ends up being a dimensionless number and equivalent to the standard chemical stoichiometry found in textbooks. Examples and more explanations of this are given in the SBML specification.
The following is a simple example of a species reference for species "X0", with stoichiometry 2, in a list of reactants within a reaction having the identifier "J1":
<model>
...
<listOfReactions>
<reaction id="J1">
<listOfReactants>
<speciesReference species="X0" stoichiometry="2">
</listOfReactants>
...
</reaction>
...
</listOfReactions>
...
</model>
The following is a more complex example of a species reference for species "X0", with a stoichiometry formula consisting of a rational number:
<model>
...
<listOfReactions>
<reaction id="J1">
<listOfReactants>
<speciesReference species="X0">
<stoichiometryMath>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<cn type="rational"> 3 <sep/> 2 </cn>
</math>
</stoichiometryMath>
</speciesReference>
</listOfReactants>
...
</reaction>
...
</listOfReactions>
...
</model>
Additional discussions of stoichiometries and implications for species and reactions are included in the documentation of SpeciesReference class.
The StoichiometryMath construct is not defined in SBML Level 3. Instead, Level 3 defines the identifier of SpeciesReference objects as a stand-in for the stoichiometry of the reactant or product being referenced, and allows that identifier to be used elsewhere in SBML models, including (for example) InitialAssignment objects. This makes it possible to achieve the same effect as StoichiometryMath, but with other SBML objects. For instance, to produce a stoichiometry value that is a rational number, a model can use InitialAssignment to assign the identifier of a SpeciesReference object to a MathML expression evaluating to a rational number. This is analogous to the same way that, in Level 2, the model would use StoichiometryMath with a MathML expression evaluating to a rational number.
In SBML Level 2, the stoichiometry of a reactant or product is a combination of both a biochemical stoichiometry (meaning, the standard stoichiometry of a species in a reaction) and any necessary unit conversion factors. The introduction of an explicit attribute on the Species object for a conversion factor allows Level 3 to avoid having to overload the meaning of stoichiometry. In Level 3, the stoichiometry given by a SpeciesReference object in a reaction is a "proper" biochemical stoichiometry, meaning a dimensionless number free of unit conversions.
The Reaction structure provides a way to express which species act as reactants and which species act as products in a reaction. In a given reaction, references to those species acting as reactants and/or products are made using instances of SpeciesReference structures in a Reaction object's lists of reactants and products.
A species can occur more than once in the lists of reactants and products of a given Reaction instance. The effective stoichiometry for a species in a reaction is the sum of the stoichiometry values given on the SpeciesReference object in the list of products minus the sum of stoichiometry values given on the SpeciesReference objects in the list of reactants. A positive value indicates the species is effectively a product and a negative value indicates the species is effectively a reactant. SBML places no restrictions on the effective stoichiometry of a species in a reaction; for example, it can be zero.
In SBML Level 3, the unit of measurement associated with the value of a species' stoichiometry is always considered to be dimensionless. This has the following implications:
When a species reference's identifier appears in mathematical formulas elsewhere in the model, the unit associated with that value is dimensionless.
The units of the "math" elements of AssignmentRule, InitialAssignment and EventAssignment objects setting the stoichiometry of the species reference should be dimensionless.
If a species reference's identifier is the subject of a RateRule, the unit associated with the RateRule object's value should be dimensionless/time, where time is the model-wide unit of time set on the Model object.
See the libSBML C++ docs for this class
Get the value of the "stoichiometry" attribute.
In SBML Level 2, product and reactant stoichiometries can be specified using either "stoichiometry" or "stoichiometryMath" in a SpeciesReference object. The former is to be used when a stoichiometry is simply a scalar number, while the latter is for occasions when it needs to be a rational number or it needs to reference other mathematical expressions. The "stoichiometry" attribute is of type double and should contain values greater than zero (0). The "stoichiometryMath" element is implemented as an element containing a MathML expression. These two are mutually exclusive; only one of "stoichiometry" or "stoichiometryMath" should be defined in a given SpeciesReference instance. When neither the attribute nor the element is present, the value of "stoichiometry" in the SpeciesReference instance defaults to 1. For maximum interoperability between different software tools, the "stoichiometry" attribute should be used in preference to "stoichiometryMath" when a species' stoichiometry is a simple scalar number (integer or decimal).
In SBML Level 3, there is no StoichiometryMath, and SpeciesReference objects have only the "stoichiometry" attribute.
number
:
the value of the (scalar) "stoichiometry" attribute of this
SpeciesReference.
Get the content of the "stoichiometryMath" subelement as an ASTNode tree.
The "stoichiometryMath" element exists only in SBML Level 2. There, product and reactant stoichiometries can be specified using either "stoichiometry" or "stoichiometryMath" in a SpeciesReference object. The former is to be used when a stoichiometry is simply a scalar number, while the latter is for occasions when it needs to be a rational number or it needs to reference other mathematical expressions. The "stoichiometry" attribute is of type double and should contain values greater than zero (0). The "stoichiometryMath" element is implemented as an element containing a MathML expression. These two are mutually exclusive; only one of "stoichiometry" or "stoichiometryMath" should be defined in a given SpeciesReference instance. When neither the attribute nor the element is present, the value of "stoichiometry" in the SpeciesReference instance defaults to 1. For maximum interoperability between different software tools, the "stoichiometry" attribute should be used in preference to "stoichiometryMath" when a species' stoichiometry is a simple scalar number (integer or decimal).
any
:
the content of the "stoichiometryMath" subelement of this
SpeciesReference.
Get the value of the "denominator" attribute, for the case of a rational-numbered stoichiometry or a model in SBML Level 1.
The "denominator" attribute is only actually written out in the case of an SBML Level 1 model. In SBML Level 2, rational-number stoichiometries are written as MathML elements in the "stoichiometryMath" subelement. However, as a convenience to users, libSBML allows the creation and manipulation of rational-number stoichiometries by supplying the numerator and denominator directly rather than having to manually create an ASTNode object. LibSBML will write out the appropriateructs (either a combination of "stoichiometry" and "denominator" in the case of SBML Level 1, or a "stoichiometryMath" subelement in the case of SBML Level 2). However, as the "stoichiometryMath" subelement was removed in SBML Level 3, automatic translation of the "denominator" attribute is no longer supported for that level.
number
:
the value of the "denominator" attribute of this
SpeciesReference.
Sets the value of the "stoichiometry" attribute of this SpeciesReference.
In SBML Level 2, product and reactant stoichiometries can be specified using either "stoichiometry" or "stoichiometryMath" in a SpeciesReference object. The former is to be used when a stoichiometry is simply a scalar number, while the latter is for occasions when it needs to be a rational number or it needs to reference other mathematical expressions. The "stoichiometry" attribute is of type double and should contain values greater than zero (0). The "stoichiometryMath" element is implemented as an element containing a MathML expression. These two are mutually exclusive; only one of "stoichiometry" or "stoichiometryMath" should be defined in a given SpeciesReference instance. When neither the attribute nor the element is present, the value of "stoichiometry" in the SpeciesReference instance defaults to 1. For maximum interoperability between different software tools, the "stoichiometry" attribute should be used in preference to "stoichiometryMath" when a species' stoichiometry is a simple scalar number (integer or decimal).
In SBML Level 3, there is no StoichiometryMath, and SpeciesReference objects have only the "stoichiometry" attribute.
(number)
the new value of the "stoichiometry" attribute
Note: In SBML Level 2, the "stoichiometryMath" subelement of this SpeciesReference object will be unset because the "stoichiometry" attribute and the stoichiometryMath" subelement are mutually exclusive.
Sets the "stoichiometryMath" subelement of this SpeciesReference.
The Abstract Syntax Tree in @p math is copied.
In SBML Level 2, product and reactant stoichiometries can be specified using either "stoichiometry" or "stoichiometryMath" in a SpeciesReference object. The former is to be used when a stoichiometry is simply a scalar number, while the latter is for occasions when it needs to be a rational number or it needs to reference other mathematical expressions. The "stoichiometry" attribute is of type double and should contain values greater than zero (0). The "stoichiometryMath" element is implemented as an element containing a MathML expression. These two are mutually exclusive; only one of "stoichiometry" or "stoichiometryMath" should be defined in a given SpeciesReference instance. When neither the attribute nor the element is present, the value of "stoichiometry" in the SpeciesReference instance defaults to 1. For maximum interoperability between different software tools, the "stoichiometry" attribute should be used in preference to "stoichiometryMath" when a species' stoichiometry is a simple scalar number (integer or decimal).
In SBML Level 3, there is no StoichiometryMath, and SpeciesReference objects have only the "stoichiometry" attribute.
(StoichiometryMath)
the StoichiometryMath expression that is to be copied as the
content of the "stoichiometryMath" subelemen
Note: In SBML Level 2, the "stoichiometry" attribute of this SpeciesReference object will be unset (isSetStoichiometry() will return false although getStoichiometry() will return 1.0) if the given math is not null because the "stoichiometry" attribute and the stoichiometryMath" subelement are mutually exclusive.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Returns the nth plug-in object (extension interface) for an SBML Level 3 package extension.
If no such plugin exists, NULL is returned.
Note: To get a plugin corresponding to a given id, use the findPlugin method. Calling Model.findPlugin("fbc") will return an FbcModelPlugin; calling Parameter.findPlugin("comp") will return CompSBasePlugin, etc. However, these instances must be cast to the derived type using castObject
(number)
the index of the plug-in to return
SBasePlugin
:
the nth plug-in object (the libSBML extension interface) of a
package extension.
If the index n is invalid, NULL is returned.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
Sometimes a species appears in the kinetic rate formula of a reaction but is itself neither created nor destroyed in that reaction (for example, because it acts as a catalyst or inhibitor). In SBML, all such species are simply called modifiers without regard to the detailed role of those species in the model. The Reaction structure provides a way to express which species act as modifiers in a given reaction. This is the purpose of the list of modifiers available in Reaction. The list contains instances of ModifierSpeciesReference structures.
The ModifierSpeciesReference structure inherits the mandatory attribute "species" and optional attributes "id" and "name" from the parent class SimpleSpeciesReference. See the description of SimpleSpeciesReference for more information about these.
The value of the "species" attribute must be the identifier of a species defined in the enclosing Model; this species is designated as a modifier for the current reaction. A reaction may have any number of modifiers. It is permissible for a modifier species to appear simultaneously in the list of reactants and products of the same reaction where it is designated as a modifier, as well as to appear in the list of reactants, products and modifiers of other reactions in the model.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Returns the nth plug-in object (extension interface) for an SBML Level 3 package extension.
If no such plugin exists, NULL is returned.
Note: To get a plugin corresponding to a given id, use the findPlugin method. Calling Model.findPlugin("fbc") will return an FbcModelPlugin; calling Parameter.findPlugin("comp") will return CompSBasePlugin, etc. However, these instances must be cast to the derived type using castObject
(number)
the index of the plug-in to return
SBasePlugin
:
the nth plug-in object (the libSBML extension interface) of a
package extension.
If the index n is invalid, NULL is returned.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
A species in SBML refers to a pool of entities that (a) are considered indistinguishable from each other for the purposes of the model, (b) participate in reactions, and (c) are located in a specific compartment. The SBML Species object class is intended to represent these pools.
As with other majorructs in SBML, Species has a mandatory attribute, "id", used to give the species type an identifier in the model. The identifier must be a text string conforming to the identifer syntax permitted in SBML. Species also has an optional "name" attribute, of type string. The "id" and "name" must be used according to the guidelines described in the SBML specifications.
The required attribute "compartment" is used to identify the compartment in which the species is located. The attribute's value must be the identifier of an existing Compartment object. It is important to note that there is no default value for the "compartment" attribute on Species; every species in an SBML model must be assigned a compartment explicitly. (This also implies that every model with one or more Species objects must define at least one Compartment object.)
The optional attributes "initialAmount" and "initialConcentration", both having a data type of double, can be used to set the initial quantity of the species in the compartment where the species is located. These attributes are mutually exclusive; i.e., only one can have a value on any given instance of a Species object. Missing "initialAmount" and "initialConcentration" values implies that their values either are unknown, or to be obtained from an external source, or determined by an InitialAssignment or other SBMLruct elsewhere in the model.
A species' initial quantity in SBML is set by the "initialAmount" or "initialConcentration" attribute exactly once. If the "constant" attribute is true, then the value of the species' quantity is fixed and cannot be changed except by an InitialAssignment. These methods differ in that the "initialAmount" and "initialConcentration" attributes can only be used to set the species quantity to a literal floating-point number, whereas the use of an InitialAssignment object allows the value to be set using an arbitrary mathematical expression (which, thanks to MathML's expressiveness, may evaluate to a rational number). If the species' "constant" attribute is false, the species' quantity value may be overridden by an InitialAssignment or changed by AssignmentRule or AlgebraicRule, and in addition, for t > 0, it may also be changed by a RateRule, Event objects, and as a result of being a reactant or product in one or more Reaction objects. (However, some ructs are mutually exclusive; see the SBML specifications for the precise details.) It is not an error to define "initialAmount" or "initialConcentration" on a species and also redefine the value using an InitialAssignment, but the "initialAmount" or "initialConcentration" setting in that case is ignored. The SBML specifications provide additional information about the semantics of assignments, rules and values for simulation time t < 0.
SBML Level 2 additionally stipulates that in cases where a species' compartment has a "spatialDimensions" value of 0 (zero), the species cannot have a value for "initialConcentration" because the concepts of concentration and density break down when a container has zero dimensions.
When the attribute "initialAmount" is set, the unit of measurement associated with the value of "initialAmount" is specified by the Species attribute "substanceUnits". When the "initialConcentration" attribute is set, the unit of measurement associated with this concentration value is {unit of amount} divided by {unit of size}, where the {unit of amount} is specified by the Species "substanceUnits" attribute, and the {unit of size} is specified by the "units" attribute of the Compartment object in which the species is located. Note that in either case, a unit of amount is involved and determined by the "substanceUnits" attribute. Note these two attributes alone do not determine the units of the species when the species identifier appears in a mathematical expression ; that aspect is determined by the attribute "hasOnlySubstanceUnits" discussed below.
In SBML Level 3, if the "substanceUnits" attribute is not set on a given Species object instance, then the unit of amount for that species is inherited from the "substanceUnits" attribute on the enclosing Model object instance. If that attribute on Model is not set either, then the unit associated with the species' quantity is undefined.
In SBML Level 2, if the "substanceUnits" attribute is not set on a given Species object instance, then the unit of amount for that species is taken from the predefined SBML unit identifier "substance". The value assigned to "substanceUnits" must be chosen from one of the following possibilities: one of the base unit identifiers defined in SBML, the built-in unit identifier "substance", or the identifier of a new unit defined in the list of unit definitions in the enclosing Model object. The chosen units for "substanceUnits" must be be "dimensionless", "mole", "item", "kilogram", "gram", or units derived from these.
As noted at the beginning of this section, simply setting "initialAmount" or "initialConcentration" alone does not determine whether a species identifier represents an amount or a concentration when it appears elsewhere in an SBML model. The role of the attribute "hasOnlySubstanceUnits" is to indicate whether the units of the species, when the species identifier appears in mathematical formulas, are intended to be concentration or amount. The attribute takes on a boolean value. In SBML Level 3, the attribute has no default value and must always be set in a model; in SBML Level 2, it has a default value of false.
The units of the species are used in the following ways:
When the species' identifier appears in a MathML formula, it represents the species' quantity, and the unit of measurement associated with the quantity is as described above.
The "math" elements of AssignmentRule, InitialAssignment and EventAssignment objects referring to this species should all have the same units as the unit of measurement associated with the species quantity.
In a RateRule object that defines the rate of change of the species' quantity, the unit associated with the rule's "math" element should be equal to the unit of the species' quantity divided by the model-wide unit of time; in other words, {unit of species quantity}/{unit of time}.
The Species object class has two boolean attributes named "constant" and "boundaryCondition", used to indicate whether and how the quantity of that species can vary during a simulation. In SBML Level 2 they are optional; in SBML Level 3 they are mandatory. The following table shows how to interpret the combined values of these attributes.
By default, when a species is a product or reactant of one or more reactions, its quantity is determined by those reactions. In SBML, it is possible to indicate that a given species' quantity is not determined by the set of reactions even when that species occurs as a product or reactant; i.e., the species is on the boundary of the reaction system, and its quantity is not determined by the reactions. The boolean attribute "boundaryCondition" can be used to indicate this. A value of false indicates that the species is part of the reaction system. In SBML Level 2, the attribute has a default value of false, while in SBML Level 3, it has no default.
The "constant" attribute indicates whether the species' quantity can be changed at all, regardless of whether by reactions, rules, orructs other than InitialAssignment. A value of false indicates that the species' quantity can be changed. (This is also a common value because the purpose of most simulations is precisely to calculate changes in species quantities.) In SBML Level 2, the attribute has a default value of false, while in SBML Level 3, it has no default. Note that the initial quantity of a species can be set by an InitialAssignment irrespective of the value of the "constant" attribute.
In practice, a "boundaryCondition" value of true means a differential equation derived from the reaction definitions should not be generated for the species. However, the species' quantity may still be changed by AssignmentRule, RateRule, AlgebraicRule, Event, and InitialAssignment ructs if its "constant" attribute is false. Conversely, if the species' "constant" attribute is true, then its value cannot be changed by anything except InitialAssignment.
A species having "boundaryCondition"=false and "constant"=false can appear as a product and/or reactant of one or more reactions in the model. If the species is a reactant or product of a reaction, it must not also appear as the target of any AssignmentRule or RateRule object in the model. If instead the species has "boundaryCondition"= false and "constant"=true, then it cannot appear as a reactant or product, or as the target of any AssignmentRule, RateRule or EventAssignment object in the model.
Finally, it is worth clarifying that while theant and boundaryCondition attributes restrict whether and how the species amount changes, the same is not true of a species' concentration. In SBML, the concentration of a species is a quantity that depends on the size of the compartment in which it is located. A compartment's size may change, and therefore, so can the concentration of a species even if the amount of the species remains unchanged. A species' concentration may therefore vary even if the Species object'sant attribute is set to true in a model.
In SBML Level 3, Species has an additional optional attribute, "conversionFactor", that defines a conversion factor that applies to a particular species. The value must be the identifier of a Parameter object instance defined in the model. That Parameter object must be a ant, meaning its "constant" attribute must be set to true. If a given Species object definition defines a value for its "conversionFactor" attribute, it takes precedence over any factor defined by the Model object's "conversionFactor" attribute.
The unit of measurement associated with a species' quantity can be different from the unit of extent of reactions in the model. SBML Level 3 avoids implicit unit conversions by providing an explicit way to indicate any unit conversion that might be required. The use of a conversion factor in computing the effects of reactions on a species' quantity is explained in detail in the SBML Level 3 specification document. Because the value of the "conversionFactor" attribute is the identifier of a Parameter object, and because parameters can have units attached to them, the transformation from reaction extent units to species units can be completely specified using this approach.
Note that the unit conversion factor is only applied when calculating the effect of a reaction on a species . It is not used in any rules or other SBMLructs that affect the species, and it is also not used when the value of the species is referenced in a mathematical expression.
In SBML Level 2 Versions 2-4, each species in a model may optionally be designated as belonging to a particular species type. The optional attribute "speciesType" is used to identify the species type of the chemical entities that make up the pool represented by the Species objects. The attribute's value must be the identifier of an existing SpeciesType object in the model. If the "speciesType" attribute is not present on a particular species definition, it means the pool contains chemical entities of a type unique to that pool; in effect, a virtual species type is assumed for that species, and no other species can belong to that species type. The value of "speciesType" attributes on species have no effect on the numerical interpretation of a model; simulators and other numerical analysis software may ignore "speciesType" attributes.
There can be only one species of a given species type in any given compartment of a model. More specifically, for all Species objects having a value for the "speciesType" attribute, the pair ("speciesType" attribute value, "compartment" attribute value)
must be unique across the set of all Species object in a model.
In versions of SBML Level 2 before Version 3, the class Species included an attribute called "spatialSizeUnits", which allowed explicitly setting the units of size for initial concentration. LibSBML retains this attribute for compatibility with older definitions of Level 2, but its use is strongly discouraged because many software tools do no properly interpret this unit declaration and it is incompatible with all SBML specifications after Level 2 Version 3.
Species are unique in SBML in that they have a kind of duality: a species identifier may stand for either substance amount (meaning, a count of the number of individual entities) or a concentration or density (meaning, amount divided by a compartment size). The previous sections explain the meaning of a species identifier when it is referenced in a mathematical formula or in rules or other SBML ructs; however, it remains to specify what happens to a species when the compartment in which it is located changes in size.
When a species definition has a "hasOnlySubstanceUnits" attribute value of false and the size of the compartment in which the species is located changes, the default in SBML is to assume that it is the concentration that must be updated to account for the size change. This follows from the principle that, all other things heldant, if a compartment simply changes in size, the size change does not in itself cause an increase or decrease in the number of entities of any species in that compartment. In a sense, the default is that the amount of a species is preserved across compartment size changes. Upon such size changes, the value of the concentration or density must be recalculated from the simple relationship concentration = amount / size if the value of the concentration is needed (for example, if the species identifier appears in a mathematical formula or is otherwise referenced in an SBMLruct). There is one exception: if the species' quantity is determined by an AssignmentRule, RateRule, AlgebraicRule, or an EventAssignment and the species has a "hasOnlySubstanceUnits" attribute value of false, it means that the concentration is assigned by the rule or event; in that case, the amount must be calculated when the compartment size changes. (Events also require additional care in this situation, because an event with multiple assignments could conceivably reassign both a species quantity and a compartment size simultaneously. Please refer to the SBML specifications for the details.)
Note that the above only matters if a species has a "hasOnlySubstanceUnits" attribute value of false, meaning that the species identifier refers to a concentration wherever the identifier appears in a mathematical formula. If instead the attribute's value is true, then the identifier of the species always stands for an amount wherever it appears in a mathematical formula or is referenced by an SBMLruct. In that case, there is never a question about whether an assignment or event is meant to affect the amount or concentration: it is always the amount.
A particularly confusing situation can occur when the species has "constant" attribute value of true in combination with a "hasOnlySubstanceUnits" attribute value of false. Suppose this species is given a value for "initialConcentration". Does a "constant" value of true mean that the concentration is heldant if the compartment size changes? No; it is still the amount that is kept ant across a compartment size change. The fact that the species was initialized using a concentration value is irrelevant.
Predicate returning true if this Species object's "initialAmount" attribute is set.
boolean
:
true if the "initialAmount" attribute of this Species is
set, false otherwise
Note: In SBML Level 1, Species' "initialAmount" is required and therefore should always be set. (However, in Level 1, the attribute has no default value either, so this method will not return true until a value has been assigned.) In SBML Level 2, "initialAmount" is optional and as such may or may not be set.
Sets the "initialConcentration" attribute of this Species and marks the field as set.
This method also unsets the "initialAmount" attribute.
(number)
the value to which the "initialConcentration" attribute
should be set
Note: The attribute "initialConcentration" is only available in SBML Level 2 and 3. It does not exist on Species in Level 1.
Predicate returning true if this Species object's "initialConcentration" attribute is set.
boolean
:
true if the "initialConcentration" attribute of this Species is
set, false otherwise
Note: The attribute "initialConcentration" is only available in SBML Level 2 and 3. It does not exist on Species in Level 1.
Predicate returning true if this Species object's "hasOnlySubstanceUnits" attribute is set.
boolean
:
true if the "hasOnlySubstanceUnits" attribute of this Species is
set, false otherwise
Note: The "hasOnlySubstanceUnits" attribute does not exist in SBML Level 1.
Sets the "constant" attribute of this Species object.
(value)
a boolean value for the "constant" attribute
Note: The attribute "constant" is only available in SBML Levels 2 and 3. It does not exist on Species in Level 1.
Predicate returning true if this Species object's "constant" attribute is set.
boolean
:
true if the "constant" attribute of this Species is
set, false otherwise
Note: The attribute "constant" is only available in SBML Levels 2 and 3. It does not exist on Species in Level 1.
Sets the value of the "conversionFactor" attribute of this Species object.
The string in sid is copied.
(string)
the new conversionFactor for the Species
Note: The "conversionFactor" attribute was introduced in SBML Level 3. It does not exist on Species in SBML Levels 1 and 2.
Predicate returning true if this Species object's "conversionFactor" attribute is set.
boolean
:
true if the "conversionFactor" attribute of this Species is
set, false otherwise
Note: The "conversionFactor" attribute was introduced in SBML Level 3. It does not exist on Species in SBML Levels 1 and 2.
Unsets the value of the "constant" attribute of this Species object.
Unsets the "initialAmount" attribute value of this Species object.
Unsets the "initialConcentration" attribute value of this Species object.
Note: The attribute "initialConcentration" is only available in SBML Level 2 and 3. It does not exist on Species in Level 1.
Unsets the "substanceUnits" attribute value of this Species object.
Unsets the "units" attribute value of this Species object.
Unsets the "conversionFactor" attribute value of this Species object.
Note: The "conversionFactor" attribute was introduced in SBML Level 3. It does not exist on Species in SBML Levels 1 and 2.
Unsets the "compartment" attribute value of this Species object.
Unsets the "boundaryCondition" attribute value of this Species object.
Unsets the "hasOnlySubstanceUnits" attribute value of this Species object.
Initializes the fields of this Species object to "typical" defaults values.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Returns the nth plug-in object (extension interface) for an SBML Level 3 package extension.
If no such plugin exists, NULL is returned.
Note: To get a plugin corresponding to a given id, use the findPlugin method. Calling Model.findPlugin("fbc") will return an FbcModelPlugin; calling Parameter.findPlugin("comp") will return CompSBasePlugin, etc. However, these instances must be cast to the derived type using castObject
(number)
the index of the plug-in to return
SBasePlugin
:
the nth plug-in object (the libSBML extension interface) of a
package extension.
If the index n is invalid, NULL is returned.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
An object of class KineticLaw is used to describe the rate at which the process defined by a given Reaction takes place. KineticLaw has subelements called "math" (for MathML content) and "listOfParameters" (of class ListOfParameters), in addition to the attributes and subelements it inherits from SBase.
KineticLaw's "math" subelement for holding a MathML formula (required through SBML Level 3 Version 1, but optional as of SBML Level 3 Version 2) defines the rate of the reaction. The formula may refer to other entities in a model as well as local parameter definitions within the scope of the Reaction (see below). It is important to keep in mind, however, that the only Species identifiers that can be used in this formula are those declared in the lists of reactants, products and modifiers in the Reaction structure. (In other words, before a species can be referenced in the KineticLaw, it must be declared in one of those lists.)
KineticLaw provides a way to define local parameters whose identifiers can be used in the "math" formula of that KineticLaw instance. Prior to SBML Level 3, these parameter definitions are stored inside a "listOfParameters" subelement containing Parameter objects; in SBML Level 3, this is achieved using a specialized object class called LocalParameter and the containing subelement is called "listOfLocalParameters". In both cases, the parameters so defined are only visible within the KineticLaw (or, as of SBML Level 3 Version 2, only visible within the parent Reaction); they cannot be accessed outside. A local parameter within one reaction is not visible from within another reaction, nor is it visible to any other construct outside of the KineticLaw in which it is defined. In addition, another important feature is that if such a Parameter (or in Level 3, LocalParameter) object has the same identifier as another object in the scope of the enclosing Model, the definition inside the KineticLaw takes precedence. In other words, within the KineticLaw's "math" formula, references to local parameter identifiers shadow any identical global identifiers.
The values of local parameters defined within KineticLaw objects cannot change. In SBML Level 3, this quality is built into the LocalParameter construct. In Level 2, where the same kind of Parameter object class is used as for global parameters, the Parameter objects' "constant" attribute must always have a value of true (either explicitly or left to its default value).
A common misconception is that different classes of objects (e.g., species, compartments, parameters) in SBML have different identifier scopes. They do not. The implication is that if a KineticLaw's local parameter definition uses an identifier identical to any other identifier defined in the model outside the KineticLaw, even if the other identifier does not belong to a parameter type of object, the local parameter's identifier takes precedence within that KineticLaw's "math" formula. It is not an error in SBML for identifiers to shadow each other this way, but can lead to confusing and subtle errors.
In SBML Level 2 Version 1, the SBML specification included two additional attributes on KineticLaw called "substanceUnits" and "timeUnits". They were removed beginning with SBML Level 2 Version 2 because further research determined they introduced many problems. The most significant problem was that their use could easily lead to the creation of valid models whose reactions nevertheless could not be integrated into a system of equations without outside knowledge for converting the quantities used. Examination of real-life models revealed that a common reason for using "substanceUnits" on KineticLaw was to set the units of all reactions to the same set of substance units, something that is better achieved by using UnitDefinition to redefine "substance" for the whole Model.
As mentioned above, in SBML Level 2 Versions 2–4, local parameters are of class Parameter. In SBML Level 3, the class of object is LocalParameter.
In SBML Level 3 Version 2, the scope of the LocalParameter was expanded to the entire Reaction, instead of just the KineticLaw. This introduced a single new restriction: an L3v2 LocalParameter may not now shadow the id of any Species referenced by a SpeciesReference in the same Reaction. Other than that, there is no difference in any core construct. However, packages may take advantage of this new scope by adding elements to the Reaction that may now reference a LocalParameter defined in the same Reaction.
Returns the mathematical formula for this KineticLaw object and return it as as an AST.
This is fundamentally equivalent to KineticLaw#getFormula. The latter is provided principally for compatibility compatibility with SBML Level 1, which represented mathematical formulas in text-string form.
ASTNode
:
the root node of the mathematical formula,
or NULL if the math is not set.
Sets the mathematical expression of this KineticLaw instance to a copy of the given ASTNode.
This is fundamentally identical to KineticLaw#setFormula. The latter is provided principally for compatibility compatibility with SBML Level 1, which represented mathematical formulas in text-string form.
(ASTNode)
an ASTNode representing a formula tree
Creates a new LocalParameter object, adds it to this KineticLaw's list of local parameters, and returns the LocalParameter object created.
LocalParameter
:
a new LocalParameter object instance.
Returns the nth LocalParameter object in the list of local parameters in this KineticLaw instance.
(number)
the index of the LocalParameter object sought
LocalParameter
:
the nth LocalParameter of this KineticLaw.
If the index n is invalid, NULL is returned.
Removes the nth LocalParameter object in the list of local parameters in this KineticLaw instance and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
(number)
the index of the LocalParameter object to remove
LocalParameter
:
the LocalParameter object removed. As mentioned above,
the caller owns the returned item. NULL is returned if the given index
is out of range.
Removes the nth Parameter object in the list of parameters in this KineticLaw instance and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
(number)
the index of the Parameter object to remove
Parameter
:
the Parameter object removed. As mentioned above,
the caller owns the returned item. NULL is returned if the given index
is out of range.
Returns the mathematical formula for this KineticLaw object and return it as as a text string.
This is fundamentally equivalent to KineticLaw#getMath. This variant is provided principally for compatibility compatibility with SBML Level 1.
string
:
a string representing the formula of this KineticLaw.
Sets the mathematical expression of this KineticLaw instance to the given formula.
The given formula string is copied. Internally, libSBML stores the mathematical expression as an ASTNode.
(number)
the mathematical expression to use, represented in
text-string form
Calculates and returns a UnitDefinition that expresses the units of measurement assumed for the "math" expression of this KineticLaw.
UnitDefinition
:
a UnitDefinition that expresses the units of the math
expression of this KineticLaw, or NULL if one cannot be constructed.
Predicate returning true if the math expression of this KineticLaw contains parameters/numbers with undeclared units.
boolean
:
true if the math expression of this KineticLaw
includes parameters/numbers
with undeclared units, false otherwise.
Note: A return value of true indicates that the UnitDefinition returned by getDerivedUnitDefinition may not accurately represent the units of the expression.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Returns the nth plug-in object (extension interface) for an SBML Level 3 package extension.
If no such plugin exists, NULL is returned.
Note: To get a plugin corresponding to a given id, use the findPlugin method. Calling Model.findPlugin("fbc") will return an FbcModelPlugin; calling Parameter.findPlugin("comp") will return CompSBasePlugin, etc. However, these instances must be cast to the derived type using castObject
(number)
the index of the plug-in to return
SBasePlugin
:
the nth plug-in object (the libSBML extension interface) of a
package extension.
If the index n is invalid, NULL is returned.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
A reaction represents any transformation, transport or binding process, typically a chemical reaction, that can change the quantity of one or more species. In SBML, a reaction is defined primarily in terms of the participating reactants and products (and their corresponding stoichiometries), along with optional modifier species, an optional rate at which the reaction takes place, and optional parameters.
As with other major objects in SBML, Reaction has a mandatory attribute, "id", used to give the reaction an identifier. The identifier must be a text string conforming to the identifer syntax permitted in SBML. In SBML Level 2 and Level 3, the reaction "id" identifier can be used in mathematical formulas elsewhere in an SBML model to represent the rate of that reaction; this usage is explained below. Reaction also has an optional "name" attribute, of type string. The "id" and "name" must be used according to the guidelines described in the SBML specification.
The species participating as reactants, products, and/or modifiers in a reaction are declared using lists of SpeciesReference and/or ModifierSpeciesReference instances stored in subelements "listOfReactants", "listOfProducts" and "listOfModifiers". Certain restrictions are placed on the appearance of species in reaction definitions:
The ability of a species to appear as a reactant or product of any reaction in a model is governed by certain flags in that species' definition; see the definition of Species for more information.
Any species appearing in the mathematical formula of the subelement "kineticLaw" (described below) of a Reaction must be declared in at least one of that Reaction's lists of reactants, products, and/or modifiers. Put another way, it is an error for a reaction's kinetic law formula to refer to species that have not been declared for that reaction.
For SBML Levels 1, 2, and SBML Level 3 Version 1, a reaction definition can contain an empty list of reactants or an empty list of products, but it must have at least one reactant or product; in other words, a reaction without any reactant or product species is not permitted. (This restriction does not apply to modifier species, which remain optional in all cases.) In SBML Level 3 Version 2, this requirement was dropped, allowing the creation of reactions with neither reactants nor products.
A reaction can contain up to one KineticLaw object in a subelement named "kineticLaw". It defines the speed at which the process defined by the reaction takes place. The description of KineticLaw provides more details about its use. Note that although the inclusion of a KineticLaw object in an instance of a Reaction component is optional, there is no useful default that can be substituted in place of a missing rate expression in a reaction. Moreover, a reaction's rate cannot be defined in any other way in SBML---InitialAssignment, AssignmentRule, RateRule, AlgebraicRule, Event, and other constructs in SBML cannot be used to set the reaction rate separately. Nevertheless, for some modeling applications, reactions without any defined rate can be perfectly acceptable.
Reaction also has a boolean attribute named "reversible" for indicating whether the reaction is reversible. This attribute is optional in SBML Level 2, with a default of true; it is mandatory in SBML Level 3 (with no default value). To say that a reaction is @em reversible is to say it can proceed in either the forward or the reverse direction. Although the reversibility of a reaction can sometimes be deduced by inspecting its rate expression, this is not always the case, especially for complicated expressions. Moreover, the need in SBML to allow rate expressions (i.e., KineticLaw) to be optional leads to the need for a separate flag indicating reversibility. Note that labeling a reaction as irreversible is an assertion that the reaction always proceeds in the given forward direction. (Why else would it be flagged as irreversible?) This implies the rate expression in the KineticLaw always has a non-negative value during simulations. Software tools could provide a means of optionally testing that this condition holds. The presence of reversibility information in two places (i.e., the rate expression and the "reversible" attribute on Reaction) leaves open the possibility that a model could contain contradictory information, but the creation of such a model would be an error on the part of the software generating it.
The Reaction object class has another boolean attribute called "fast". This attribute is optional in SBML Level 2, with a default of false; it is mandatory in SBML Level 3 (with no default value). In SBML Level 3 Version 2, a value of true for the "fast" attribute is deprecated in favor of all reactions having a "fast" value of false. It is used to indicate that a reaction occurs on a vastly faster time scale than others in a system. Readers are directed to the SBML Level 2 Version 4 specification, which provides more detail about the conditions under which a reaction can be considered to be fast in this sense. SBML Level 1 and Level 2 Version 1 incorrectly claimed that software tools could ignore this attribute if they did not implement support for the corresponding concept; however, further research in SBML has revealed that this is not true, and "fast" cannot be ignored if it is set to true. SBML Level 2 Versions 2–4 therefore stipulate that if a model has any reactions with "fast" set to true, a software tool must be able to respect the attribute or else indicate to the user that it does not have the capacity to do so. Analysis software cannot ignore the value of the "fast" attribute because doing so may lead to different results as compared to a software system that does make use of "fast".
In SBML Level 3, the Reaction object has an additional optional attribute named "compartment", whose value must be the identifier of a compartment defined in the enclosing Model object. The "compartment" attribute can be used to indicate the compartment in which the reaction is assumed to take place. If the attribute is present, its value must be the identifier of a Compartment object defined in the enclosing Model object. Similar to the "reversible" attribute, the value of the "compartment" attribute has no direct impact on the construction of mathematical equations for the SBML model. When a kinetic law is given for a reaction, the compartment location may already be implicit in the kinetic law (although this cannot always be guaranteed). Nevertheless, software tools may find the "compartment" attribute value useful for such purposes as analyzing the structure of the model, guiding the modeler in constructing correct rate formulas, and visualization purposes.
Readers are urged to read the SBML specification for more details about the proper use of Reaction.
See the libSBML C++ docs for this class
Returns the nth reactant species (as a SpeciesReference object) in the list of reactants in this Reaction.
Callers should first call getNumReactants() to find out how many reactants there are, to avoid using an invalid index number.
(number)
the index of the reactant sought
SpeciesReference
:
the nth reactant (as a SpeciesReference object) of this
Reaction.
If the index n is invalid, NULL is returned.
Returns the nth product species (as a SpeciesReference object) in the list of products in this Reaction.
Callers should first call getNumProducts() to find out how many products there are, to avoid using an invalid index number.
(number)
the index of the product sought
SpeciesReference
:
the nth product (as a SpeciesReference object) of this
Reaction.
If the index n is invalid, NULL is returned.
Returns the nth modifier species (as a ModifierSpeciesReference object) in the list of modifiers of this Reaction.
Callers should first call getNumModifiers() to find out how many modifiers there are, to avoid using an invalid index number.
(number)
the index of the modifier species sought.
ModifierSpeciesReference
:
the nth modifier (as a ModifierSpeciesReference object) of
this Reaction.
If the index n is invalid, NULL is returned.
Adds a given SpeciesReference object as a reactant in this Reaction.
The SpeciesReference instance in sr is copied.
(SpeciesReference)
a SpeciesReference object referring to a Species in the
enclosing Model.
Adds a given SpeciesReference object as a product in this Reaction.
The SpeciesReference instance in sr is copied.
(SpeciesReference)
a SpeciesReference object referring to a Species in the
enclosing Model
Adds a given ModifierSpeciesReference object as a product in this Reaction.
The ModifierSpeciesReference instance in msr is copied.
(addModifier)
a ModifierSpeciesReference object referring to a Species in
the enclosing Model
Creates a new SpeciesReference, adds it to this Reaction's list of reactants, and returns it.
SpeciesReference
:
a new SpeciesReference object.
Creates a new SpeciesReference, adds it to this Reaction's list of products, and returns it.
SpeciesReference
:
a new SpeciesReference object.
Creates a new ModifierSpeciesReference, adds it to this Reaction's list of modifiers and returns it.
ModifierSpeciesReference
:
a new ModifierSpeciesReference object.
Removes the nth reactant species (SpeciesReference object) in the list of reactants in this Reaction and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it. The caller should first call getNumReactants() to find out how many reactants there are, to avoid using an invalid index number.
(number)
the index of the reactant SpeciesReference object to remove
SpeciesReference
:
the removed reactant SpeciesReference object, or NULL if the
given index is out of range.
Removes the nth product species (SpeciesReference object) in the list of products in this Reaction and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it. The caller should first call getNumProducts() to find out how many products there are, to avoid using an invalid index number.
(number)
the index of the product SpeciesReference object to remove
SpeciesReference
:
the removed product SpeciesReference object, or NULL if the
given index is out of range.
Removes the nth modifier species (ModifierSpeciesReference object) in the list of modifiers in this Reaction and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it. The caller should first call getNumModifiers() to find out how many modifiers there are, to avoid using an invalid index number.
(number)
the index of the ModifierSpeciesReference object to remove.
ModifierSpeciesReference
:
the removed ModifierSpeciesReference object, or NULL if the
given index is out of range.
Creates a new KineticLaw object, installs it as this Reaction's "kineticLaw" subelement, and returns it.
If this Reaction had a previous KineticLaw, it will be destroyed.
KineticLaw
:
the new KineticLaw object.
Returns the KineticLaw object contained in this Reaction.
KineticLaw
:
the KineticLaw instance.
Sets the "kineticLaw" subelement of this Reaction to a copy of the given KineticLaw object.
(KineticLaw)
the KineticLaw object to use
Unsets the "kineticLaw" subelement of this Reaction.
Unsets the value of the "reversible" attribute of this Reaction.
Unsets the value of the "compartment" attribute of this Reaction.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Returns the nth plug-in object (extension interface) for an SBML Level 3 package extension.
If no such plugin exists, NULL is returned.
Note: To get a plugin corresponding to a given id, use the findPlugin method. Calling Model.findPlugin("fbc") will return an FbcModelPlugin; calling Parameter.findPlugin("comp") will return CompSBasePlugin, etc. However, these instances must be cast to the derived type using castObject
(number)
the index of the plug-in to return
SBasePlugin
:
the nth plug-in object (the libSBML extension interface) of a
package extension.
If the index n is invalid, NULL is returned.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
A compartment in SBML represents a bounded space in which species are located. Compartments do not necessarily have to correspond to actual structures inside or outside of a biological cell.
It is important to note that although compartments are optional in the overall definition of Model, every species in an SBML model must be located in a compartment. This in turn means that if a model defines any species, the model must also define at least one compartment. The reason is simply that species represent physical things, and therefore must exist somewhere. Compartments represent the somewhere.
Compartment has one required attribute, "id", to give the compartment a unique identifier by which other parts of an SBML model definition can refer to it. A compartment can also have an optional "name" attribute of type string. Identifiers and names must be used according to the guidelines described in the SBML specifications.
Compartment also has an optional attribute "spatialDimensions" that is used to indicate the number of spatial dimensions possessed by the compartment. Most modeling scenarios involve compartments with integer values of "spatialDimensions" of 3 (i.e., a three-dimensional compartment, which is to say, a volume), or 2 (a two-dimensional compartment, a surface), or 1 (a one-dimensional compartment, a line). In SBML Level 3, the type of this attribute is double, there are no restrictions on the permitted values of the "spatialDimensions" attribute, and there are no default values. In SBML Level 2, the value must be a positive integer, and the default value is 3; the permissible values in SBML Level 2 are 3, 2, 1, and 0 (for a point).
Another optional attribute on Compartment is "size", representing the initial total size of that compartment in the model. The "size" attribute must be a floating-point value and may represent a volume (if the compartment is a three-dimensional one), or an area (if the compartment is two-dimensional), or a length (if the compartment is one-dimensional). There is no default value of compartment size in SBML Level 2 or Level 3. In particular, a missing "size" value does not imply that the compartment size is 1. (This is unlike the definition of compartment "volume" in SBML Level 1.) When the compartment's "spatialDimensions" attribute does not have a value of 0, a missing value of "size" for a given compartment signifies that the value either is unknown, or to be obtained from an external source, or determined by an InitialAssignment, AssignmentRule, AlgebraicRule or RateRule object elsewhere in the model. In SBML Level 2, there are additional special requirements on the values of "size"; we discuss them in a separate section below.
The units associated with a compartment's "size" attribute value may be set using the optional attribute "units". The rules for setting and using compartment size units differ between SBML Level 2 and Level 3, and are discussed separately below.
Finally, the Compartment attribute named "constant" is used to indicate whether the compartment's size stays constant after simulation begins. A value of true indicates the compartment's "size" cannot be changed by any other construct except InitialAssignment; a value of false indicates the compartment's "size" can be changed by other constructs in SBML. In SBML Level 2, there is an additional explicit restriction that if "spatialDimensions"="0", the value cannot be changed by InitialAssignment either. Further, in Level 2, "constant" is optional, and has a default value of true. In SBML Level 3, there is no default value for the "constant" attribute, and it is required.
In SBML Level 2, the default units of compartment size, and the kinds of units allowed as values of the attribute "units", interact with the number of spatial dimensions of the compartment. The value of the "units" attribute of a Compartment object must be one of the base units (see Unit), or the predefined unit identifiers volume, area, length or dimensionless, or a new unit defined by a UnitDefinition objectin the enclosing Model, subject to the restrictions detailed in the following table:
Value of spatialDimensions |
size allowed? |
units allowed? |
Allowable kinds of units | Default value of attribute units |
---|---|---|---|---|
3 | yes | yes | units of volume, or dimensionless | volume |
2 | yes | yes | units of area, or dimensionless | area |
1 | yes | yes | units of length, or dimensionless | length |
0 | no | no | (no units allowed) |
In SBML Level 2, the units of the compartment size, as defined by the "units" attribute or (if "units" is not set) the default value listed in the table above, are used in the following ways when the compartment has a "spatialDimensions" value greater than 0:
The value of the "units" attribute is used as the units of the compartment identifier when the identifier appears as a numerical quantity in a mathematical formula expressed in MathML.
The math element of an AssignmentRule or InitialAssignment referring to this compartment must (in Level 2 Versions 1-3) or should (in Level 2 Version 4) have identical units.
In RateRule objects that set the rate of change of the compartment's size, the units of the rule's math element must (in Level 2 Versions 1–3) or should (in Level 2 Version 4) be identical to the compartment's units (whether defined by the "units" attribute or by taking the default value from the Model) divided by the default time units. (In other words, the units for the rate of change of compartment size are compartment size/time units.
When a Species is to be treated in terms of concentrations or density, the units of the spatial size portion of the concentration value (i.e., the denominator in the units formula substance/ size) are those indicated by the value of the "units" attribute on the compartment in which the species is located.
Compartments with "spatialDimensions"=0 require special treatment in this framework. As implied above, the "size" attribute must not have a value on an SBML Level 2 Compartment objectif the "spatialDimensions" attribute has a value of 0. An additional related restriction is that the "constant" attribute must default to or be set to true if the value of the "spatialDimensions" attribute is 0, because a zero-dimensional compartment cannot ever have a size.
If a compartment has no size or dimensional units, how should such a compartment's identifier be interpreted when it appears in mathematical formulas? The answer is that such a compartment's identifier should not appear in mathematical formulas in the first place---it has no value, and its value cannot change. Note also that a zero-dimensional compartment is a point, and species located at points can only be described in terms of amounts, not spatially-dependent measures such as concentration. Since SBML KineticLaw formulas are already in terms of substance/time and not (say) concentration/time, volume or other factors in principle are not needed for species located in zero-dimensional compartments.
Finally, in SBML Level 2 Versions 2–4, each compartment in a model may optionally be designated as belonging to a particular compartment type. The optional attribute "compartmentType" is used identify the compartment type represented by the Compartment structure. The "compartmentType" attribute's value must be the identifier of a CompartmentType instance defined in the model. If the "compartmentType" attribute is not present on a particular compartment definition, a unique virtual compartment type is assumed for that compartment, and no other compartment can belong to that compartment type. The values of "compartmentType" attributes on compartments have no effect on the numerical interpretation of a model. Simulators and other numerical analysis software may ignore "compartmentType" attributes. The "compartmentType" attribute and the CompartmentType class of objects are not present in SBML Level 3 Core nor in SBML Level 1.
One difference between SBML Level 3 and lower Levels of SBML is that there are no restrictions on the permissible values of the "spatialDimensions" attribute, and there is no default value defined for the attribute. The value of "spatialDimensions" does not have to be an integer, either; this is to allow for the possibility of representing structures with fractal dimensions.
The number of spatial dimensions possessed by a compartment cannot enter into mathematical formulas, and therefore cannot directly alter the numerical interpretation of a model. However, the value of "spatialDimensions" does affect the interpretation of the units associated with a compartment's size. Specifically, the value of "spatialDimensions" is used to select among the Model attributes "volumeUnits", "areaUnits" and "lengthUnits" when a Compartment object does not define a value for its "units" attribute.
The "units" attribute may be left unspecified for a given compartment in a model; in that case, the compartment inherits the unit of measurement specified by one of the attributes on the enclosing Model objectinstance. The applicable attribute on Model depends on the value of the compartment's "spatialDimensions" attribute; the relationship is shown in the table below. If the Model objectdoes not define the relevant attribute ("volumeUnits", "areaUnits" or "lengthUnits") for a given "spatialDimensions" value, the unit associated with that Compartment object's size is undefined. If a given Compartment's "units" are left unset and the "spatialDimensions" either has a value other than 1, 2, or 3 or is left unset itself (as it has no default value), then no unit can be chosen from among the Model's "volumeUnits", "areaUnits" or "lengthUnits" attributes (even if the Model instance provides values for those attributes), because there is no basis to select between them. Leaving the units of compartments' sizes undefined in an SBML model does not render the model invalid; however, as a matter of best practice, we strongly recommend that all models specify the units of measurement for all compartment sizes.
Value of attribute "spatialDimensions" |
Attribute of Model used for inheriting the unit |
Recommended candidate units |
---|---|---|
3 | "volumeUnits" | units of volume, or dimensionless |
2 | "areaUnits" | units of area, or dimensionless |
1 | "lengthUnits" | units of length, or dimensionless |
other | no units inherited | no specific recommendations |
The unit of measurement associated with a compartment's size, as defined by the "units" attribute or (if "units" is not set) the inherited value from Model according to the table above, is used in the following ways:
When the identifier of the compartment appears as a numerical quantity in a mathematical formula expressed in MathML, it represents the size of the compartment, and the unit associated with the size is the value of the "units" attribute.
When a Species is to be treated in terms of concentrations or density, the unit associated with the spatial size portion of the concentration value (i.e., the denominator in the formula amount/size) is specified by the value of the "units" attribute on the compartment in which the species is located.
The "math" elements of AssignmentRule, InitialAssignment and EventAssignment objects setting the value of the compartment size should all have the same units as the unit associated with the compartment's size.
In a RateRule objectthat defines a rate of change for a compartment's size, the unit of the rule's "math" element should be identical to the compartment's "units" attribute divided by the model-wide unit of time. (In other words, {unit of compartment size}/{unit of time}.)
In SBML Level 1 and Level 2, Compartment has an optional attribute named "outside", whose value can be the identifier of another Compartment objectdefined in the enclosing Model object. Doing so means that the other compartment contains it or is outside of it. This enables the representation of simple topological relationships between compartments, for those simulation systems that can make use of the information (e.g., for drawing simple diagrams of compartments). It is worth noting that in SBML, there is no relationship between compartment sizes when compartment positioning is expressed using the "outside" attribute. The size of a given compartment does not in any sense include the sizes of other compartments having it as the value of their "outside" attributes. In other words, if a compartment B has the identifier of compartment A as its "outside" attribute value, the size of A does not include the size of B. The compartment sizes are separate.
In Level 2, there are two restrictions on the "outside" attribute. First, because a compartment with "spatialDimensions" of 0 has no size, such a compartment cannot act as the container of any other compartment except compartments that also have "spatialDimensions" values of 0. Second, the directed graph formed by representing Compartment structures as vertexes and the "outside" attribute values as edges must be acyclic. The latter condition is imposed to prevent a compartment from being contained inside itself. In the absence of a value for "outside", compartment definitions in SBML Level 2 do not have any implied spatial relationships between each other.
Get the value of the "constant" attribute of this Compartment object.
any
:
true if this Compartment object's size is flagged as being
constant, false otherwise.
Sets the value of the "constant" attribute of this Compartment object.
(any)
a boolean indicating whether the size/volume of this
compartment should be considered constant (true) or variable
(false).
Get the size of this Compartment object.
number
:
the value of the "size" attribute ("volume" in Level 1) of
this Compartment object as a floating-point number.
Note: This method is identical to Compartment#getVolume
Sets the "size" attribute (or "volume" in SBML Level 1) of this Compartment object.
(any)
a double representing the size of this compartment
instance in whatever units are in effect for the compartment.
Note: This method is identical to Compartment#setVolume.
Predicate returning true if this Compartment object's "size" attribute is set.
This method is similar but not identical to Compartment#isSetVolume. The latter should be used in the context of SBML Level 1 models instead of isSetSize because isSetVolume performs extra processing to take into account the difference in default values between SBML Levels 1 and 2.
boolean
:
true if the "size" attribute ("volume" in Level 2) of
this Compartment object is set, false otherwise.
Get the volume of this Compartment object.
number
:
the value of the "volume" attribute ("size" in Level 2) of
this Compartment object, as a floating-point number.
Note: This method is identical to Compartment#getSize
Sets the "volume" attribute (or "size" in SBML Level 2) of this Compartment object.
This method is identical to Compartment#setSize and is provided for compatibility between SBML Level 1 and higher Levels of SBML.
(number)
a double representing the volume of this compartment
instance in whatever units are in effect for the compartment
Predicate returning true if this Compartment object's "volume" attribute is set.
This method is similar but not identical to Compartment#isSetSize. The latter should not be used in the context of SBML Level 1 models because the present method performs extra processing to take into account the difference in default values between SBML Levels 1 and 2.
boolean
:
true if the "volume" attribute ("size" in Level 2 and
above) of this Compartment object is set, false otherwise.
Get the units of this Compartment object's size.
The value of an SBML compartment's "units" attribute establishes the unit of measurement associated with the compartment's size.
string
:
the value of the "units" attribute of this Compartment object,
as a string. An empty string indicates that no units have been assigned
to the value of the size.
Initializes the fields of this Compartment object to "typical" defaults values.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Returns the nth plug-in object (extension interface) for an SBML Level 3 package extension.
If no such plugin exists, NULL is returned.
Note: To get a plugin corresponding to a given id, use the findPlugin method. Calling Model.findPlugin("fbc") will return an FbcModelPlugin; calling Parameter.findPlugin("comp") will return CompSBasePlugin, etc. However, these instances must be cast to the derived type using castObject
(number)
the index of the plug-in to return
SBasePlugin
:
the nth plug-in object (the libSBML extension interface) of a
package extension.
If the index n is invalid, NULL is returned.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
A Parameter is used in SBML to define a symbol associated with a value; this symbol can then be used in mathematical formulas in a model. By default, parameters have constant value for the duration of a simulation, and for this reason are called parameters instead of variables in SBML, although it is crucial to understand that SBML parameters represent both concepts. Whether a given SBML parameter is intended to be constant or variable is indicated by the value of its "constant" attribute.
SBML's Parameter has a required attribute, "id", that gives the parameter a unique identifier by which other parts of an SBML model definition can refer to it. A parameter can also have an optional "name" attribute of type string. Identifiers and names must be used according to the guidelines described in the SBML specifications.
The optional attribute "value" determines the value (of type double) assigned to the parameter. A missing value for "value" implies that the value either is unknown, or to be obtained from an external source, or determined by an initial assignment. The unit of measurement associated with the value of the parameter can be specified using the optional attribute "units". Here we only mention briefly some notable points about the possible unit choices, but readers are urged to consult the SBML specification documents for more information:
In SBML Level 3, there are no constraints on the units that can be assigned to parameters in a model; there are also no units to inherit from the enclosing Model object (unlike the case for, e.g., Species and Compartment).
In SBML Level 2, the value assigned to the parameter's "units" attribute must be chosen from one of the following possibilities: one of the base unit identifiers defined in SBML; one of the built-in unit identifiers "substance", "time", "volume", "area" or "length"; or the identifier of a new unit defined in the list of unit definitions in the enclosing Model structure. There are no constraints on the units that can be chosen from these sets. There are no default units for parameters.
The Parameter structure has another boolean attribute named "constant" that is used to indicate whether the parameter's value can vary during a simulation. (In SBML Level 3, the attribute is mandatory and must be given a value; in SBML Levels below Level 3, the attribute is optional.) A value of true indicates the parameter's value cannot be changed by any construct except InitialAssignment. Conversely, if the value of "constant" is false, other constructs in SBML, such as rules and events, can change the value of the parameter.
SBML Level 3 uses a separate object class, LocalParameter, for parameters that are local to a Reaction's KineticLaw. In Levels prior to SBML Level 3, the Parameter class is used both for definitions of global parameters, as well as reaction-local parameters stored in a list within KineticLaw objects. Parameter objects that are local to a reaction (that is, those defined within the KineticLaw structure of a Reaction) cannot be changed by rules and therefore are implicitly always constant; consequently, in SBML Level 2, parameter definitions within Reaction structures should not have their "constant" attribute set to false.
What if a global parameter has its "constant" attribute set to false, but the model does not contain any rules, events or other constructs that ever change its value over time? Although the model may be suspect, this situation is not strictly an error. A value of false for "constant" only indicates that a parameter can change value, not that it must.
As with all other major SBML components, Parameter is derived from SBase, and the methods defined on SBase are available on Parameter.
Note: The use of the term parameter in SBML sometimes leads to confusion among readers who have a particular notion of what something called "parameter" should be. It has been the source of heated debate, but despite this, no one has yet found an adequate replacement term that does not have different connotations to different people and hence leads to confusion among some subset of users. Perhaps it would have been better to have two constructs, one called constants and the other called variables. The current approach in SBML is simply more parsimonious, using a single Parameter construct with the boolean flag "constant" indicating which flavor it is. In any case, readers are implored to look past their particular definition of a parameter and simply view SBML's Parameter as a single mechanism for defining both constants and (additional) variables in a model. (We write additional because the species in a model are usually considered to be the central variables.) After all, software tools are not required to expose to users the actual names of particular SBML constructs, and thus tools can present to their users whatever terms their designers feel best matches their target audience.
In SBML Level 3 Version 2, many restrictions were lifted requiring only Boolean values in Boolean contexts, and numeric values in numeric contexts. This means that a Parameter may now be used as a Boolean, despite canonically having a numeric value. To be consistent, one should always assign it a value of true or false, and use it in Boolean contexts exclusively. It would be appropriate to give it an SBO value of 602 ('Logical parameter') if one chooses to do this.
Gets the numerical value of this Parameter.
number
:
the value of the "value" attribute of this Parameter, as a
number of type double.
Note: It is crucial that callers not blindly call Parameter.getValue() without first using Parameter.isSetValue() to determine whether a value has ever been set. Otherwise, the value return by Parameter::getValue() may not actually represent a value assigned to the parameter. The reason is simply that the data type double in a program always has some value. A separate test is needed to determine whether the value is a true model value, or uninitialized data in a computer's memory location.
Predicate returning true if the "value" attribute of this Parameter is set.
In SBML definitions after SBML Level 1 Version 1, parameter values are optional and have no defaults. If a model read from a file does not contain a setting for the "value" attribute of a parameter, its value is considered unset; it does not default to any particular value. Similarly, when a Parameter object is created in libSBML, it has no value until given a value. The Parameter::isSetValue() method allows calling applications to determine whether a given parameter's value has ever been set.
In SBML Level 1 Version 1, parameters are required to have values and therefore, the value of a Parameter should always be set. In Level 1 Version 2 and beyond, the value is optional and as such, the "value" attribute may or may not be set.
boolean
:
true if the value of this Parameter is set,
false otherwise.
Gets the units defined for this Parameter.
The value of an SBML parameter's "units" attribute establishes the unit of measurement associated with the parameter's value.
string
:
the value of the "units" attribute of this Parameter, as a
string. An empty string indicates that no units have been assigned.
Initializes the fields of this Parameter object to "typical" defaults values.
The SBML Parameter component has slightly different aspects and default attribute values in different SBML Levels and Versions. Many SBML object classes defined by libSBML have an initDefaults() method to set the values to certain common defaults, based mostly on what they are in SBML Level 2. In the case of Parameter, this method only sets the value of the "constant" attribute to true.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Returns the nth plug-in object (extension interface) for an SBML Level 3 package extension.
If no such plugin exists, NULL is returned.
Note: To get a plugin corresponding to a given id, use the findPlugin method. Calling Model.findPlugin("fbc") will return an FbcModelPlugin; calling Parameter.findPlugin("comp") will return CompSBasePlugin, etc. However, these instances must be cast to the derived type using castObject
(number)
the index of the plug-in to return
SBasePlugin
:
the nth plug-in object (the libSBML extension interface) of a
package extension.
If the index n is invalid, NULL is returned.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
LocalParameter has been introduced in SBML Level 3 to serve as the object class for parameter definitions that are intended to be local to a Reaction. Objects of class LocalParameter never appear at the Model level; they are always contained within ListOfLocalParameters lists which are in turn contained within KineticLaw objects.
Like its global Parameter counterpart, the LocalParameter object class is used to define a symbol associated with a value; this symbol can then be used in a model's mathematical formulas (and specifically, for LocalParameter, reaction rate formulas). Unlike Parameter, the LocalParameter class does not have a "constant" attribute: local parameters within reactions are always constant.
LocalParameter has one required attribute, "id", to give the parameter a unique identifier by which other parts of an SBML model definition can refer to it. A parameter can also have an optional "name" attribute of type string. Identifiers and names must be used according to the guidelines described in the SBML specifications.
The optional attribute "value" determines the value (of type double) assigned to the parameter. A missing value for "value" implies that the value either is unknown, or to be obtained from an external source, or determined by an initial assignment. The unit of measurement associated with the value of the parameter can be specified using the optional attribute "units". Here we only mention briefly some notable points about the possible unit choices, but readers are urged to consult the SBML specification documents for more information:
In SBML Level 3, there are no constraints on the units that can be assigned to parameters in a model; there are also no units to inherit from the enclosing Model object.
In SBML Level 2, the value assigned to the parameter's "units" attribute must be chosen from one of the following possibilities: one of the base unit identifiers defined in SBML; one of the built-in unit identifiers "substance", "time", "volume", "area" or "length"; or the identifier of a new unit defined in the list of unit definitions in the enclosing Model structure. There are no constraints on the units that can be chosen from these sets. There are no default units for local parameters.
As with all other major SBML components, LocalParameter is derived from SBase, and the methods defined on SBase are available on LocalParameter.
In SBML Level 3 Version 2, the scope of the LocalParameter was expanded slightly to officially encompass the entire Reaction instead of just the KineticLaw in which it appears. This has no effect on models using only SBML Level 3 Core constructs, but has the potential to allow SBML Level 3 Packages to include elements in a Reaction that could reference a LocalParameter from that Reaction's KineticLaw. It also means that no LocalParameter may have the same "id" as a referenced Species in any SimpleSpeciesReference in that Reaction.
Note: libsbml.js does not contain implementations of isSetConstant(), setConstant(), and getConstant()) for LocalParameter objects because these methods are only relevant to the parent class Parameter.
Gets the numerical value of this LocalParameter.
number
:
the value of the "value" attribute of this LocalParameter, as a
number of type double.
Note: It is crucial that callers not blindly call LocalParameter.getValue() without first using LocalParameter.isSetValue() to determine whether a value has ever been set. Otherwise, the value return by LocalParameter::getValue() may not actually represent a value assigned to the LocalParameter. The reason is simply that the data type double in a program always has some value. A separate test is needed to determine whether the value is a true model value, or uninitialized data in a computer's memory location.
Predicate returning true if the "value" attribute of this LocalParameter is set.
In SBML definitions after SBML Level 1 Version 1, LocalParameter values are optional and have no defaults. If a model read from a file does not contain a setting for the "value" attribute of a LocalParameter, its value is considered unset; it does not default to any particular value. Similarly, when a LocalParameter object is created in libSBML, it has no value until given a value. The LocalParameter::isSetValue() method allows calling applications to determine whether a given LocalParameter's value has ever been set.
In SBML Level 1 Version 1, LocalParameters are required to have values and therefore, the value of a LocalParameter should always be set. In Level 1 Version 2 and beyond, the value is optional and as such, the "value" attribute may or may not be set.
boolean
:
true if the value of this LocalParameter is set,
false otherwise.
Gets the units defined for this LocalParameter.
The value of an SBML LocalParameter's "units" attribute establishes the unit of measurement associated with the LocalParameter's value.
string
:
the value of the "units" attribute of this LocalParameter, as a
string. An empty string indicates that no units have been assigned.
Constructs and returns a UnitDefinition that corresponds to the units of this LocalParameter's value.
UnitDefinition
:
a UnitDefinition that expresses the units of this
LocalParameter, or NULL if one cannot be constructed.
Note: The libSBML system for unit analysis depends on the model as a whole. In cases where the LocalParameter object has not yet been added to a model, or the model itself is incomplete, unit analysis is not possible, and consequently this method will return NULL.
Initializes the fields of this Parameter object to "typical" defaults values.
The SBML Parameter component has slightly different aspects and default attribute values in different SBML Levels and Versions. Many SBML object classes defined by libSBML have an initDefaults() method to set the values to certain common defaults, based mostly on what they are in SBML Level 2. In the case of Parameter, this method only sets the value of the "constant" attribute to true.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Returns the nth plug-in object (extension interface) for an SBML Level 3 package extension.
If no such plugin exists, NULL is returned.
Note: To get a plugin corresponding to a given id, use the findPlugin method. Calling Model.findPlugin("fbc") will return an FbcModelPlugin; calling Parameter.findPlugin("comp") will return CompSBasePlugin, etc. However, these instances must be cast to the derived type using castObject
(number)
the index of the plug-in to return
SBasePlugin
:
the nth plug-in object (the libSBML extension interface) of a
package extension.
If the index n is invalid, NULL is returned.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
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 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 must be one of the text strings listed below; this list corresponds to SBML Level3:
A few small differences exist between the Level3 list of base units and the list defined in other Level/Version combinations of SBML. Specifically, Levels of SBML before Level3 do not define avogadro; conversely, Level2 Version1 defines Celsius, and Level1 defines celsius, meter, and liter, none of which are available in Level3. In libSBML, each of the predefined base unit names is represented by an enumeration value whose name begins with the characters UNITKIND, discussed in a separate section below.
The attribute named "exponent" on Unit represents an exponent on the unit. In SBML Level2, the attribute is optional and has a default value of 1 (one); in SBML Level3, the attribute is mandatory and there is no default value. A Unit also has an 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 gram and a "scale" value of -3 signifies 10-3 * gram, or milligrams. In SBML Level2, the attribute is optional and has a default value of 0 (zero), because 10 0 = 1; in SBML Level3, the attribute is mandatory and has no default value. Lastly, the attribute named "multiplier" can be used to multiply the 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 foot as a measure of length in terms of a metre. The "multiplier" attribute is optional in SBML Level2, where it has a default value of 1 (one); in SBML Level3, the attribute is mandatory and has no default value.
As discussed above, 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.
Until SBML Level2 Version3, there existed a data type in the SBML specifications called UnitKind, enumerating the possible SBML base units. Although SBML Level2 Version3 removed this type from the language specification, libSBML maintains the corresponding enumeration type UnitKind_t as a convenience and as a way to provide backward compatibility to previous SBML Level/Version specifications. (The removal in SBML Level2 Version3 of the enumeration UnitKind was also accompanied by the redefinition of the data type UnitSId to include the previous UnitKind values as reserved symbols in the UnitSId 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.)
As a consequence of the fact that libSBML supports models in all Levels and Versions of SBML, libSBML's set of UNITKIND values is a union of all the possible base unit names defined in the different SBML specifications. However, not every base unit is allowed in every Level+Version combination of SBML. Note in particular the following exceptions:
The alternate spelling "meter" is included in addition to the official SI spelling "metre". This spelling is only permitted in SBML Level1 models.
The alternate spelling "liter" is included in addition to the official SI spelling "litre". This spelling is only permitted in SBML Level1 models.
The unit "Celsius" is included because of its presence in specifications of SBML prior to SBML Level2 Version2.
The unit avogadro was introduced in SBML Level3, and is only permitted for use in SBML Level3 models.
Predicate to test whether a given string is the name of a built-in SBML unit, depending on the SBML level, since new predefined units were added between level 2 versions 1 and 2, and then all predefined units were removed again in SBML Level 3.
(string)
a string to be tested against the built-in unit names
(number)
the level of SBML one is checking
boolean
:
true if name is one of "substance", "volume",
or "time" and the level is 1; or if name is one of
"substance", "volume", "area", "length", or "time" and
the level is 2; false otherwise (including all values when
level is 3).
Predicate returning true if two Unit objects are identical.
Two Unit objects are considered to be identical if they match in all attributes. (Contrast this to the method areEquivalent(), which compares Unit objects only with respect to certain attributes.)
boolean
:
true if all the attributes of unit1 are identical
to the attributes of unit2, false otherwise
Predicate returning true if Unit objects are equivalent.
Two Unit objects are considered to be equivalent either if (1) both have a "kind" attribute value of dimensionless, or (2) their "kind", "exponent" and (for SBML Level 2 Version 1) "offset" attribute values are equal. (Contrast this to the method areIdentical(), which compares Unit objects with respect to all attributes, not just the "kind" and "exponent".)
boolean
:
true if the "kind" and "exponent" attributes of unit1 are
identical to the kind and exponent attributes of unit2, or if the kind
attributes of both are dimensionless; false otherwise.
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=
"metre" multiplier="1" scale="-3" exponent="1". It can also be
expressed as a Unit with kind="metre"
multiplier="0.001"
scale="0" exponent="1".
(Unit)
the Unit object to manipulate
Merges two Unit objects with the same "kind" attribute value into a single Unit.
For example, the following,
<unit kind="metre" exponent="2"/>
<unit kind="metre" exponent="1"/>
would be merged to become
<unit kind="metre" exponent="3"/>
Returns the "kind" of Unit this is.
UnitKind_t
:
the value of the "kind" attribute of this Unit as a
value from the UnitKind_t enumeration.
Sets the "kind" attribute value of this Unit.
(UnitKind_t)
a value from the UnitKind_t enumeration.
Unsets the "kind" attribute value of this Unit.
Returns the value of the "scale" attribute of this unit.
any
:
the "scale" value of this Unit, as an integer
Unsets the "multipler" attribute value of this Unit.
Initializes the fields of this Unit object to "typical" default values.
The SBML Unit component has slightly different aspects and default attribute values in different SBML Levels and Versions. This method sets the values to certain common defaults, based mostly on what they are in SBML Level 2. Specifically:
The "kind" attribute is left unchanged.
Returns the value of the "exponent" attribute of this unit.
any
:
the "exponent" value of this Unit, as an integer
Returns the value of the "exponent" attribute of this unit.
any
:
the "exponent" value of this Unit, as a double
Unsets the "exponent" attribute value of this Unit.
Returns the value of the "offset" attribute of this Unit.
any
:
the "offset" value of this Unit, as a double
Unsets the "offset" attribute value of this Unit.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Returns the nth plug-in object (extension interface) for an SBML Level 3 package extension.
If no such plugin exists, NULL is returned.
Note: To get a plugin corresponding to a given id, use the findPlugin method. Calling Model.findPlugin("fbc") will return an FbcModelPlugin; calling Parameter.findPlugin("comp") will return CompSBasePlugin, etc. However, these instances must be cast to the derived type using castObject
(number)
the index of the plug-in to return
SBasePlugin
:
the nth plug-in object (the libSBML extension interface) of a
package extension.
If the index n is invalid, NULL is returned.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
Units of measurement may be supplied in a number of contexts in an SBML model. 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.
Two points are worth discussing in the context of SBML units. First, unit declarations in SBML models are optional. The consequence of this is that a model must be numerically self-consistent independently of unit declarations, for the benefit of software tools that cannot interpret or manipulate units. Unit declarations in SBML are thus more akin to a type of annotation; they can indicate intentions, and can be used by model readers for checking the consistency of the model, labeling simulation output, etc., but any transformations of values implied by different units must be incorporated explicitly into a model.
Second, the vast majority of situations that require new SBML unit definitions involve simple multiplicative combinations of base units and factors. An example is moles per litre per second. What distinguishes these sorts of unit definitions from more complex ones is that they may be expressed without the use of an additive offset from a zero point. The use of offsets complicates all unit definition systems, yet in the domain of SBML, the real-life cases requiring offsets are few (and in fact, to the best of our knowledge, only involve temperature). Consequently, the SBML unit system has been consciously designed to simplify implementation of unit support for the most common cases in systems biology. The cost of this simplification is to require units with offsets to be handled explicitly by the modeler.
UnitDefinition 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. Please see the next section for information about the values permitted for "id".
A UnitDefinition may contain exactly one ListOfUnits, and this list may contain one or more Unit definitions; see the definitions of these other object classes for more information about them. In SBML Level 2 and SBML Level 3 Version 1, if the ListOfUnits was present, it must have one or more Unit definitions. In SBML Level 3 Version 2, this restriction was relaxed, and a ListOfUnits was allowed to be empty. In either case, if a UnitDefinition had no child Unit elements, the unit was considered to be undefined.
The following example illustrates a complete unit definition (when written in XML) when all the pieces are combined together. This defines "mmls" to be millimoles per litre per second.
<listOfUnitDefinitions>
<unitDefinition id="mmls">
<listOfUnits>
<unit kind="mole" scale="-3"/>
<unit kind="litre" exponent="-1"/>
<unit kind="second" exponent="-1"/>
</listOfUnits>
</unitDefinition>
</listOfUnitDefinitions>
The attribute "id" in UnitDefinition cannot be given simply any value, and the precise details of the values permitted differ slightly between Levels of SBML:
This list of predefined base units is nearly identical in SBML Level 2 Version 4, the exception being that Level 2 does not define avogadro. SBML Level 2 Version 1 (and only this Level+Version combination) provides an additional predefined unit name, Celsius, not available in Level 3. Finally, SBML Level 1 Versions 2–3 provide two more additional predefined unit names, meter and liter. This is explained in somewhat greater detail in the description of the Unit class.
Also, SBML Level 2 imposes two limitations on redefining the predefined unit substance, volume, area, length, and time: (1) The UnitDefinition of a predefined SBML unit can only contain a single Unit object within it. (2) The value of the "kind" attribute in a Unit instance must be drawn from one of the values in the second column of the table above.
The special unit names substance, volume, area, length, and time are not defined by SBML Level 3, which uses a different approach to setting model-wide inherited units.
The vast majority of modeling situations requiring new SBML unit definitions involve simple multiplicative combinations of base units and factors. An example of this might be moles per litre per second. What distinguishes these sorts of simpler unit definitions from more complex ones is that they may be expressed without the use of an additive offset from a zero point. The use of offsets complicates all unit definition systems, yet in the domain of SBML the real-life cases requiring offsets are few (and in fact, to the best of our knowledge, only involve temperature). Consequently, the SBML unit system has been consciously designed in a way that attempts to simplify implementation of unit support for the most common cases in systems biology.
As of SBML Level 2 Version 2, Unit no longer has the attribute called "offset" introduced in SBML Level 2 Version 1. It turned out that the general case involving units with offsets was incorrectly defined, and few (if any) developers even attempted to support offset-based units in their software. In the development of Level 2 Version 2, a consensus among SBML developers emerged that a fully generalized unit scheme is so confusing and complicated that it actually impedes interoperability. SBML Level 2 Version 2, Version 3 and Version 4 acknowledge this reality by reducing and simplifying the unit system, specifically by removing the "offset" attribute on Unit and Celsius as a pre-defined unit.
The following guidelines suggest methods for handling units that do require the use of zero offsets for their definitions:
Handling Celsius. A model in which certain quantities are temperatures measured in degrees Celsius can be converted straightforwardly to a model in which those temperatures are in kelvin. A software tool could do this by performing a straightforward substitution using the following relationship: T kelvin = TCelsius + 273.15. In every mathematical formula of the model where a quantity (call it x) in degrees Celsius appears, replace x with xk+ 273.15, where xk is now in kelvin. An alternative approach would be to use a FunctionDefinition object to define a function encapsulating this relationship above and then using that in the rest of the model as needed. Since Celsius is a commonly-used unit, software tools could help users by providing users with the ability to express temperatures in Celsius in the tools' interfaces, and making substitutions automatically when writing out the SBML.
Other units requiring offsets. One approach to handling other kinds of units is to use a FunctionDefinition to define a function encapsulating the necessary mathematical relationship, then substituting a call to this function wherever the original quantity appeared in the model. For example, here is a possible definition for converting Fahrenheit to Celsius degrees:
<functionDefinition id="Fahrenheit_to_kelvin">
<math xmlns="http://www.w3.org/1998/Math/MathML">
<lambda>
<bvar><ci> temp_in_fahrenheit </ci></bvar>
<apply>
<divide/>
<apply>
<plus/>
<ci> temp_in_fahrenheit </ci>
<cn> 459.67 </cn>
</apply>
<cn> 1.8 </cn>
</apply>
</lambda>
</math>
</functionDefinition>
An alternative approach not requiring the use of function definitions is to use an AssignmentRule for each variable in Fahrenheit units. The AssignmentRule could compute the conversion from Fahrenheit to (say) kelvin, assign its value to a variable (in Kelvin units), and then that variable could be used elsewhere in the model.
Still another approach is to rewrite the mathematical formulas of a model to directly incorporate the conversion formula wherever the original quantity appeared.
Please consult the SBML specifications for more information about this and other issues involving units.
Creates a new and empty Unit, adds it to this UnitDefinition's list of units, and returns it.
Unit
:
a newly constructed (and empty) Unit instance
Note: It is worth emphasizing that the attribute "kind" value of a Unit is a required attribute for a valid Unit definition. The createUnit() method does not assign a valid kind to the constructed unit (instead, it sets the "kind" to UNIT_KIND_INVALID). Callers are cautioned to set the newly-constructed Unit's kind using Unit::setKind() soon after calling this method.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Returns the nth plug-in object (extension interface) for an SBML Level 3 package extension.
If no such plugin exists, NULL is returned.
Note: To get a plugin corresponding to a given id, use the findPlugin method. Calling Model.findPlugin("fbc") will return an FbcModelPlugin; calling Parameter.findPlugin("comp") will return CompSBasePlugin, etc. However, these instances must be cast to the derived type using castObject
(number)
the index of the plug-in to return
SBasePlugin
:
the nth plug-in object (the libSBML extension interface) of a
package extension.
If the index n is invalid, NULL is returned.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
Normally one would call the libSBML global function UnitKind_forName to get the UnitKind_t value for a string, but global functions are not available in this wrapper. Instead this helper class can be used.
See the libSBML C++ docs for UnitKind_forName.
new libsbml.UnitKindConstructor().fromName('mole') // returns libsbml.UNIT_KIND_MOLE
Converts a text string naming a kind of unit to its corresponding
libSBML UNITKIND
constant/enumeration value.
(string)
the name of a predefined base unit in SBML.
UnitKind_t
:
a value from UnitKind_t corresponding to the given
string name (determined in a case-insensitive manner).
Note: For more information about the libSBML unit codes, please refer to the class documentation for Unit.
Base class for extensions that plug into AST classes.
Abstract Syntax Trees (ASTs) are a simple kind of data structure used in libSBML for storing mathematical expressions. The ASTNode is the cornerstone of libSBML's AST representation. An AST "node" represents the most basic, indivisible part of a mathematical formula and come in many types. For instance, there are node types to represent numbers (with subtypes to distinguish integer, real, and rational numbers), names (e.g., constants or variables), simple mathematical operators, logical or relational operators and functions. LibSBML ASTs provide a canonical, in-memory representation for all mathematical formulas regardless of their original format (which might be MathML or might be text strings).
The ASTNodeType_t type contains all permitted AST nodes.
The text-string form of mathematical formulas handled by SBMLFormulaParser#parseL3Formula are in a simple C-inspired infix notation. A formula in this text-string form can be handed to a program that understands SBML mathematical expressions, or used as part of a translation system.
The formula strings may contain operators, function calls, symbols, and white space characters. The allowable white space characters are tab and space. The following are illustrative examples of formulas expressed in the syntax:
0.10 * k4^2
(vm * s1)/(km + s1)
The libSBML documentation shows the precedence rules in this syntax.
A program parsing a formula in an SBML model should assume that names appearing in the formula are the identifiers of Species, Parameter, Compartment, FunctionDefinition, Reaction (in SBML Levels 2 and 3), or SpeciesReference (in SBML Level 3 only) objects defined in a model. When a function call is involved, the syntax consists of a function identifier, followed by optional white space, followed by an opening parenthesis, followed by a sequence of zero or more arguments separated by commas (with each comma optionally preceded and/or followed by zero or more white space characters), followed by a closing parenthesis. There is an almost one-to-one mapping between the list of predefined functions available, and those defined in MathML. All of the MathML functions are recognized; this set is larger than the functions defined in SBML Level 1. In the subset of functions that overlap between MathML and SBML Level 1, there exist a few differences.
For constructing ASTs use SBMLFormulaParser.parseL3Formula.
Creates a new ASTNode.
Unless the argument @p type is given, the returned node will by default have a type of libsbml.AST_UNKNOWN. If the type isn't supplied when caling this constructor, the caller should set the node type to something else as soon as possible using ASTNode#setType.
(ASTNodeType_t)
an optional
code indicating the type of node to create.
Gets the type of this ASTNode. The value returned is one of the enumeration values such as AST_LAMBDA, AST_PLUS, etc.
ASTNodeType_t
:
the type of this ASTNode
Gets the mantissa value of this node. This function should be called only when @if clike getType()@else ASTNode::getType()@endif@~ returns AST_REAL_E or AST_REAL. If @if clike getType()@else ASTNode::getType()@endif@~ returns AST_REAL, this method is identical to
number
:
the value of the mantissa of this ASTNode.
Returns the numerical value of this ASTNode.
any
:
the numerical value of this ASTNode, or NaN if this
is not a type of node that has a numerical value.
Note: This function will return a numerical value (as a double) for any ASTNode_t that represents a number, a constant such as AST_CONSTANT_PI, AST_CONSTANT_E, or AST_NAME_AVOGADRO, or 1 for nodes of type AST_CONSTANT_TRUE and 0 for nodes of type AST_CONSTANT_FALSE. It does not evaluate the node in any way so, for example, it will not return the value of a named ASTNode_t or attempt to evaluate a function. This includes a node representing time i.e. nodes of type AST_NAME_TIME.
Returns true (non-zero) if this node returns a boolean type or false (zero) otherwise.
This function looks at the whole ASTNode rather than just the top level of the ASTNode. Thus it will consider return values from piecewise statements. In addition, if this ASTNode uses a function call, the return value of the functionDefinition will be determined. Note that this is only possible where the ASTNode can trace its parent Model, that is, the ASTNode must represent the math element of some SBML object that has already been added to an instance of an SBMLDocument.
boolean
:
true if this ASTNode returns a boolean, false otherwise
Returns true (non-zero) if this node represents a log10 function, false (zero) otherwise. More precisely, this predicate returns true if the node type is AST_FUNCTION_LOG with two children, the first of which is an AST_INTEGER equal to 10.
boolean
:
true if the given ASTNode represents a log10() function,
false otherwise
Returns true (non-zero) if this node is a user-defined variable name in SBML L1, L2 (MathML), or the special symbols time or avogadro. The predicate returns false (zero) otherwise.
boolean
:
true if this ASTNode is a user-defined variable name in SBML
L1, L2 (MathML) or the special symbols delay or time.
Returns true (non-zero) if this node can represent a real number, false (zero) otherwise.
More precisely, this node must be of one of the following types: AST_REAL, AST_REAL_E or AST_RATIONAL.
boolean
:
true if the value of this ASTNode can represented as a real
number, false otherwise
Returns true (non-zero) if this node represents a square root function, false (zero) otherwise.
More precisely, the node type must be AST_FUNCTION_ROOT with two children, the first of which is an AST_INTEGER node having value equal to 2.
boolean
:
true if the given ASTNode represents a sqrt() function,
false otherwise
Returns true (non-zero) if this node is a unary minus operator, false (zero) otherwise.
A node is defined as a unary minus node if it is of type AST_MINUS and has exactly one child.
For numbers, unary minus nodes can be "collapsed" by negating the number.
boolean
:
true if this ASTNode is a unary minus, false otherwise
Returns true (non-zero) if this node has the attribute
sbml:units
.
any
:
true if this ASTNode has units associated with it, false otherwise
Note: The sbml:units
attribute is only available in SBML
Level 3. It may not be used in Levels 1-2 of SBML.
Gets the units of this ASTNode.
any
:
the units of this ASTNode
Note: The sbml:units
attribute is only available in SBML
Level 3. It may not be used in Levels 1-2 of SBML.
Sets the units of this ASTNode to units.
The units will be set @em only if this ASTNode object represents a
MathML <cn>
element, i.e., represents a number.
Callers may use isNumber()
to inquire whether the node is of that type.
(string)
a string representing the unit identifier
Note: The sbml:units
attribute is only available in SBML
Level 3. It may not be used in Levels 1-2 of SBML.
Sets the value of this ASTNode to the given name.
As a side-effect, this ASTNode object's type will be reset to
AST_NAME if (and only
if) the ASTNode was previously an operator (isOperator()== true
),
number (isNumber()== true
), or unknown.
This allows names to be set for AST_FUNCTION nodes and the like.
(string)
the string containing the name to which this node's value
should be set
Returns the nth plug-in object (extension interface) for an SBML Level 3 package extension.
(number)
the index of the plug-in to return.
ASTBasePlugin
:
the plug-in object (the libSBML extension interface) of
a package extension with the given package name or URI.
Gets the class of this ASTNode.
DOMString
:
the MathML class of this ASTNode.
Returns true or false depending on whether this ASTNode is well-formed.
Note: An ASTNode may be well-formed, with each node and its children having the appropriate number of children for the given type, but may still be invalid in the context of its use within an SBML model.
boolean
:
true if this ASTNode is well-formed, false otherwise.
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 string. 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 "math" subelement containing a MathML expression defining the function body. In SBML Level 2 and SBML Level 3 Version 1, that "math" subelement is required; in SBML Level 3 Version 2, this restriction was relaxed, making the "math" subelement optional. 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 except "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 follow 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 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. In SBML Level 2, this restriction applies also to the MathML csymbol elements for time and delay; in SBML Level 3, it additionally applies to the csymbol element for avogadro.
In SBML Level 3 Version 2, if no math element is present in the FunctionDefinition, the function has no mathematical meaning defined in SBML Level 3 Core. This situation may arise when models are incomplete, or when additional meanings are provided by an SBML Level 3 package.
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.
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.)
Get the n
th argument to this function.
Callers should first find out the number of arguments to the function by calling getNumArguments().
(number)
an integer index for the argument sought.
ASTNode
:
the nth argument (bound variable) passed to this
FunctionDefinition.
If the index n is invalid, NULL is returned.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Returns the nth plug-in object (extension interface) for an SBML Level 3 package extension.
If no such plugin exists, NULL is returned.
Note: To get a plugin corresponding to a given id, use the findPlugin method. Calling Model.findPlugin("fbc") will return an FbcModelPlugin; calling Parameter.findPlugin("comp") will return CompSBasePlugin, etc. However, these instances must be cast to the derived type using castObject
(number)
the index of the plug-in to return
SBasePlugin
:
the nth plug-in object (the libSBML extension interface) of a
package extension.
If the index n is invalid, NULL is returned.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
An Event object defines when the event can occur, the variables that are affected by the event, and how the variables are affected. The effect of the event can optionally be delayed after the occurrence of the condition which invokes it. An event delay is defined using an object of class Delay.
The object class Delay is derived from SBase and adds a single subelement called "math". This subelement is used to hold MathML content. The mathematical formula represented by "math" must evaluate to a numerical value. It is used as the length of time between when the event is triggered and when the event's assignments are actually executed. If no delay is present on a given Event, a time delay of zero is assumed.
The expression in "math" must be evaluated at the time the event is triggered. The expression must always evaluate to a nonnegative number (otherwise, a nonsensical situation could arise where an event is defined to execute before it is triggered!).
In SBML Level 2 versions before Version 4, the units of the numerical value computed by the Delay's "math" expression are required to be in units of time, or the model is considered to have a unit consistency error. In Level 2 Version 4 as well as SBML Level 3, this requirement is relaxed; these specifications only stipulate that the units of the numerical value computed by a Delay instance's "math" expression should match the model's units of time (meaning the definition of the time units in the model). LibSBML respects these requirements, and depending on whether an earlier Version of SBML Level 2 is in use, libSBML may or may not flag unit inconsistencies as errors or merely warnings.
Note that units are not predefined or assumed for the contents of "math" in a Delay object; rather, they must be defined explicitly for each instance of a Delay object in a model. This is an important point to bear in mind when literal numbers are used in delay expressions. For example, the following Event instance would result in a warning logged by SBMLDocument::checkConsistency() about the fact that libSBML cannot verify the consistency of the units of the expression. The reason is that the formula inside the "math" element does not have any declared units, whereas what is expected in this context is units of time:
<model>
...
<listOfEvents>
<event useValuesFromTriggerTime="true">
...
<delay>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<cn> 1 </cn>
</math>
</delay>
...
</event>
</listOfEvents>
...
</model>
The <cn> 1 </cn>
within the mathematical formula
of the delay above has no units declared. To make the
expression have the needed units of time, literal numbers should be
avoided in favor of defining Parameter objects for each quantity, and
declaring units for the Parameter values. The following fragment of
SBML illustrates this approach:
<model>
...
<listOfParameters>
<parameter id="transcriptionDelay" value="10" units="second"/>
</listOfParameters>
...
<listOfEvents>
<event useValuesFromTriggerTime="true">
...
<delay>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<ci> transcriptionDelay </ci>
</math>
</delay>
...
</event>
</listOfEvents>
...
</model>
In SBML Level 3, an alternative approach is available in the form of the units attribute, which SBML Level 3 allows to appear on MathML cn elements. The value of this attribute can be used to indicate the unit of measurement to be associated with the number in the content of a cn element. The attribute is named units but, because it appears inside MathML element (which is in the XML namespace for MathML and not the namespace for SBML), it must always be prefixed with an XML namespace prefix for an SBML Level 3 namespace. The following is an example of this approach:
<model timeUnits="second" ...>
...
<listOfEvents>
<event useValuesFromTriggerTime="true">
...
<delay>
<math xmlns="http://www.w3.org/1998/Math/MathML"
xmlns:sbml="http://www.sbml.org/sbml/level3/version1/core">
<cn sbml:units="second"> 10 </cn>
</math>
</delay>
...
</event>
</listOfEvents>
...
</model>
In SBML Level 3 Version 2, the requirement that a Delay have a "math" subelement was relaxed, making it optional. In this case, the Delay remains undefined, and unless that information is provided in some other form (such as with an SBML Level 3 package), the Event behaves as if it had no Delay.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Returns the nth plug-in object (extension interface) for an SBML Level 3 package extension.
If no such plugin exists, NULL is returned.
Note: To get a plugin corresponding to a given id, use the findPlugin method. Calling Model.findPlugin("fbc") will return an FbcModelPlugin; calling Parameter.findPlugin("comp") will return CompSBasePlugin, etc. However, these instances must be cast to the derived type using castObject
(number)
the index of the plug-in to return
SBasePlugin
:
the nth plug-in object (the libSBML extension interface) of a
package extension.
If the index n is invalid, NULL is returned.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
The Priority object class (which was introduced in SBML Level 3 Version 1), like Delay, is derived from SBase and contains a MathML formula stored in the element "math". This formula is used to compute a dimensionless numerical value that influences the order in which a simulator is to perform the assignments of two or more events that happen to be executed simultaneously. The formula may evaluate to any double value (and thus may be a positive or negative number, or zero), with positive numbers taken to signifying a higher priority than zero or negative numbers. If no Priority object is present on a given Event object, no priority is defined for that event.
For the purposes of SBML, simultaneous event execution is defined as the situation in which multiple events have identical times of execution. The time of execution is calculated as the sum of the time at which a given event's Trigger is triggered plus its Delay duration, if any. Here, identical times means mathematically equal instants in time. (In practice, simulation software adhering to this specification may have to rely on numerical equality instead of strict mathematical equality; robust models will ensure that this difference will not cause significant discrepancies from expected behavior.)
If no Priority subobjects are defined for two or more Event objects, then those events are still executed simultaneously but their order of execution is undefined by the SBML Level 3 specification. A software implementation may choose to execute such simultaneous events in any order, as long as each event is executed only once and the requirements of checking the "persistent" attribute (and acting accordingly) are satisfied.
If Priority subobjects are defined for two or more simultaneously-triggered events, the order in which those particular events must be executed is dictated by their Priority objects, as follows. If the values calculated using the two Priority objects' "math" expressions differ, then the event having the higher priority value must be executed before the event with the lower value. If, instead, the two priority values are mathematically equal, then the two events must be triggered in a random order. It is important to note that a random order is not the same as an undefined order: given multiple runs of the same model with identical conditions, an undefined ordering would permit a system to execute the events in (for example) the same order every time (according to whatever scheme may have been implemented by the system), whereas the explicit requirement for random ordering means that the order of execution in different simulation runs depends on random chance. In other words, given two events A and B, a randomly-determined order must lead to an equal chance of executing A first or B first, every time those two events are executed simultaneously.
A model may contain a mixture of events, some of which have Priority subobjects and some do not. Should a combination of simultaneous events arise in which some events have priorities defined and others do not, the set of events with defined priorities must trigger in the order determined by their Priority objects, and the set of events without Priority objects must be executed in an undefined order with respect to each other and with respect to the events with Priority subobjects. (Note that undefined order does not necessarily mean random order, although a random ordering would be a valid implementation of this requirement.)
The following example may help further clarify these points. Suppose a model contains four events that should be executed simultaneously, with two of the events having Priority objects with the same value and the other two events having Priority objects with the same, but different, value. The two events with the higher priorities must be executed first, in a random order with respect to each other, and the remaining two events must be executed after them, again in a random order, for a total of four possible and equally-likely event executions: A-B-C-D, A-B-D-C, B-A-C-D, and B-A-D-C. If, instead, the model contains four events all having the same Priority values, there are 4! or 24 possible orderings, each of which must be equally likely to be chosen. Finally, if none of the four events has a Priority subobject defined, or even if exactly one of the four events has a defined Priority, there are again 24 possible orderings, but the likelihood of choosing any particular ordering is undefined; the simulator can choose between events as it wishes. (The SBML specification only defines the effects of priorities on Event objects with respect to other Event objects with priorities. Putting a priority on a single Event object in a model does not cause it to fall within that scope.)
An event's Priority object "math" expression must be evaluated at the time the Event is to be executed. During a simulation, all simultaneous events have their Priority values calculated, and the event with the highest priority is selected for next execution. Note that it is possible for the execution of one Event object to cause the Priority value of another simultaneously-executing Event object to change (as well as to trigger other events, as already noted). Thus, after executing one event, and checking whether any other events in the model have been triggered, all remaining simultaneous events that either (i) have Trigger objects with attributes "persistent"=false or (ii) have Trigger expressions that did not transition from true to false, must have their Priority expression reevaluated. The highest-priority remaining event must then be selected for execution next.
The unit associated with the value of a Priority object's "math" expression should be dimensionless. This is because the priority expression only serves to provide a relative ordering between different events, and only has meaning with respect to other Priority object expressions. The value of Priority objects is not comparable to any other kind of object in an SBML model.
Note: The Priority construct exists only in SBML Level 3; it cannot be used in SBML Level 2 or Level 1 models.
In SBML Level 3 Version 2, the requirement that a Priority have a "math" subelement was relaxed, making it optional. In this case, the Priority remains undefined, and unless that information is provided in some other form (such as with an SBML Level 3 package), the Event behaves as if it had no Priority.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Returns the nth plug-in object (extension interface) for an SBML Level 3 package extension.
If no such plugin exists, NULL is returned.
Note: To get a plugin corresponding to a given id, use the findPlugin method. Calling Model.findPlugin("fbc") will return an FbcModelPlugin; calling Parameter.findPlugin("comp") will return CompSBasePlugin, etc. However, these instances must be cast to the derived type using castObject
(number)
the index of the plug-in to return
SBasePlugin
:
the nth plug-in object (the libSBML extension interface) of a
package extension.
If the index n is invalid, NULL is returned.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
Event contains an optional element called "listOfEventAssignments", of class ListOfEventAssignments. In every instance of an event definition in a model, the object's "listOfEventAssignments" element must have a non-empty list of one or more "eventAssignment" elements of class EventAssignment. The object class EventAssignment has one required attribute, "variable", and a required element, "math". Being derived from SBase, it also has all the usual attributes and elements of its parent class.
An Event object defines when the event can occur, the variables that are affected by the event, and how the variables are affected. The purpose of the EventAssignment object class is to define how variables are affected by an Event. In SBML Level 2, every Event object instance must have a nonempty list of event assignments; in SBML Level 3, the list of assignments is optional.
The operation of an Event is divided into two phases (regardless of whether a delay is involved): one phase when the event is triggered, and the other when the event is executed. EventAssignment objects are interpreted when an event is executed. The effects are described below.
The EventAssignment attribute "variable" must be the identifier of an existing Compartment, Species, SpeciesReference, or Parameter instance defined in the model. In SBML Level 3 Version 2, this list was expanded to include identifiers of SBML Level 3 package variables that have both mathematical meaning and the ability to be assigned. When the event is executed, the value of the model component identified by "variable" is changed by the EventAssignment to the value computed by the "math" element; that is, a species' quantity, species reference's stoichiometry, compartment's size or parameter's value are reset to the value computed by "math".
Certain restrictions are placed on what can appear in "variable":
The object identified by the value of the EventAssignment attribute "variable" must not have its "constant" attribute set to or default to true. (Constants cannot be affected by events.)
The "variable" attribute must not contain the identifier of a reaction. In SBML Level 2 and SBML Level 3 Version 1, only species, species references, compartment and parameter values may be set by an Event. In SBML Level 3 Version 2, the "variable" attribute may also be the identifier of an SBML Level 3 package element with mathematical meaning and the ability to be assigned a value. This situation may only arise if the SBML package is present in the SBML document with a package:required attribute of true
The value of every "variable" attribute must be unique among the set of EventAssignment structures within a given Event structure. In other words, a single event cannot have multiple EventAssignment objects assigning the same variable. (All of them would be performed at the same time when that particular Event triggers, resulting in indeterminacy.) However, separate Event instances can refer to the same variable.
A variable cannot be assigned a value in an EventAssignment object instance and also be assigned a value by an AssignmentRule; i.e., the value of an EventAssignment's "variable" attribute cannot be the same as the value of a AssignmentRule' "variable" attribute. (Assignment rules hold at all times, therefore it would be inconsistent to also define an event that reassigns the value of the same variable.)
If the variable attribute of an EventAssignment object references an object in an SBML namespace that is not understood by the interpreter reading a given SBML document (that is, if the object is defined by an SBML Level 3 package that the software does not support), the event assignment must be ignored--the object's value will not need to be set, as the interpreter could not understand that package. If an interpreter cannot establish whether a referenced object is missing from the model or instead is defined in an SBML namespace not understood by the interpreter, it may produce a warning to the user. (The latter situation may only arise if an SBML package is present in the SBML document with a package:required attribute of "true".)
Note that the time of assignment of the object identified by the value of the "variable" attribute is always the time at which the Event is executed, not when it is triggered. The timing is controlled by the optional Delay in an Event. The time of assignment is not affected by the "useValuesFromTriggerTime" attribute on Event---that attribute affects the time at which the EventAssignment's "math" expression is evaluated. In other words, SBML allows decoupling the time at which the "variable" is assigned from the time at which its value expression is calculated.
The MathML expression contained in an EventAssignment defines the new value of the variable being assigned by the Event.
As mentioned above, the time at which the expression in "math" is
evaluated is determined by the attribute "useValuesFromTriggerTime" on
Event. If the attribute value is true, the expression must be
evaluated when the event is triggered; more precisely, the values of
identifiers occurring in MathML <ci>
elements in the
EventAssignment's "math" expression are the values they have at the
point when the event triggered. If, instead,
"useValuesFromTriggerTime"'s value is false, it means the values at
execution time should be used; that is, the values of identifiers
occurring in MathML <ci>
elements in the
EventAssignment's "math" expression are the values they have at the
point when the event executed.
Between Version 4 and previous versions of SBML Level 2, the requirements regarding the matching of units between an EvengAssignment's formula and the units of the object identified by the "variable" attribute changed. Previous versions required consistency, but in SBML Level 2 Version 4 and in SBML Level 3, unit consistency is only recommended. More precisely:
In the case of a species, an EventAssignment sets the referenced species' quantity (concentration or amount of substance) to the value determined by the formula in the EventAssignment's "math" subelement. The units of the "math" formula should (in SBML Level 2 Version 4 and in Level 3) or must (in previous Versions of Level 2) be identical to the units of the species.
(SBML Level 3 only.) In the case of a species reference, an EventAssignment sets the stoichiometry of the reactant or product referenced by the SpeciesReference object to the value determined by the formula in the "math" element. The unit associated with the value produced by the "math" formula should be dimensionless, because reactant and product stoichiometries in reactions are dimensionless quantities.
In the case of a compartment, an EventAssignment sets the referenced compartment's size to the size determined by the formula in the "math" subelement of the EventAssignment. The overall units of the formula should (in SBML Level 2 Version 4 and in Level 3) or must (in previous Versions of Level 2) be identical to the units specified for the size of the compartment identified by the EventAssignment's "variable" attribute.
In the case of a parameter, an EventAssignment sets the referenced parameter's value to that determined by the formula in "math". The overall units of the formula should (in SBML Level 2 Version 4 and Level 3) or must (in previous Versions of Level 2) be identical to the units defined for the parameter.
(For SBML Level 3 Version 2 only) In the case of an object from an SBML Level 3 package, an EventAssignment sets the referenced object's value (as defined by that package) to the value of the formula in "math". The unit of measurement associated with the value produced by the formula should be the same as that object's units attribute value (if it has such an attribute), or be equal to the units of model components of that type (if objects of that class are defined by the package as having the same units).
Note that the formula placed in the "math" element has no assumed units. The consistency of the units of the formula, and the units of the entity which the assignment affects, must be explicitly established just as in the case of the value of the Delay subelement. An approach similar to the one discussed in the context of Delay may be used for the formula of an EventAssignment.
In SBML Level 3 Version 2, the requirement that an EventAssignment have a "math" subelement was relaxed, making it optional. In this case, the EventAssignment remains undefined, and unless that information is provided in some other form (such as with an SBML Level 3 package), the Event behaves as if it had no EventAssignment.
Unsets the attribute "variable" of this EventAssignment
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Returns the nth plug-in object (extension interface) for an SBML Level 3 package extension.
If no such plugin exists, NULL is returned.
Note: To get a plugin corresponding to a given id, use the findPlugin method. Calling Model.findPlugin("fbc") will return an FbcModelPlugin; calling Parameter.findPlugin("comp") will return CompSBasePlugin, etc. However, these instances must be cast to the derived type using castObject
(number)
the index of the plug-in to return
SBasePlugin
:
the nth plug-in object (the libSBML extension interface) of a
package extension.
If the index n is invalid, NULL is returned.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
An Event object defines when the event can occur, the variables that are affected by the event, and how the variables are affected. The Trigger construct in SBML is used to define a mathematical expression that determines when an Event is triggered.
A Trigger object in SBML Level 2 and Level 3 contains one subelement named "math" containing a MathML expression. The expression is evaluated as a value of type boolean. The exact moment at which the expression evaluates to true is the time point when the Event is triggered. In SBML Level 3, Trigger has additional attributes that must be assigned values; they are discussed in a separate section below.
In SBML Level 2 and SBML Level 3 Version 1, the "math" subelement is required, and it must evaluate to a boolean expression. In SBML Level 3 Version 2, those restrictions are relaxed: the "math" element is optional, and numeric values are allowed in Boolean contexts (a '0' is interpreted as false, and all other values are interpreted as true). If a Trigger with no "math" is present in an Event, that Event will never trigger, unless that missing information is included in an SBML Level 3 package.
An event only triggers when its Trigger expression makes the transition in value from false to true. The event will also trigger at any subsequent time points when the trigger makes this transition; in other words, an event can be triggered multiple times during a simulation if its trigger condition makes the transition from false to true more than once. In SBML Level 3, the behavior at the very start of simulation (i.e., at t = 0, where t stands for time) is determined in part by the boolean flag "initialValue". This and other additional features introduced in SBML Level 3 are discussed further below.
SBML Level 3 Version 1 introduces two required attributes on the Trigger object: "persistent" and "initialValue". The rest of this introduction describes these two attributes.
In the interval between when an Event object triggers (i.e., its Trigger object expression transitions in value from false to true) and when its assignments are to be executed, conditions in the model may change such that the trigger expression transitions back from true to false. Should the event's assignments still be made if this happens? Answering this question is the purpose of the "persistent" attribute on Trigger.
If the boolean attribute "persistent" has a value of true, then once the event is triggered, all of its assignments are always performed when the time of execution is reached. The name persistent is meant to evoke the idea that the trigger expression does not have to be re-checked after it triggers if "persistent"=true. Conversely, if the attribute value is false, then the trigger expression is not assumed to persist: if the expression transitions in value back to false at any time between when the event triggered and when it is to be executed, the event is no longer considered to have triggered and its assignments are not executed. (If the trigger expression transitions once more to true after that point, then the event is triggered, but this then constitutes a whole new event trigger-and-execute sequence.)
The "persistent" attribute can be especially useful when Event objects contain Delay objects, but it is relevant even in a model without delays if the model contains two or more events. As explained in the introduction to this section, the operation of all events in SBML (delayed or not) is conceptually divided into two phases, triggering and execution; however, unless events have priorities associated with them, SBML does not mandate a particular ordering of event execution in the case of simultaneous events. Models with multiple events can lead to situations where the execution of one event affects another event's trigger expression value. If that other event has "persistent"=false, and its trigger expression evaluates to false before it is to be executed, the event must not be executed after all.
As mentioned above, an event triggers when the mathematical expression in its Trigger object transitions in value from false to true. An unanswered question concerns what happens at the start of a simulation: can event triggers make this transition at t = 0, where t stands for time?
In order to determine whether an event may trigger at t = 0, it is necessary to know what value the Trigger object's "math" expression had immediately prior to t = 0. This starting value of the trigger expression is determined by the value of the boolean attribute "initialValue". A value of true means the trigger expression is taken to have the value true immediately prior to t = 0. In that case, the trigger cannot transition in value from false to true at the moment simulation begins (because it has the value true both before and after t = 0), and can only make the transition from false to true sometime after t = 0. (To do that, it would also first have to transition to false before it could make the transition from false back to true.) Conversely, if "initialValue"=false, then the trigger expression is assumed to start with the value false, and therefore may trigger at t = 0 if the expression evaluates to true at that moment.
See Event, Delay, EventAssignment
(SBML Level 3 only) Sets the "persistent" attribute of this Trigger instance.
(boolean)
a boolean representing the persistent value to be set
Note: The attribute "persistent" is available in SBML Level 3, but is not present in lower Levels of SBML.
(SBML Level 3 only) Predicate to test whether the "persistent" attribute for this trigger is set.
boolean
:
true if the persistent attribute of
this Trigger is set, false otherwise
Note: The attribute "persistent" is available in SBML Level 3, but is not present in lower Levels of SBML.
(SBML Level 3 only) Get the value of the "initialValue" attribute of this Trigger.
any
:
the boolean value stored as the "initialValue" attribute value
in this Trigger.
Note: The attribute "initialValue" is available in SBML Level 3, but is not present in lower Levels of SBML.
(SBML Level 3 only) Predicate to test whether the "initialValue" attribute for this trigger is set.
boolean
:
true if the initialValue attribute of
this Trigger is set, @c false otherwise.
Note: The attribute "initialValue" is available in SBML Level 3, but is not present in lower Levels of SBML.
(SBML Level 3 only) Sets the "initialValue" attribute of this Trigger instance.
(any)
a boolean representing the initialValue to be set.
Note: The attribute "initialValue" is available in SBML Level 3, but is not present in lower Levels of SBML.
(SBML Level 3 only) Unsets the "initialValue" attribute of this Trigger instance.
Note: The attribute "initialValue" is available in SBML Level 3, but is not present in lower Levels of SBML.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Returns the nth plug-in object (extension interface) for an SBML Level 3 package extension.
If no such plugin exists, NULL is returned.
Note: To get a plugin corresponding to a given id, use the findPlugin method. Calling Model.findPlugin("fbc") will return an FbcModelPlugin; calling Parameter.findPlugin("comp") will return CompSBasePlugin, etc. However, these instances must be cast to the derived type using castObject
(number)
the index of the plug-in to return
SBasePlugin
:
the nth plug-in object (the libSBML extension interface) of a
package extension.
If the index n is invalid, NULL is returned.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
An SBML Event object defines when the event can occur, the variables that are affected by it, how the variables are affected, and the event's relationship to other events. The effect of the event can optionally be delayed after the occurrence of the condition which invokes it.
The operation of Event is divided into two phases (even when the event is not delayed): one when the event is triggered, and the other when the event is executed. Trigger objects define the conditions for triggering an event, Delay objects define when the event is actually executed, EventAssignment objects define the effects of executing the event, and (in SBML Level 3) Priority objects influence the order of EventAssignment performance in cases of simultaneous events. Please consult the descriptions of Trigger, Delay, EventAssignment and Priority for more information.
In SBML Level 2 versions before Version 4, the semantics of Event time delays were defined such that the expressions in the event's assignments were always evaluated at the time the event was triggered. This definition made it difficult to define an event whose assignment formulas were meant to be evaluated at the time the event was executed (i.e., after the time period defined by the value of the Delay element, or after any other simultaneous event may have been executed and changed the model state). In SBML Level 2 Version 4 and in Level 3, the attribute "useValuesFromTriggerTime" on Event was added to allow a model to indicate the time at which the event's assignments are to be calculated, whether at the moment the event is triggered (if the value of the attribute is true), or at the moment of execution (if "useValuesFromTriggerTime"=false). If the event has a delay, the "useValuesFromTriggerTime" is likely to make a significant difference in the values used in the assignment, but the possibility of simultaneous events mean that even zero-delay events can have different results depending on the value of this attribute.
The definition of Event in SBML Level 2 Versions 1 and 2 includes an additional attribute called "timeUnits", which allowed the time units of the Delay to be set explicitly. Later Versions of SBML Level 2 as well as SBML Level 3 do not define this attribute. LibSBML supports this attribute for compatibility with previous versions of SBML Level 2; however, if a model in SBML Level 3 or Level 2 Versions 3–4 format sets the attribute, the consistency-checking method SBMLDocument::checkConsistency() will report an error.
The attribute "useValuesFromTriggerTime" was introduced in SBML Level 2 Version 4. Models defined in prior Versions of SBML Level 2 cannot use this attribute, and SBMLDocument::checkConsistency() will report an error if they do.
SBML Level 3 introduces several changes to the structure and components of Events compared to SBML Level 2. These changes fall into two main categories: changes to what is optional or required, and additions of new attributes and elements.
The changes to the attributes of Event are described below; the changes to Trigger and Priority are described in their respective sections.
The detailed semantics of events are described in the specification documents for each SBML Level/Version. Here we include the description from the SBML Level 1 Version 1. Any transition of a Trigger object's "math" formula from the value false to true will cause the enclosing Event object to trigger. Such a transition is not possible at the very start of a simulation (i.e., at time t = 0) unless the Trigger object's "initialValue" attribute has a value of false; this defines the value of the trigger formula to be false immediately prior to the start of simulation, thereby giving it the potential to change in value from false to true when the formula is evaluated at t = 0. If "initialValue"=true, then the trigger expression cannot transition from false to true at t = 0 but may do so at some time t > 0.
Consider an Event object definition E with delay d in which the Trigger object's "math" formula makes a transition in value from false to true at times t1 and t2. The EventAssignment within the Event object will have effect at t1 + d and t2 + d irrespective of the relative times of t1 and t2. For example, events can "overlap" so that t1 < t2 < t1 + d still causes an event assignments to occur at t1 + d and t2 + d.
It is entirely possible for two events to be executed simultaneously, and it is possible for events to trigger other events (i.e., an event assignment can cause an event to trigger). This leads to several points:
A software package should retest all event triggers after executing an event assignment in order to account for the possibility that the assignment causes another event trigger to transition from false to true. This check should be made after each individual Event object's execution, even when several events are to be executed simultaneously.
Any Event object whose Trigger "persistent" attribute has the value false must have its trigger expression reevaluated continuously between when the event is triggered and when it is executed. If its trigger expression ever evaluates to false, it must be removed from the queue of events pending execution and treated as any other event whose trigger expression evaluates to false.
Although the precise time at which events are executed is not resolved beyond the given execution point in simulated time, it is assumed that the order in which the events occur is resolved. This order can be significant in determining the overall outcome of a given simulation. When an event X triggers another event Y and event Y has zero delay, then event Y is added to the existing set of simultaneous events that are pending execution. Events X and Y form a cascade of events at the same point in simulation time. An event such as Y may have a special priority if it contains a Priority subobject.
All events in a model are open to being in a cascade. The position of an event in the event queue does not affect whether it can be in the cascade: event Y can be triggered whether it is before or after X in the queue of events pending execution. A cascade of events can be potentially infinite (never terminate); when this occurs a simulator should indicate this has occurred---it is incorrect for a simulator to break a cascade arbitrarily and continue the simulation without at least indicating that the infinite cascade occurred.
Simultaneous events having no defined priorities are executed in an undefined order. This does not mean that the behavior of the simulation is completely undefined; merely that the order of execution of these particular events is undefined. A given simulator may use any algorithm to choose an order as long as every event is executed exactly once.
Events with defined priorities are executed in the order implied by their Priority "math" formula values, with events having higher priorities being executed ahead of events with lower priorities, and events with identical priorities being executed in a random order with respect to one another (as determined at run-time by some random algorithm equivalent to coin-flipping). Newly-triggered events that are to be executed immediately (i.e., if they define no delays) should be inserted into the queue of events pending execution according to their priorities: events with higher priority values value must be inserted ahead of events with lower priority values and after any pending events with even higher priorities, and inserted randomly among pending events with the same priority values. Events without Priority objects must be inserted into the queue in some fashion, but the algorithm used to place it in the queue is undefined. Similarly, there is no restriction on the order of a newly-inserted event with a defined Priority with respect to any other pending Event without a defined Priority.
A model variable that is the target of one or more event assignments can change more than once when simultaneous events are processed at some time point t. The model's behavior (output) for such a variable is the value of the variable at the end of processing all the simultaneous events at time t.
In SBML Level 3 Version 2, several restrictions were lifted that have the potential to affect the semantics of an Event:
The Trigger subobject of an Event is optional. If missing, an Event is never triggered, unless an alternate triggering scheme is introduced by an SBML Level 3 package.
The "math" subelements of an Event Trigger, Delay, Priority, and EventAssignment are all optional. If any of these elements lack a "math" subelement, and that information is not supplied in an SBML Level 3 package, it is mathematically equivalent to the Trigger, Delay, Priority, or EventAssignment not being present at all.
The ListOfEventAssignments may be empty, which is mathematically equivalent to the Event not having a ListOfEventAssignments at all.
Any "math" subelement may return a Boolean or a numeric value in any context. If a numeric value is used in a Boolean context, a "0" is interpreted as false, and all other values are interpreted as true. If a Boolean value is used in a numeric context, a true is interpreted as a 1, and a false is interpreted as a 0. This means (for example) that a Trigger value that changes from 0.0 to anything else is equivalent to changing from false to true.
See Trigger, Priority, Delay, EventAssignment
Unsets the Delay of this Event.
(SBML Level 3 only) Creates a new, empty Priority, adds it to this Event and returns the Priority.
any
:
the newly created Priority object instance, or NULL if the SBML
level and version used for this Event does not define Priority children
Note: The element "priority" is available in SBML Level 3, but is not present in lower Levels of SBML.
(SBML Level 3 only) Sets the priority definition of this Event to a copy of the given Priority object instance.
(Priority)
the Priority object instance to use
Note: The element "priority" is available in SBML Level 3, but is not present in lower Levels of SBML.
(SBML Level 3 only) Unsets the Priority of this Event.
Note: The element "priority" is available in SBML Level 3, but is not present in lower Levels of SBML.
Unsets the Trigger of this Event.
Creates a new, empty EventAssignment, adds it to this Event's list of event assignments and returns the EventAssignment.
EventAssignment
:
the newly created EventAssignment object instance
Return a specific EventAssignment object of this Event.
(number)
an integer, the index of the EventAssignment object to return.
EventAssignment
:
the
n
th EventAssignment of this Event.
Unsets the "timeUnits" attribute of this Event.
Predicate for testing whether the "useValuesFromTriggerTime" attribute of this Event is set.
boolean
:
true if the "useValuesFromTriggerTime" attribute of this Event is
set, false otherwise
Note: In SBML Level 2, this attribute is optional and has a default value of true, whereas in Level 3, this optional is mandatory and has no default value.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Returns the nth plug-in object (extension interface) for an SBML Level 3 package extension.
If no such plugin exists, NULL is returned.
Note: To get a plugin corresponding to a given id, use the findPlugin method. Calling Model.findPlugin("fbc") will return an FbcModelPlugin; calling Parameter.findPlugin("comp") will return CompSBasePlugin, etc. However, these instances must be cast to the derived type using castObject
(number)
the index of the plug-in to return
SBasePlugin
:
the nth plug-in object (the libSBML extension interface) of a
package extension.
If the index n is invalid, NULL is returned.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
In SBML, rules provide additional ways to define the values of variables in a model, their relationships, and the dynamical behaviors of those variables. They enable encoding relationships that cannot be expressed using Reaction nor InitialAssignment objects alone.
The libSBML implementation of rules mirrors the SBML Level 3 definition (which is in turn is very similar to the Level 2 Version 4 definition), with Rule being the parent class of three subclasses as explained below. The Rule class itself cannot be instantiated by user programs and has no constructor; only the subclasses AssignmentRule, AlgebraicRule and RateRule can be instantiated directly.
Predicate returning true if this Rule is a SpeciesConcentrationRule or equivalent.
This libSBML method works for SBML Level 1 models (where there is such a thing as an explicit SpeciesConcentrationRule), as well as other Levels of SBML. For Levels above Level 1, this method checks the symbol being affected by the rule, and returns true if the symbol is the identifier of a Species object defined in the model.
boolean
:
true if this Rule is a SpeciesConcentrationRule, false
otherwise.
Get the mathematical formula of this Rule as an ASTNode tree.
ASTNode
:
the value of the "math" subelement of this Rule,
or NULL if the math is not set.
Note: The subelement "math" is present in SBML Levels 2 and 3. In SBML Level 1, the equivalent construct is the attribute named "formula". LibSBML provides a unified interface to the underlying math expression and this method can be used for models of all Levels of SBML.
Predicate returning true if this Rule's mathematical expression is set.
This method is equivalent to isSetFormula().
boolean
:
true if the formula (or equivalently the math) for this
Rule is set, false otherwise.
Note: The subelement "math" is present in SBML Levels 2 and 3. In SBML Level 1, the equivalent construct is the attribute named "formula". LibSBML provides a unified interface to the underlying math expression and this method can be used for models of all Levels of SBML.
Sets the "math" subelement of this Rule to a copy of the given ASTNode.
(ASTNode)
the AST structure of the mathematical formula.
Note: The subelement "math" is present in SBML Levels 2 and 3. In SBML Level 1, the equivalent construct is the attribute named "formula". LibSBML provides a unified interface to the underlying math expression and this method can be used for models of all Levels of SBML.
Returns the mathematical expression of this Rule in text-string form.
The text string is produced by SBMLFormulaParser#parseL3Formula; please consult the documentation for that function to find out more about the format of the text-string formula.
DOMString
:
the formula text string for this Rule.
Sets the "math" subelement of this Rule to an expression in text-string form.
This is equivalent to setMath(const ASTNode* math). The provision of using text-string formulas is retained for easier SBML Level 1 compatibility. The formula is converted to an ASTNode internally.
(string)
a mathematical formula in text-string form
Note: The attribute "formula" is specific to SBML Level 1; in higher Levels of SBML, it has been replaced with a subelement named "math". However, libSBML provides a unified interface to the underlying math expression and this method can be used for models of all Levels of SBML.
Predicate returning true if this Rule's mathematical expression is set.
This method is equivalent to isSetMath(). This version is present for easier compatibility with SBML Level 1, in which mathematical formulas were written in text-string form.
boolean
:
true if the mathematical formula for this Rule is
set, false otherwise.
Note: The attribute "formula" is specific to SBML Level 1; in higher Levels of SBML, it has been replaced with a subelement named "math". However, libSBML provides a unified interface to the underlying math expression and this method can be used for models of all Levels of SBML.
Get the value of the "variable" attribute of this Rule object.
The "variable" attribute of a Rule indicates the element which the results of the "math" are to be applied. An AlgebraicRule has no "variable", and will always return an empty string.
string
:
the identifier string stored as the "variable" attribute value
in this Rule, or NULL if this object is an AlgebraicRule object, or if
the attribute is unset.
Unsets the value of the "variable" attribute of this Rule object.
Calculates and returns a UnitDefinition that expresses the units of measurement assumed for the "math" expression of this Rule.
UnitDefinition
:
a UnitDefinition that expresses the units of the math
expression of this Rule, or NULL if one cannot be constructed.
Predicate returning true if the math expression of this Rule contains parameters/numbers with undeclared units.
boolean
:
true if the math expression of this Rule includes
parameters/numbers with undeclared units, false otherwise.
Note: A return value of true indicates that the UnitDefinition returned by getDerivedUnitDefinition() may not accurately represent the units of the expression.
Predicate returning true if this Rule is an ParameterRule or equivalent.
This libSBML method works for SBML Level 1 models (where there is such a thing as an explicit ParameterRule), as well as other Levels of SBML. For Levels above Level 1, this method checks the symbol being affected by the rule, and returns true if the symbol is the identifier of a Parameter object defined in the model.
boolean
:
true if this Rule is a ParameterRule, false
otherwise.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Returns the nth plug-in object (extension interface) for an SBML Level 3 package extension.
If no such plugin exists, NULL is returned.
Note: To get a plugin corresponding to a given id, use the findPlugin method. Calling Model.findPlugin("fbc") will return an FbcModelPlugin; calling Parameter.findPlugin("comp") will return CompSBasePlugin, etc. However, these instances must be cast to the derived type using castObject
(number)
the index of the plug-in to return
SBasePlugin
:
the nth plug-in object (the libSBML extension interface) of a
package extension.
If the index n is invalid, NULL is returned.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
The rule type AssignmentRule is derived from the parent class Rule. It is used to express equations that set the values of variables. The left-hand side (the attribute named "variable") of an assignment rule must refer to the identifier of a Species, SpeciesReference (in SBML Level3), Compartment, or global Parameter object in the model (but not a Reaction). In SBML Level3 Version2, it may also refer to the SId of an element defined in an SBML Level3 package with mathematical meaning and the ability to be assigned. The entity identified must have its "constant" attribute set to false. The effects of an assignment rule construct are in general terms the same, but differ in the precise details depending on the type of SBML component being set:
In the case of a species, an SBML assignment rule sets the referenced species' quantity (whether a "concentration" or "amount") to the value determined by the formula in the MathML subelement "math". The unit associated with the value produced by the "math" formula should (in SBML Level2 Version4 and in SBML Level3) or must (in SBML releases prior to Level2 version4) be equal to the unit associated with the species' quantity. Restrictions: There must not be both an AssignmentRule "variable" attribute and a SpeciesReference "species" attribute having the same value in a model, unless the referenced Species object has its "boundaryCondition" attribute set to true. In other words, an assignment rule cannot be defined for a species that is created or destroyed in a reaction unless that species is defined as a boundary condition in the model.
(For SBML Level3 only) In the case of a species reference, an assignment rule sets the stoichiometry of the referenced reactant or product to the value determined by the formula in "math". The unit associated with the value produced by the "math" formula should be consistent with the unit "dimensionless", because reactant and product stoichiometries in reactions are dimensionless quantities.
In the case of a compartment, an SBML assignment rule sets the referenced compartment's size to the value determined by the formula in the "math" subelement of the AssignmentRule object. The overall units of the formula in "math" should (in SBML Level2 Version4 and in SBML Level3) or must (in SBML releases prior to Level2 version4) be the same as the units of the size of the compartment.
In the case of a parameter, an assignment rule sets the referenced parameter's value to that determined by the formula in the "math" subelement of the AssignmentRule object. The overall units of the formula in the "math" subelement should (in SBML Level2 Version4 and in SBML Level3) or must (in SBML releases prior to Level2 version4) be the same as the units defined for the parameter.
(For SBML Level3 Version2 only) In the case of an object from an SBML Level3 package, an AssignmentRule sets the referenced object's value (as defined by that package) to the value of the formula in math. The unit of measurement associated with the value produced by the formula should be the same as that object's units attribute value (if it has such an attribute), or be equal to the units of model components of that type (if objects of that class are defined by the package as having the same units).
In SBML Level2 and Level3 Version1, the "math" subelement of the AssignmentRule is required. In SBML Level3 Version2, this rule is relaxed, and the subelement is optional. If an AssignmentRule with no "math" child is present in the model, the value of its referenced "variable" is undefined. This may represent a situation where the model itself is unfinished, or the missing information may be provided by an SBML Level3 package.
If the variable attribute of an AssignmentRule object references an object in an SBML namespace not understood by the interpreter reading a given SBML document (that is, if the object is defined by an SBML Level3 package that the software does not support), the assignment rule must be ignored--the object's value will not need to be set, as the interpreter could not understand that package. If an interpreter cannot establish whether a referenced object is missing from the model or instead is defined in an SBML namespace not understood by the interpreter, it may produce a warning to the user. (The latter situation may only arise if an SBML package is present in the SBML document with a package:required attribute of "true".)
In the context of a simulation, assignment rules are in effect at all times, t < 0. For purposes of evaluating expressions that involve the delay "csymbol" (see the SBML Level2 specification), assignment rules are considered to apply also at t > 0. Please consult the relevant SBML specification for additional information about the semantics of assignments, rules, and entity values for simulation time t
0.
A model must not contain more than one AssignmentRule or RateRule object having the same value of "variable"; in other words, in the set of all assignment rules and rate rules in an SBML model, each variable appearing in the left-hand sides can only appear once. This simply follows from the fact that an indeterminate system would result if a model contained more than one assignment rule for the same variable or both an assignment rule and a rate rule for the same variable.
Similarly, a model must also not contain both an AssignmentRule and an InitialAssignment definition for the same variable, because both kinds of constructs apply prior to and at the start of simulation time, i.e., t > 0. If a model contained both an initial assignment and an assignment rule for the same variable, an indeterminate system would result.
The value calculated by an AssignmentRule object overrides the value assigned to the given symbol by the model component defining that symbol. For example, if a Compartment object's "size" attribute value is set in its definition, and the model also contains an AssignmentRule object having that compartment's "id" as its "variable" value, then the "size" assigned in the Compartment object definition is ignored and the value assigned based on the computation defined in the AssignmentRule. This does not mean that a definition for a given symbol can be omitted if there is an AssignmentRule object involving it. For example, there must be a Parameter object definition for a given parameter if there is an AssignmentRule definition for that parameter. It is only a question of which value definition takes precedence.
Predicate returning true if this Rule is a SpeciesConcentrationRule or equivalent.
This libSBML method works for SBML Level 1 models (where there is such a thing as an explicit SpeciesConcentrationRule), as well as other Levels of SBML. For Levels above Level 1, this method checks the symbol being affected by the rule, and returns true if the symbol is the identifier of a Species object defined in the model.
boolean
:
true if this Rule is a SpeciesConcentrationRule, false
otherwise.
Get the mathematical formula of this Rule as an ASTNode tree.
ASTNode
:
the value of the "math" subelement of this Rule,
or NULL if the math is not set.
Note: The subelement "math" is present in SBML Levels 2 and 3. In SBML Level 1, the equivalent construct is the attribute named "formula". LibSBML provides a unified interface to the underlying math expression and this method can be used for models of all Levels of SBML.
Predicate returning true if this Rule's mathematical expression is set.
This method is equivalent to isSetFormula().
boolean
:
true if the formula (or equivalently the math) for this
Rule is set, false otherwise.
Note: The subelement "math" is present in SBML Levels 2 and 3. In SBML Level 1, the equivalent construct is the attribute named "formula". LibSBML provides a unified interface to the underlying math expression and this method can be used for models of all Levels of SBML.
Sets the "math" subelement of this Rule to a copy of the given ASTNode.
(ASTNode)
the AST structure of the mathematical formula.
Note: The subelement "math" is present in SBML Levels 2 and 3. In SBML Level 1, the equivalent construct is the attribute named "formula". LibSBML provides a unified interface to the underlying math expression and this method can be used for models of all Levels of SBML.
Returns the mathematical expression of this Rule in text-string form.
The text string is produced by SBMLFormulaParser#parseL3Formula; please consult the documentation for that function to find out more about the format of the text-string formula.
DOMString
:
the formula text string for this Rule.
Sets the "math" subelement of this Rule to an expression in text-string form.
This is equivalent to setMath(const ASTNode* math). The provision of using text-string formulas is retained for easier SBML Level 1 compatibility. The formula is converted to an ASTNode internally.
(string)
a mathematical formula in text-string form
Note: The attribute "formula" is specific to SBML Level 1; in higher Levels of SBML, it has been replaced with a subelement named "math". However, libSBML provides a unified interface to the underlying math expression and this method can be used for models of all Levels of SBML.
Predicate returning true if this Rule's mathematical expression is set.
This method is equivalent to isSetMath(). This version is present for easier compatibility with SBML Level 1, in which mathematical formulas were written in text-string form.
boolean
:
true if the mathematical formula for this Rule is
set, false otherwise.
Note: The attribute "formula" is specific to SBML Level 1; in higher Levels of SBML, it has been replaced with a subelement named "math". However, libSBML provides a unified interface to the underlying math expression and this method can be used for models of all Levels of SBML.
Get the value of the "variable" attribute of this Rule object.
The "variable" attribute of a Rule indicates the element which the results of the "math" are to be applied. An AlgebraicRule has no "variable", and will always return an empty string.
string
:
the identifier string stored as the "variable" attribute value
in this Rule, or NULL if this object is an AlgebraicRule object, or if
the attribute is unset.
Unsets the value of the "variable" attribute of this Rule object.
Calculates and returns a UnitDefinition that expresses the units of measurement assumed for the "math" expression of this Rule.
UnitDefinition
:
a UnitDefinition that expresses the units of the math
expression of this Rule, or NULL if one cannot be constructed.
Predicate returning true if the math expression of this Rule contains parameters/numbers with undeclared units.
boolean
:
true if the math expression of this Rule includes
parameters/numbers with undeclared units, false otherwise.
Note: A return value of true indicates that the UnitDefinition returned by getDerivedUnitDefinition() may not accurately represent the units of the expression.
Predicate returning true if this Rule is an ParameterRule or equivalent.
This libSBML method works for SBML Level 1 models (where there is such a thing as an explicit ParameterRule), as well as other Levels of SBML. For Levels above Level 1, this method checks the symbol being affected by the rule, and returns true if the symbol is the identifier of a Parameter object defined in the model.
boolean
:
true if this Rule is a ParameterRule, false
otherwise.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Returns the nth plug-in object (extension interface) for an SBML Level 3 package extension.
If no such plugin exists, NULL is returned.
Note: To get a plugin corresponding to a given id, use the findPlugin method. Calling Model.findPlugin("fbc") will return an FbcModelPlugin; calling Parameter.findPlugin("comp") will return CompSBasePlugin, etc. However, these instances must be cast to the derived type using castObject
(number)
the index of the plug-in to return
SBasePlugin
:
the nth plug-in object (the libSBML extension interface) of a
package extension.
If the index n is invalid, NULL is returned.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
The rule type RateRule is derived from the parent class Rule. It is used to express equations that determine the rates of change of variables. The left-hand side (the "variable" attribute) can refer to the identifier of a species, compartment, or parameter (but not a reaction). The entity identified must have its "constant" attribute set to false. The effects of a RateRule are in general terms the same, but differ in the precise details depending on which variable is being set:
In the case of a species, a RateRule sets the rate of change of the species' quantity (concentration or amount of substance) to the value determined by the formula in the "math" subelement of the RateRule object. The overall units of the formula in "math" should (in SBML Level2 Version4 and in SBML Level3) or must (in SBML releases prior to Level2 version4) be equal to the unit of species quantity divided by the model-wide unit of time. Restrictions: There must not be both a RateRule "variable" attribute and a SpeciesReference "species" attribute having the same value, unless that species has its "boundaryCondition" attribute is set to true. This means a rate rule cannot be defined for a species that is created or destroyed in a reaction, unless that species is defined as a boundary condition in the model.
(For SBML Level3 only) In the case of a species reference, a RateRule sets the rate of change of the stoichiometry of the referenced reactant or product to the value determined by the formula in "math". The unit associated with the value produced by the "math" formula should be consistent with the unit "dimensionless" divided by the model-wide unit of time.
In the case of a compartment, a RateRule sets the rate of change of the compartment's size to the value determined by the formula in the "math" subelement of the RateRule object. The overall units of the formula should (in SBML Level2 Version4 and in SBML Level3) or must (in SBML releases prior to Level2 version4) be the units of the compartment's size divided by the model-wide unit of time.
In the case of a parameter, a RateRule sets the rate of change of the parameter's value to that determined by the formula in the "math" subelement of the RateRule object. The overall units of the formula should (in SBML Level2 Version4 and in SBML Level3) or must (in SBML releases prior to Level2 version4) be the Parameter object's "unit" attribute value divided by the model-wide unit of time.
(For SBML Level3 Version2 only) In the case of an object from an SBML Level3 package, a RateRule sets the rate of change of the referenced object's value (as defined by that package) to the value of the formula in "math". The unit of measurement associated with the value produced by the formula should be the same as that object's units attribute value (if it has such an attribute) divided by the model-wide unit of time, or be equal to the units of model components of that type (if objects of that class are defined by the package as having the same units) divided by the model-wide unit of time.
In SBML Level2 and Level3 Version1, the "math" subelement of the RateRule is required. In SBML Level3 Version2, this rule is relaxed, and the subelement is optional. If a RateRule with no "math" child is present in the model, the rate at which its referenced "variable" changes over time is undefined. This may represent a situation where the model itself is unfinished, or the missing information may be provided by an SBML Level3 package.
If the variable attribute of a RateRule object references an object in an SBML namespace that is not understood by the interpreter reading a given SBML document (that is, if the object is defined by an SBML Level3 package that the software does not support), the rate rule must be ignored--the object's value will not need to be set, as the interpreter could not understand that package. If an interpreter cannot establish whether a referenced object is missing from the model or instead is defined in an SBML namespace not understood by the interpreter, it may produce a warning to the user. (The latter situation may only arise if an SBML package is present in the SBML document with a package:required attribute of "true".)
In the context of a simulation, rate rules are in effect for simulation time t > 0. Please consult the relevant SBML specification for additional information about the semantics of assignments, rules, and entity values for simulation time t < 0.
As mentioned in the description of AssignmentRule, a model must not contain more than one RateRule or AssignmentRule object having the same value of "variable"; in other words, in the set of all assignment rules and rate rules in an SBML model, each variable appearing in the left-hand sides can only appear once. This simply follows from the fact that an indeterminate system would result if a model contained more than one assignment rule for the same variable or both an assignment rule and a rate rule for the same variable.
Predicate returning true if this Rule is a SpeciesConcentrationRule or equivalent.
This libSBML method works for SBML Level 1 models (where there is such a thing as an explicit SpeciesConcentrationRule), as well as other Levels of SBML. For Levels above Level 1, this method checks the symbol being affected by the rule, and returns true if the symbol is the identifier of a Species object defined in the model.
boolean
:
true if this Rule is a SpeciesConcentrationRule, false
otherwise.
Get the mathematical formula of this Rule as an ASTNode tree.
ASTNode
:
the value of the "math" subelement of this Rule,
or NULL if the math is not set.
Note: The subelement "math" is present in SBML Levels 2 and 3. In SBML Level 1, the equivalent construct is the attribute named "formula". LibSBML provides a unified interface to the underlying math expression and this method can be used for models of all Levels of SBML.
Predicate returning true if this Rule's mathematical expression is set.
This method is equivalent to isSetFormula().
boolean
:
true if the formula (or equivalently the math) for this
Rule is set, false otherwise.
Note: The subelement "math" is present in SBML Levels 2 and 3. In SBML Level 1, the equivalent construct is the attribute named "formula". LibSBML provides a unified interface to the underlying math expression and this method can be used for models of all Levels of SBML.
Sets the "math" subelement of this Rule to a copy of the given ASTNode.
(ASTNode)
the AST structure of the mathematical formula.
Note: The subelement "math" is present in SBML Levels 2 and 3. In SBML Level 1, the equivalent construct is the attribute named "formula". LibSBML provides a unified interface to the underlying math expression and this method can be used for models of all Levels of SBML.
Returns the mathematical expression of this Rule in text-string form.
The text string is produced by SBMLFormulaParser#parseL3Formula; please consult the documentation for that function to find out more about the format of the text-string formula.
DOMString
:
the formula text string for this Rule.
Sets the "math" subelement of this Rule to an expression in text-string form.
This is equivalent to setMath(const ASTNode* math). The provision of using text-string formulas is retained for easier SBML Level 1 compatibility. The formula is converted to an ASTNode internally.
(string)
a mathematical formula in text-string form
Note: The attribute "formula" is specific to SBML Level 1; in higher Levels of SBML, it has been replaced with a subelement named "math". However, libSBML provides a unified interface to the underlying math expression and this method can be used for models of all Levels of SBML.
Predicate returning true if this Rule's mathematical expression is set.
This method is equivalent to isSetMath(). This version is present for easier compatibility with SBML Level 1, in which mathematical formulas were written in text-string form.
boolean
:
true if the mathematical formula for this Rule is
set, false otherwise.
Note: The attribute "formula" is specific to SBML Level 1; in higher Levels of SBML, it has been replaced with a subelement named "math". However, libSBML provides a unified interface to the underlying math expression and this method can be used for models of all Levels of SBML.
Get the value of the "variable" attribute of this Rule object.
The "variable" attribute of a Rule indicates the element which the results of the "math" are to be applied. An AlgebraicRule has no "variable", and will always return an empty string.
string
:
the identifier string stored as the "variable" attribute value
in this Rule, or NULL if this object is an AlgebraicRule object, or if
the attribute is unset.
Unsets the value of the "variable" attribute of this Rule object.
Calculates and returns a UnitDefinition that expresses the units of measurement assumed for the "math" expression of this Rule.
UnitDefinition
:
a UnitDefinition that expresses the units of the math
expression of this Rule, or NULL if one cannot be constructed.
Predicate returning true if the math expression of this Rule contains parameters/numbers with undeclared units.
boolean
:
true if the math expression of this Rule includes
parameters/numbers with undeclared units, false otherwise.
Note: A return value of true indicates that the UnitDefinition returned by getDerivedUnitDefinition() may not accurately represent the units of the expression.
Predicate returning true if this Rule is an ParameterRule or equivalent.
This libSBML method works for SBML Level 1 models (where there is such a thing as an explicit ParameterRule), as well as other Levels of SBML. For Levels above Level 1, this method checks the symbol being affected by the rule, and returns true if the symbol is the identifier of a Parameter object defined in the model.
boolean
:
true if this Rule is a ParameterRule, false
otherwise.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Returns the nth plug-in object (extension interface) for an SBML Level 3 package extension.
If no such plugin exists, NULL is returned.
Note: To get a plugin corresponding to a given id, use the findPlugin method. Calling Model.findPlugin("fbc") will return an FbcModelPlugin; calling Parameter.findPlugin("comp") will return CompSBasePlugin, etc. However, these instances must be cast to the derived type using castObject
(number)
the index of the plug-in to return
SBasePlugin
:
the nth plug-in object (the libSBML extension interface) of a
package extension.
If the index n is invalid, NULL is returned.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
The rule type AlgebraicRule is derived from the parent class Rule. It is used to express equations that are neither assignments of model variables nor rates of change. AlgebraicRule does not add any attributes to the basic Rule; its role is simply to distinguish this case from the other cases.
In the context of a simulation, algebraic rules are in effect at all times, t < 0. For purposes of evaluating expressions that involve the delay "csymbol" (see the SBML specification), algebraic rules are considered to apply also at t > 0. Please consult the relevant SBML specification for additional information about the semantics of assignments, rules, and entity values for simulation time t
0.
An SBML model must not be overdetermined. The ability to define arbitrary algebraic expressions in an SBML model introduces the possibility that a model is mathematically overdetermined by the overall system of equations constructed from its rules, reactions and events. Therefore, if an algebraic rule is introduced in a model, for at least one of the entities referenced in the rule's "math" element the value of that entity must not be completely determined by other constructs in the model. This means that at least this entity must not have the attribute "constant"=true and there must also not be a rate rule or assignment rule for it. Furthermore, if the entity is a Species object, its value must not be determined by reactions, which means that it must either have the attribute "boundaryCondition"=true or else not be involved in any reaction at all. These restrictions are explained in more detail in the SBML specification documents.
In SBML Levels 2 and 3, Reaction object identifiers can be referenced in the "math" expression of an algebraic rule, but reaction rates can never be determined by algebraic rules. This is true even when a reaction does not contain a KineticLaw object. (In such cases of missing kinetic law definitions, the model is valid but incomplete; the rates of reactions lacking kinetic laws are simply undefined, and not determined by the algebraic rule.)
In SBML Level2 and Level3 Version1, the "math" subelement of the AlgebraicRule is required. In SBML Level3 Version2, this rule is relaxed, and the subelement is optional. If an AlgebraicRule with no "math" child is present in the model, no additional mathematical constraints on the model are added by the rule. This may represent a situation where the model itself is unfinished, or the missing information may be provided by an SBML Level3 package.
Finally, any symbol that appears as the target of a rateOf csymbol (AST_FUNCTION_RATE_OF, introduced in SBML Level3 Version2) may not be determined by an AlgebraicRule. This is because the rateOf csymbol is defined as applying only to symbols whose rates of change are easily determinable.
Users should note that these rules about what symbols may not be determined by an AlgebraicRule may be used to discover what symbol is being determined by an AlgebraicRule. If three symbols appear in the math element of an AlgebraicRule, the first of which is flagged constant=true, and the second of which appears as the target of a rateOf csymbol, one may conclude that the AlgebraicRule must be used to determine the value of the third symbol. This is, in fact, a principle use (outside of validation) of the constant attribute: its use in allowing software to properly identify the dependent variable in an AlgebraicRule.
Predicate returning true if this Rule is a SpeciesConcentrationRule or equivalent.
This libSBML method works for SBML Level 1 models (where there is such a thing as an explicit SpeciesConcentrationRule), as well as other Levels of SBML. For Levels above Level 1, this method checks the symbol being affected by the rule, and returns true if the symbol is the identifier of a Species object defined in the model.
boolean
:
true if this Rule is a SpeciesConcentrationRule, false
otherwise.
Get the mathematical formula of this Rule as an ASTNode tree.
ASTNode
:
the value of the "math" subelement of this Rule,
or NULL if the math is not set.
Note: The subelement "math" is present in SBML Levels 2 and 3. In SBML Level 1, the equivalent construct is the attribute named "formula". LibSBML provides a unified interface to the underlying math expression and this method can be used for models of all Levels of SBML.
Predicate returning true if this Rule's mathematical expression is set.
This method is equivalent to isSetFormula().
boolean
:
true if the formula (or equivalently the math) for this
Rule is set, false otherwise.
Note: The subelement "math" is present in SBML Levels 2 and 3. In SBML Level 1, the equivalent construct is the attribute named "formula". LibSBML provides a unified interface to the underlying math expression and this method can be used for models of all Levels of SBML.
Sets the "math" subelement of this Rule to a copy of the given ASTNode.
(ASTNode)
the AST structure of the mathematical formula.
Note: The subelement "math" is present in SBML Levels 2 and 3. In SBML Level 1, the equivalent construct is the attribute named "formula". LibSBML provides a unified interface to the underlying math expression and this method can be used for models of all Levels of SBML.
Returns the mathematical expression of this Rule in text-string form.
The text string is produced by SBMLFormulaParser#parseL3Formula; please consult the documentation for that function to find out more about the format of the text-string formula.
DOMString
:
the formula text string for this Rule.
Sets the "math" subelement of this Rule to an expression in text-string form.
This is equivalent to setMath(const ASTNode* math). The provision of using text-string formulas is retained for easier SBML Level 1 compatibility. The formula is converted to an ASTNode internally.
(string)
a mathematical formula in text-string form
Note: The attribute "formula" is specific to SBML Level 1; in higher Levels of SBML, it has been replaced with a subelement named "math". However, libSBML provides a unified interface to the underlying math expression and this method can be used for models of all Levels of SBML.
Predicate returning true if this Rule's mathematical expression is set.
This method is equivalent to isSetMath(). This version is present for easier compatibility with SBML Level 1, in which mathematical formulas were written in text-string form.
boolean
:
true if the mathematical formula for this Rule is
set, false otherwise.
Note: The attribute "formula" is specific to SBML Level 1; in higher Levels of SBML, it has been replaced with a subelement named "math". However, libSBML provides a unified interface to the underlying math expression and this method can be used for models of all Levels of SBML.
Get the value of the "variable" attribute of this Rule object.
The "variable" attribute of a Rule indicates the element which the results of the "math" are to be applied. An AlgebraicRule has no "variable", and will always return an empty string.
string
:
the identifier string stored as the "variable" attribute value
in this Rule, or NULL if this object is an AlgebraicRule object, or if
the attribute is unset.
Unsets the value of the "variable" attribute of this Rule object.
Calculates and returns a UnitDefinition that expresses the units of measurement assumed for the "math" expression of this Rule.
UnitDefinition
:
a UnitDefinition that expresses the units of the math
expression of this Rule, or NULL if one cannot be constructed.
Predicate returning true if the math expression of this Rule contains parameters/numbers with undeclared units.
boolean
:
true if the math expression of this Rule includes
parameters/numbers with undeclared units, false otherwise.
Note: A return value of true indicates that the UnitDefinition returned by getDerivedUnitDefinition() may not accurately represent the units of the expression.
Predicate returning true if this Rule is an ParameterRule or equivalent.
This libSBML method works for SBML Level 1 models (where there is such a thing as an explicit ParameterRule), as well as other Levels of SBML. For Levels above Level 1, this method checks the symbol being affected by the rule, and returns true if the symbol is the identifier of a Parameter object defined in the model.
boolean
:
true if this Rule is a ParameterRule, false
otherwise.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Returns the nth plug-in object (extension interface) for an SBML Level 3 package extension.
If no such plugin exists, NULL is returned.
Note: To get a plugin corresponding to a given id, use the findPlugin method. Calling Model.findPlugin("fbc") will return an FbcModelPlugin; calling Parameter.findPlugin("comp") will return CompSBasePlugin, etc. However, these instances must be cast to the derived type using castObject
(number)
the index of the plug-in to return
SBasePlugin
:
the nth plug-in object (the libSBML extension interface) of a
package extension.
If the index n is invalid, NULL is returned.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
SBML Level 2 Versions 2–4 and SBML Level 3 provide two ways of assigning initial values to entities in a model. The simplest and most basic is to set the values of the appropriate attributes in the relevant components; for example, the initial value of a model parameter (whether it is a constant or a variable) can be assigned by setting its "value" attribute directly in the model definition. However, this approach is not suitable when the value must be calculated, because the initial value attributes on different components such as species, compartments, and parameters are single values and not mathematical expressions. In those situations, the InitialAssignment construct can be used; it permits the calculation of the value of a constant or the initial value of a variable from the values of other quantities in a model.
As explained below, the provision of InitialAssignment does not mean that models necessarily must use this construct when defining initial values of quantities in a model. If a value can be set directly using the relevant attribute of a component in a model, then that approach may be more efficient and more portable to other software tools. InitialAssignment should be used when the other mechanism is insufficient for the needs of a particular model.
The InitialAssignment construct has some similarities to AssignmentRule. The main differences are: (a) an InitialAssignment can set the value of a constant whereas an AssignmentRule cannot, and (b) unlike AssignmentRule, an InitialAssignment definition only applies up to and including the beginning of simulation time, i.e., t <= 0, while an AssignmentRule applies at all times.
InitialAssignment has a required attribute, "symbol", whose value must follow the guidelines for identifiers described in the %SBML specification (e.g., Section 3.3 in the Level 2 Version 4 specification). The value of this attribute in an InitialAssignment object can be the identifier of a Compartment, Species, SpeciesReference (in SBML Level 3), global Parameter, or (as of SBML Level 3 Version 2) the identifier of a SBML Level 3 package element with mathematical meaning. The InitialAssignment defines the initial value of the constant or variable referred to by the "symbol" attribute. (The attribute's name is "symbol" rather than "variable" because it may assign values to constants as well as variables in a model.) Note that an initial assignment cannot be made to reaction identifiers, that is, the "symbol" attribute value of an InitialAssignment cannot be an identifier that is the "id" attribute value of a Reaction object in the model. This is identical to a restriction placed on rules.
InitialAssignment also has a "math" subelement that contains a MathML expression used to calculate the value of the constant or the initial value of the variable. This subelement is required in SBML Level 2 and SBML Level 3 Version 1, but the requirement was relaxed in SBML Level 3 Version 2, making it optional. The units of the value computed by the formula in the "math" subelement should (in SBML Level 2 Version 4 and in SBML Level 3) or must (in previous Versions) be identical to be the units associated with the identifier given in the "symbol" attribute. (That is, the units are the units of the species, compartment, or parameter, as appropriate for the kind of object identified by the value of "symbol".)
InitialAssignment was introduced in SBML Level 2 Version 2. It is not available in SBML Level 2 Version 1 nor in any version of Level 1.
The value calculated by an InitialAssignment object overrides the value assigned to the given symbol by the object defining that symbol. For example, if a compartment's "size" attribute is set in its definition, and the model also contains an InitialAssignment having that compartment's identifier as its "symbol" attribute value, then the interpretation is that the "size" assigned in the Compartment object should be ignored and the value assigned based on the computation defined in the InitialAssignment. Initial assignments can take place for Compartment, Species, global Parameter, SpeciesReference (in Level 3), and SBML Level 3 package elements (in Level 3 Version 2), regardless of the value of their "constant" attribute.
The actions of all InitialAssignment objects are in general terms the same, but differ in the precise details depending on the type of variable being set:
In the case of a species, an InitialAssignment sets the referenced species' initial quantity (concentration or amount of substance) to the value determined by the formula in the "math" subelement. The overall units of the formula should (in SBML Level 2 Version 4 and in SBML Level 3) or must (in previous Versions) be the same as the units specified for the species.
In the case of a compartment, an InitialAssignment sets the referenced compartment's initial size to the size determined by the formula in "math". The overall units of the formula should (in SBML Level 2 Version 4 and in SBML Level 3) or must (in previous Versions) be the same as the units specified for the size of the compartment.
In the case of a parameter, an InitialAssignment sets the referenced parameter's initial value to that determined by the formula in "math". The overall units of the formula should (in SBML Level 2 Version 4 and SBML Level 3) or must (in previous Versions) be the same as the units defined for the parameter.
(For SBML Level 3 only) In the case of a species reference, an initial assignment sets the initial value of the stoichiometry of the referenced reactant or product to the value determined by the formula in "math". The unit associated with the value produced by the "math" formula should be consistent with the unit "dimensionless", because reactant and product stoichiometries in reactions are dimensionless quantities.
(For SBML Level 3 Version 2 only) In the case of an object from an SBML Level 3 package, an InitialAssignment sets the referenced object's initial value (however such values are defined by the package) to the value of the formula in math. The unit of measurement associated with the value produced by the formula should be the same as that object's units attribute value (if it has such an attribute), or be equal to the units of model components of that type (if objects of that class are defined by the package as having the same units).
If the symbol attribute of an InitialAssignment object references an object in an SBML namespace that is not understood by the interpreter reading a given SBML document (that is, if the object is defined by an SBML Level 3 package that the software does not support), the assignment must be ignored--the object's initial value will not need to be set, as the interpreter could not understand that package. If an interpreter cannot establish whether a referenced object is missing from the model or instead is defined in an SBML namespace not understood by the interpreter, it may produce a warning to the user. (The latter situation may only arise if an SBML package is present in the SBML document with a package:required attribute of "true".)
In the context of a simulation, initial assignments establish values that are in effect prior to and including the start of simulation time, i.e., t <= 0. Section 3.4.8 in the SBML Level 2 Version 4 and SBML Level 3 specifications provides information about the interpretation of assignments, rules, and entity values for simulation time up to and including the start time t = 0; this is important for establishing the initial conditions of a simulation if the model involves expressions containing the delay "csymbol".
There cannot be two initial assignments for the same symbol in a model; that is, a model must not contain two or more InitialAssignment objects that both have the same identifier as their "symbol" attribute value. A model must also not define initial assignments and assignment rules for the same entity. That is, there cannot be both an InitialAssignment and an AssignmentRule for the same symbol in a model, because both kinds of constructs apply prior to and at the start of simulated time---allowing both to exist for a given symbol would result in indeterminism).
The ordering of InitialAssignment objects is not significant. The combined set of InitialAssignment, AssignmentRule and KineticLaw objects form a set of assignment statements that must be considered as a whole. The combined set of assignment statements should not contain algebraic loops: a chain of dependency between these statements should terminate. (More formally, consider the directed graph of assignment statements where nodes are a model's assignment statements and directed arcs exist for each occurrence of a symbol in an assignment statement "math" attribute. The directed arcs in this graph start from the statement assigning the symbol and end at the statement that contains the symbol in their math elements. Such a graph must be acyclic.)
Finally, it is worth being explicit about the expected behavior in the following situation. Suppose (1) a given symbol has a value x assigned to it in its definition, and (2) there is an initial assignment having the identifier as its "symbol" value and reassigning the value to y, and (3) the identifier is also used in the mathematical formula of a second initial assignment. What value should the second initial assignment use? It is y, the value assigned to the symbol by the first initial assignment, not whatever value was given in the symbol's definition. This follows directly from the behavior described above: if an InitialAssignment object exists for a given symbol, then the symbol's value is overridden by that initial assignment.
Unsets the "symbol" attribute value of this InitialAssignment.
Calculates and returns a UnitDefinition that expresses the units of measurement assumed for the "math" expression of this InitialAssignment.
UnitDefinition
:
a UnitDefinition that expresses the units of the math
expression of this InitialAssignment, or NULL if one cannot be constructed.
Predicate returning true if the math expression of this InitialAssignment contains parameters/numbers with undeclared units.
boolean
:
true if the math expression of this InitialAssignment
includes parameters/numbers
with undeclared units, false otherwise.
Note: A return value of true indicates that the UnitDefinition returned by InitialAssignment::getDerivedUnitDefinition may not accurately represent the units of the expression.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Returns the nth plug-in object (extension interface) for an SBML Level 3 package extension.
If no such plugin exists, NULL is returned.
Note: To get a plugin corresponding to a given id, use the findPlugin method. Calling Model.findPlugin("fbc") will return an FbcModelPlugin; calling Parameter.findPlugin("comp") will return CompSBasePlugin, etc. However, these instances must be cast to the derived type using castObject
(number)
the index of the plug-in to return
SBasePlugin
:
the nth plug-in object (the libSBML extension interface) of a
package extension.
If the index n is invalid, NULL is returned.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
The SBML Level 2 and Level 3 specifications define a simple format for annotating models when (a) referring to controlled vocabulary terms and database identifiers that define and describe biological and biochemical entities, and (b) describing the creator of a model and the model's modification history. This SBML format is a concrete syntax that conforms to the guidelines of MIRIAM ("Minimum Information Requested in the Annotation of biochemical Models", Nature Biotechnology, vol. 23, no. 12, Dec. 2005). The format uses a subset of W3C RDF (Resource Description Format). In order to help application developers work with annotations in this format, libSBML provides several helper classes that provide higher-level interfaces to the data elements; these classes include CVTerm, ModelCreator, ModelHistory, RDFAnnotationParser, and Date.
Annotations that refer to controlled vocabularies are managed in libSBML
using CVTerm objects. The relation-resource pairs discussed in the
previous section are the "controlled vocabulary" terms that CVTerm is
designed to store and manipulate. A set of RDF-based annotations attached
to a given SBML <annotation>
element are read by
RDFAnnotationParser and converted into a list of these CVTerm objects.
Each CVTerm object instance stores the following components of an
annotation:
The qualifier, which can be a BioModels.net "biological qualifier", a BioModels.net "model qualifier", or an unknown qualifier (as far as the CVTerm class is concerned). Qualifiers are used in MIRIAM to indicate the nature of the relationship between the object being annotated and the resource. In CVTerm, the qualifiers can be manipulated using the methods CVTerm.getQualifierType(), CVTerm.setQualifierType(), and related methods.
The resource, represented by a URI (which, we must remind developers, is not the same as a URL). In the CVTerm class, the resource component can be manipulated using the methods CVTerm.addResource() and CVTerm.removeResource().
Note that a CVTerm contains a single qualifier, but possibly more than one resource. This corresponds to the possibility of an annotation that points to multiple resources, all of which are qualified by the same BioModels.net qualifier. The CVTerm object class supports this by supporting a list of resources.
Detailed explanations of the qualifiers defined by BioModels.net can be found at http://co.mbine.org/standards/qualifiers.
See the libSBML C++ docs for this class.
Adds a resource reference to this CVTerm object.
The specific RDF element used in this SBML format for referring to
external entities is <rdf:Description>, with a
<rdf:Bag>
element containing one or more
<rdf:li>
elements. Each such element refers to a
data item in an external resource; the resource and data item are
together identified uniquely using a URI.
<rdf:Description rdf:about="#meta id">
HISTORY
<RELATION_ELEMENT>
<rdf:Bag>
<rdf:li rdf:resource="resource URI" />
...
</rdf:Bag>
</RELATION_ELEMENT>
...
</rdf:Description>
In the template above, the placeholder meta id
stands for the
element's meta identifier, which is a field available on all SBML
components derived from the SBase base object class. The dotted portions are
optional, and the ellipses ...
are placeholders for zero or
more elements of the same form as the immediately preceding element.
The placeholder
RELATION_ELEMENT
refers to a BioModels.net qualifier element
name. This is an element in either the XML namespace
http://biomodels.net/model-qualifiers
(for model
qualifiers) or http://biomodels.net/biology-qualifiers
(for biological qualifier).
The resource URI
is a required data value that uniquely identifies a
resource and data within that resource to which the annotation refers.
The present method allows callers to add a reference to a resource URI
with the same relationship to the enclosing SBML object. (In other
words, the argument to this method is a resource URI
as shown in the
XML fragment above.) Resources are stored in this CVTerm object
within an XMLAttributes object.
The relationship of this CVTerm to the enclosing SBML object can be determined using the CVTerm methods such as CVTerm.getModelQualifierType() and CVTerm.getBiologicalQualifierType().
(string)
a string representing the URI of the resource and data
item being referenced eg
http://www.geneontology.org/#GO:0005892
Returns the number of resources for this CVTerm object.
The fragment above illustrates that there can be more than one resource referenced by a given relationship annotation (i.e., the resource URI values associated with a particular RELATION_ELEMENT). The present method returns a count of the resources stored in this CVTerm object.
number
:
the number of resources in the set of XMLAttributes
of this CVTerm
Returns the value of the nth resource for this CVTerm object.
The fragment above illustrates that there can be more than one resource referenced by a given relationship annotation (i.e., the resource URI values associated with a particular RELATION_ELEMENT). LibSBML stores all resource URIs in a single CVTerm object for a given relationship. Callers can use CVTerm.getNumResources() to find out how many resources are stored in this CVTerm object, then call this method to retrieve the nth resource URI.
(number)
the index of the resource to query.
any
:
string representing the value of the nth resource
in the set of XMLAttributes of this CVTerm
Removes a resource URI from the set of resources stored in this CVTerm object.
(string)
a string representing the resource URI to remove, eg
http://www.geneontology.org/#GO:0005892
.
Returns the qualifier type of this CVTerm object.
The placeholder
RELATION_ELEMENT refers to a BioModels.net qualifier
element name. This is an element in either the XML namespace
http://biomodels.net/model-qualifiers
(for model
qualifiers) or http://biomodels.net/biology-qualifiers
(for biological qualifier). The present method returns a code
identifying which one of these two relationship namespaces is being
used; any other qualifier in libSBML is considered unknown (as far as
the CVTerm class is concerned). Consequently, this method will return
one of the following values:
libsbml.MODEL_QUALIFIER
libsbml.BIOLOGICAL_QUALIFIER
libsbml.UNKNOWN_QUALIFIER
The specific relationship of this CVTerm to the enclosing SBML object can be determined using the CVTerm methods such as CVTerm.getModelQualifierType() and CVTerm.getBiologicalQualifierType(). Callers will typically want to use the present method to find out which one of the other two methods to call to find out the specific relationship.
QualifierType_t
:
the qualifier type
of this object or
libsbml.UNKNOWN_QUALIFIER
(the default).
Sets the qualifier code of this CVTerm object.
(QualifierType_t)
the qualifier type
Returns the biological qualifier type of this CVTerm object.
The placeholder
RELATION_ELEMENT refers to a BioModels.net qualifier element
name. This is an element in either the XML namespace
http://biomodels.net/model-qualifiers
(for model
qualifiers) or http://biomodels.net/biology-qualifiers
(for biological qualifier). Callers will typically use
CVTerm::getQualifierType() to find out the type of qualifier relevant to
this particular CVTerm object, then if it is a biological qualifier,
use the present method to determine the specific qualifier.
Annotations with biological qualifiers express a relationship between an annotation resource and the biological concept represented by a given object in the model. The diagram below illustrates the relationship in this case:
The set of known biological qualifiers is, at the time of this libSBML release, the following:
libsbml.BQB_IS
libsbml.BQB_HAS_PART
libsbml.BQB_IS_PART_OF
libsbml.BQB_IS_VERSION_OF
libsbml.BQB_HAS_VERSION
libsbml.BQB_IS_HOMOLOG_TO
libsbml.BQB_IS_DESCRIBED_BY
libsbml.BQB_IS_ENCODED_BY
libsbml.BQB_ENCODES
libsbml.BQB_OCCURS_IN
libsbml.BQB_HAS_PROPERTY
libsbml.BQB_IS_PROPERTY_OF
libsbml.BQB_HAS_TAXON
Any other BioModels.net qualifier found in the model is considered unknown by libSBML and reported as libsbml.BQB_UNKNOWN.
BiolQualifierType_t
:
the biology qualifier type
of this object or
libsbml.BQB_UNKNOWN
(the default).
Sets the biology qualifier type of this CVTerm object.
(BiolQualifierType_t)
the biology
qualifier type.
Note: If the Qualifier Type of this object is not libsbml.BIOLOGICAL_QUALIFIER, then the biology qualifier type will default to libsbml.BQB_UNKNOWN.
Returns the model qualifier type of this CVTerm object.
The placeholder
RELATION_ELEMENT refers to a BioModels.net qualifier
element name. This is an element in either the XML namespace
http://biomodels.net/model-qualifiers
(for model
qualifiers) or http://biomodels.net/biology-qualifiers
(for biological qualifier). Callers will typically use
CVTerm::getQualifierType() to find out the type of qualifier relevant to this
particular CVTerm object, then if it is a model qualifier, use the
present method to determine the specific qualifier.
Annotations with model qualifiers express a relationship between an annotation resource and the modeling concept represented by a given object in the model. The diagram below illustrates the relationship in this case:
ModelQualifierType_t
:
the model qualifier
of this object or libsbml.BQM_UNKNOWN
(the default).
Sets the model qualifier type of this CVTerm object.
(ModelQualifierType_t)
the model qualifier type.
Note: If the qualifier type of this object is not libsbml.MODEL_QUALIFIER, then the then the model qualifier typ will default to libsbml.BQM_UNKNOWN.
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; please consult the SBML specification document corresponding to the SBML Level and Version of your model for more information about the requirements for "notes" content.
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 not meant to be shown to humans. The element's content type is XML type "any", 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. As is the case with "notes", it is important to refer to the SBML specification document corresponding to the SBML Level and Version of your model for more information about the requirements for "annotation" content.
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.
SBML Level 2 introduced an optional SBase 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 2, SBase 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 long, and SBO identifiers are stored simply as integers. (For convenience, SBase offers methods for returning both the integer form and a text-string form of the SBO identifier.) 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". More details can be found in SBML specifications for Level 2 Version 2 and above.
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.
See the libSBML C++ docs for this class.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Returns the nth plug-in object (extension interface) for an SBML Level 3 package extension.
If no such plugin exists, NULL is returned.
Note: To get a plugin corresponding to a given id, use the findPlugin method. Calling Model.findPlugin("fbc") will return an FbcModelPlugin; calling Parameter.findPlugin("comp") will return CompSBasePlugin, etc. However, these instances must be cast to the derived type using castObject
(number)
the index of the plug-in to return
SBasePlugin
:
the nth plug-in object (the libSBML extension interface) of a
package extension.
If the index n is invalid, NULL is returned.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
This class of objects is defined by libSBML only and has no direct equivalent in terms of SBML components. This class is not prescribed by the SBML specifications, although it is used to implement features defined in SBML.
The SBasePlugin class is libSBML's base class for extensions of core SBML component objects. SBasePlugin defines basic virtual methods for reading/writing/checking additional attributes and/or subobjects; these methods should be overridden by subclasses to implement the necessary features of an extended SBML object.
Returns the XML namespace URI for the package to which this object belongs.
In the XML representation of an SBML document, XML namespaces are used to identify the origin of each XML construct used. XML namespaces are identified by their unique resource identifiers (URIs). The core SBML specifications stipulate the namespaces that must be used for core SBML constructs; for example, all XML elements that belong to SBML Level 3 Version 1 Core must be placed in the XML namespace identified by the URI "http://www.sbml.org/sbml/level3/version1/core". Individual SBML Level 3 packages define their own XML namespaces; for example, all elements belonging to the SBML Level 3 Layout Version 1 package must be placed in the XML namespace "http://www.sbml.org/sbml/level3/version1/layout/version1/".
This method first looks into the SBMLNamespaces object possessed by the parent SBMLDocument object of the current object. If this cannot be found, this method returns the result of getElementNamespace().
string
:
a string, the URI of the XML namespace to which this object belongs.
libSBML uses the global function SBML_parseL3Formula for parsing formulae, but libsbml.js only exposes C++ types, not functions. This helper class can be used in lieu of SBML_parseL3Formula.
See the libSBML C++ docs for SBML_parseL3Formula.
new libsbml.SBMLFormulaParser().parseL3Formula('S1*S2') // returns the expected AST with a product node and two leaf nodes
Converts a MathML string to a libsbml ASTNode representation using the libsbml method readMathMLFromString.
(string)
a string of the MathML to convert
ASTNode
:
the root AST node of the formula
The LineSegment class consists of the mandatory attribute xsi:type and two child elements of type Point. One is called 'start' and represents the starting point of the line, the other is called 'end' and represents the endpoint of the line. The LineSegment class is also the base class for CubicBezier, which represent curved lines instead of straight ones.
Initializes the start point with a copy of the given Point object.
(any)
Initializes the end point with a copy of the given Point object.
(any)
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Returns the nth plug-in object (extension interface) for an SBML Level 3 package extension.
If no such plugin exists, NULL is returned.
Note: To get a plugin corresponding to a given id, use the findPlugin method. Calling Model.findPlugin("fbc") will return an FbcModelPlugin; calling Parameter.findPlugin("comp") will return CompSBasePlugin, etc. However, these instances must be cast to the derived type using castObject
(number)
the index of the plug-in to return
SBasePlugin
:
the nth plug-in object (the libSBML extension interface) of a
package extension.
If the index n is invalid, NULL is returned.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
In order to be able to represent smooth curves the “layout” package defines the class CubicBezier. It represents a Bezier curve, and is readily available in most graphics APIs. The class CubicBezier is derived from LineSegment. It consists of four elements: the two inherited elements 'start' and 'end', which specify the starting point and the endpoint of the cubic bezier curve, and two elements 'basePoint1' and 'basePoint2', which specify the two additional base points that are needed to describe a cubic bezier curve.
Initializes the start point with a copy of the given Point object.
(any)
Initializes the end point with a copy of the given Point object.
(any)
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Returns the nth plug-in object (extension interface) for an SBML Level 3 package extension.
If no such plugin exists, NULL is returned.
Note: To get a plugin corresponding to a given id, use the findPlugin method. Calling Model.findPlugin("fbc") will return an FbcModelPlugin; calling Parameter.findPlugin("comp") will return CompSBasePlugin, etc. However, these instances must be cast to the derived type using castObject
(number)
the index of the plug-in to return
SBasePlugin
:
the nth plug-in object (the libSBML extension interface) of a
package extension.
If the index n is invalid, NULL is returned.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
The Curve class describes how to connect elements in a diagram defined with the use of the “layout” package. A curve is fully specified by a mandatory listOfCurveSegments element and is used in four places in the “layout” package:
SpeciesReferenceGlyph: Here it describes a curve from/to the center piece of the parent ReactionGlyph to/from the SpeciesGlyph it represents.
ReactionGlyph: Here it describes a curve for the center piece of a reaction.
ReferenceGlyph: Here it describes a curve from/to the center piece of the parent GeneralGlyph to/from the glyph it represents.
GeneralGlyph: Here it describes a curve for the center piece of an additional relationship.
In the text above, the term 'center piece' refers to either the Curve element of a ReactionGlyph, or its BoundingBox.
Creates a new CubicBezier and adds it to the end of the list. A reference to the new CubicBezier object is returned.
CubicBezier
:
the CubicBezier created as a new child "curveSegment" of
this Curve.
Creates a new LineSegment and adds it to the end of the list. A reference to the new LineSegment object is returned.
LineSegment
:
the LineSegment created as a new child "curveSegment"
of this Curve.
Returns a pointer to the curve segment with the given index. If the index is invalid, @c NULL is returned.
(number)
the index value of the curve segment to return
LineSegment
:
the LineSegment representing the child "curveSegment"
with the appropriate @p index, or @c NULL if no such LineSegment
exists.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Returns the nth plug-in object (extension interface) for an SBML Level 3 package extension.
If no such plugin exists, NULL is returned.
Note: To get a plugin corresponding to a given id, use the findPlugin method. Calling Model.findPlugin("fbc") will return an FbcModelPlugin; calling Parameter.findPlugin("comp") will return CompSBasePlugin, etc. However, these instances must be cast to the derived type using castObject
(number)
the index of the plug-in to return
SBasePlugin
:
the nth plug-in object (the libSBML extension interface) of a
package extension.
If the index n is invalid, NULL is returned.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
The Layout class stores layout information for some or all elements of the SBML model as well as additional objects that need not be connected to the model. The Layout has two attributes: id and name. Additionally, a Dimensions element specifies the size of the layout. The actual layout elements are contained in several lists, namely: a ListOfCompartmentGlyphs, a ListOfSpeciesGlyphs, a ListOfReactionGlyphs, a ListOfTextGlyphs, and a ListOfAdditionalGraphicalObjects. Each of these lists can only occur once, and, if present, are not allowed to be empty.
Returns the dimensions of the layout.
Dimensions
:
Sets the dimensions of the layout.
Creates a GraphicalObject object, adds it to the end of the additional graphical objects list and returns a pointer to the newly created object.
GraphicalObject
:
Creates a CompartmentGlyph object, adds it to the end of the compartment glyph objects list and returns a pointer to the newly created object.
CompartmentGlyph
:
Creates a new CubicBezier for the Curve object of the last ReactionGlyph or the last SpeciesReferenceGlyph in the last ReactionGlyph and adds it to its list of SpeciesReferenceGlyph objects. A pointer to the newly created object is returned.
CubicBezier
:
Creates a GeneralGlyph object, adds it to the end of the additional objects list and returns a reference to the newly created object.
GeneralGlyph
:
Creates a new LineSegment for the Curve object of the last ReactionGlyph or the last SpeciesReferenceGlyph in the last ReactionGlyph and adds it to its list of SpeciesReferenceGlyph objects. A pointer to the newly created object is returned.
LineSegment
:
Creates a ReactionGlyph object, adds it to the end of the reaction glyph objects list and returns a pointer to the newly created object.
ReactionGlyph
:
Creates a SpeciesGlyph object, adds it to the end of the species glyph objects list and returns a pointer to the newly created object.
SpeciesGlyph
:
Creates a new SpeciesReferenceGlyph for the last ReactionGlyph and adds it to its list of SpeciesReferenceGlyph objects. A pointer to the newly created object is returned.
Returns the number of text glyphs for the layout.
Returns the additional graphical object that has the given id, or NULL if no graphical object has the id.
(number)
GraphicalObject
:
Returns the compartment glyph that has the given id, or NULL if no compartment glyph has the id.
(number)
CompartmentGlyph
:
Returns the general glyph that has the given id, or NULL if no graphical object has the id.
(number)
GeneralGlyph
:
Returns the reaction glyph that has the given id, or NULL if no reaction glyph has the id.
(number)
ReactionGlyph
:
Returns the species glyph that has the given id, or NULL if no species glyph has the id.
SpeciesGlyph
:
Removes the graphical object with the given index from the layout. A pointer to the graphical object that was removed is returned. If no graphical object has been removed, NULL is returned.
(number)
GraphicalObject
:
Removes the compartment glyph with the given index from the layout. A pointer to the compartment glyph that was removed is returned. If no compartment glyph has been removed, NULL is returned.
(number)
CompartmentGlyph
:
Removes the reaction glyph with the given index from the layout. A pointer to the reaction glyph that was removed is returned. If no reaction glyph has been removed, NULL is returned.
(number)
ReactionGlyph
:
Removes the species glyph with the given index from the layout. A pointer to the species glyph that was removed is returned. If no species glyph has been removed, NULL is returned.
SpeciesGlyph
:
Remove the species reference glyph with the given id. A pointer to the removed species reference glyph is returned. If no species reference glyph has been removed, NULL is returned.
(string)
SpeciesReferenceGlyph
:
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
A dimension is specified via the required attributes width, height, and an optional attribute depth, all of which are of type double. If the attribute depth is not specified, the object is a two dimensional object. The width attribute of Dimensions specifies the size of the object in the direction of the positive x axis, the height attribute specifies the size of the object along the positive y axis and the depth attribute specifies the size of the object along the positive z axis. All sizes for Dimensions objects are positive values, and so the attributes are not allowed to take negative values. The Dimensions class also has an optional attribute id of type SId. While not used in the “layout” package, it can be used by programs to refer to the elements.
Sets the height to the given value.
(any)
{number} the height to use
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
A point is specified via the required attributes 'x', 'y' and an optional attribute 'z', all of which are of type double. If the attribute z is not specified, the object is a two dimensional object. The Point class also has an optional attribute id of type SId. While not used in the "layout" package, it can be used by programs to refer to the elements.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
Constructor which sets the id, the coordinates and the dimensions to the given 2D values.
(FOR BACKWARD COMPATIBILITY)
Returns the dimensions of the BoundingBox as const reference to a Dimensions object.
any
:
the Dimensions representing the dimensions.
Sets the dimensions to a copy of the Dimensions object given.
(Dimensions)
the Dimensions to use
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
All the more specific layout elements (CompartmentGlyph, GeneralGlyph, SpeciesGlyph, ReactionGlyph, ReferenceGlyph, TextGlyph, and SpeciesReferenceGlyph) are derived from the class GraphicalObject. Each object of class GraphicalObject has a mandatory BoundingBox, which specifies the position and the size of the object. While GraphicalObject is the base class for most elements in the “layout” package, it is not an abstract class. It can be instantiated when used in the listOfAdditionalGraphicalObjects to describe additional elements and relationships. Since it only describes a BoundingBox, programs are encouraged to add Annotation objects that describe program-specific graphical information.
Returns the bounding box for the GraphicalObject.
BoundingBox
:
Sets the boundingbox for the GraphicalObject.
(BoundingBox)
The bounding box
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
Unsets the compartment order.
Returns the bounding box for the GraphicalObject.
BoundingBox
:
Sets the boundingbox for the GraphicalObject.
(BoundingBox)
The bounding box
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
The GeneralGlyph is used to facilitate the representation of elements other than Compartment, Species and Reaction and thus can be used for the display of relationships of Rule or elements defined by other SBML packages. It closely follows the structure of the ReactionGlyph. GeneralGlyph is defined to have an optional attribute reference as well as the elements curve, listOfReferenceGlyphs and listOfSubGlyphs.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
Analogous to how a Reaction object has to at least have one reactant or product, the ReactionGlyph has to at least have one SpeciesReferenceGlyph stored in the ListOfSpeciesReferenceGlyphs. Figure 12 on the following page provides the UML diagram for the class definition. The ReactionGlyph inherits from GraphicalObject. In addition to the attributes inherited from GraphicalObject, the ReactionGlyph is described by an attribute reaction, a Curve element and a listOfSpeciesReferenceGlyphs element. The Curve describes the center section of a ReactionGlyph. The center section is frequently used by tools to separate the point where substrates arcs come together, from the point where product arcs split off. The Curve is optional, and when not present the dimensions of the inherited BoundingBox describes the center section, by storing its position and dimension.
Returns {boolean} true if the id of the associated reaction is not the empty string.
Returns the number of species reference glyph objects.
Returns the species reference glyph with the given @p index. If the index is invalid, NULL is returned.
SpeciesReferenceGlyph
:
Creates a new SpeciesReferenceGlyph object, adds it to the end of the list of species reference objects and returns a reference to the newly created object.
SpeciesReferenceGlyph
:
Creates a new LineSegment object, adds it to the end of the list of curve segment objects of the curve and returns a reference to the newly created object.
LineSegment
:
Creates a new CubicBezier object, adds it to the end of the list of curve segment objects of the curve and returns a reference to the newly created object.
CubicBezier
:
Returns the curve object for the reaction glyph
Sets the curve object for the reaction glyph.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
In addition to the attributes it inherits from GraphicalObject, the SpeciesGlyph object has an optional 'species' attribute.
Returns the bounding box for the GraphicalObject.
BoundingBox
:
Sets the boundingbox for the GraphicalObject.
(BoundingBox)
The bounding box
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
The SpeciesReferenceGlyph element describes the graphical connection between a SpeciesGlyph and a ReactionGlyph (which would be an arrow or some curve in most cases). A SpeciesReferenceGlyph inherits from GraphicalObject, and adds a mandatory attribute 'speciesGlyph' and two optional attributes 'speciesReference' and 'role'. Optionally, the SpeciesReferenceGlyph also has a child element 'curve'.
If the curve is specified, it overrides the inherited bounding box.
Creates a new CubicBezier object, adds it to the end of the list of curve segment objects of the curve and returns a reference to the newly created object.
CubicBezier
:
Creates a new LineSegment object, adds it to the end of the list of curve segment objects of the curve and returns a reference to the newly created object.
LineSegment
:
Returns the id of the associated SpeciesGlyph.
Sets the id of the associated species glyph.
Returns the id of the associated species reference.
Sets the id of the associated species reference.
Returns the role.
SpeciesReferenceRole_t
:
Sets the role.
Returns the bounding box for the GraphicalObject.
BoundingBox
:
Sets the boundingbox for the GraphicalObject.
(BoundingBox)
The bounding box
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
The TextGlyph class describes the position and dimension of text labels in the “layout” package. It inherits from GraphicalObject and adds the attributes graphicalObject, text and originOfText.
Sets the id of the associated graphical object.
Sets the id of the origin of text.
Returns the bounding box for the GraphicalObject.
BoundingBox
:
Sets the boundingbox for the GraphicalObject.
(BoundingBox)
The bounding box
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
Plugin subclass for the layout extension.
Returns the ListOfLayouts object for this Model.
ListOfLayouts
:
the ListOfLayouts object for this Model.
The layout extension.
Returns the XML namespace URI of the SBML Level 2 version of the package implemented by this libSBML Extension.
Unique among the SBML Level 3 packages, the Layout package existed and was in widespread use prior to the introduction of SBML Level 3. The Layout package was used as model annotations in SBML Level 2. This method returns the SBML annotation XML namespace used for Level 2.
string
:
the XML namespace as a string.
Returns URI of supported versions of this package.
The FluxBound class of objects is used in Version 1 of the SBML Level 3 fbc ("fbc") package to express a single (in)equality that provides the maximum or minimum value that a reaction flux can obtain at steady state. (This same information is encoded differently in Version 2 of "fbc"; see the "upperFluxBound" and "lowerFluxBound" attributes on FbcReactionPlugin.)
In addition to the common optional attributes "id" and "name", FluxBound takes three required attributes: "reaction", "operation" and "value". These three attributes define the meaning of the FluxBound, and are interpreted using the following expression:
reaction operator value
The "reaction" attribute takes a value of SIdRef
. The value
must be the identifier of a Reaction object defined within the enclosing
model.
The "operation" attribute takes a value from
FluxBoundOperation_t representing
different mathematical inequalities. Possible values for "operation" include
greaterEqual
, equal
, and others.
The "value" attribute takes a numerical value of type double
,
and represents the value of the flux bound. The permitted values include
positive infinity (INF
) and negative infinity
(-INF
).
The following is an example of a set of flux bounds encoded in this form; it also demonstrates the use of ListOfFluxBounds.
<fbc:listOfFluxBounds>
<fbc:fluxBound fbc:id="R1b" fbc:reaction="R1" fbc:operation="greaterEqual" fbc:value="1.2"/>
<fbc:fluxBound fbc:id="R2b" fbc:reaction="R2" fbc:operation="lessEqual" fbc:value="-1.2"/>
<fbc:fluxBound fbc:id="R3b" fbc:reaction="R3" fbc:operation="greaterEqual" fbc:value="-INF"/>
<fbc:fluxBound fbc:id="R4b" fbc:reaction="R4" fbc:operation="lessEqual" fbc:value="INF"/>
<fbc:fluxBound fbc:id="R5b" fbc:reaction="R5" fbc:operation="equal" fbc:value="1"/>
</fbc:listOfFluxBounds>
Note: This class is only defined for Version 1 of the "fbc" package specification. It was replaced in Version 2 by a Parameter referenced by the "upperFluxBound" or "lowerFluxBound" attributes on an FbcReactionPlugin. FluxBound is therefore not used for Version 2 "fbc" models.
Returns the value of the "reaction" attribute of this FluxBound object.
any
:
the value of the "reaction" attribute of this FluxBound object.
Predicate returning true if this FluxBound's "reaction" attribute is set.
any
:
true if this FluxBound object's "reaction" attribute has been
set, otherwise false is returned.
Sets the value of the "reaction" attribute of this FluxBound object.
Unsets the value of the "reaction" attribute of this FluxBound object.
Returns the value of the "operation" attribute of this FluxBound object.
FluxBoundOperation_t
:
the value of the "operation" attribute of this FluxBound object.
Sets the value of the "operation" attribute of this FluxBound object.
(FluxBoundOperation_t)
Unsets the value of the "operation" attribute of this FluxBound object.
Unsets the value of the "value" attribute of this FluxBound object.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
An integral component in a complete description of a steady-state model is the so-called objective function, which generally consists of a linear combination of model variables (fluxes) and a sense (direction). In the SBML Level 3 fbc ("fbc") package, this concept is succinctly captured in the Objective class.
The Objective class is derived from the normal SBML SBase class and inherits the "metaid" and "sboTerm" attributes, as well as the subcomponents for Annotation and Notes. To these, the Objective class adds an optional attribute named "type". The type attribute can take one of two literal values: "maximize" or "minimize". The values represent the sense of the optimality constraint for the FBC model.
The "fbc" package allows for the definition of multiple model objectives, with one being designated as active. The active objective is indicated using the attribute "activeObjective" on the ListOfObjectives object. Here is an example of the XML encoding of a model with a list of objective functions:
<fbc:listOfObjectives fbc:activeObjective="obj1"> <fbc:objective fbc:id="obj1" fbc:type="maximize"> <fbc:listOfFluxObjectives> <fbc:fluxObjective fbc:reaction="R101" fbc:coefficient="1"/> </fbc:listOfFluxObjectives> </fbc:objective> <fbc:objective fbc:id="obj2" fbc:type="minimize"> <fbc:listOfFluxObjectives> <fbc:fluxObjective fbc:reaction="R102" fbc:coefficient="-2.5"/> <fbc:fluxObjective fbc:reaction="R103" fbc:coefficient="1"/> </fbc:listOfFluxObjectives> </fbc:objective> </fbc:listOfObjectives>
Get a FluxObjective from the ListOfFluxObjectives.
(number)
the index number of the FluxObjective to get
FluxObjective
:
the nth FluxObjective in the ListOfFluxObjectives within this
Objective.
If the index n is invalid, NULL is returned.
Adds a copy the given FluxObjective to this Objective.
(FluxObjective)
the FluxObjective object to add
Get the number of FluxObjective objects in this Objective.
any
:
the number of FluxObjective objects in this Objective.
Creates a new FluxObjective object.
This method creates the FluxObjective object, adds it to this Objective object's ListOfFluxObjectives, and returns the FluxObjective object created.
FluxObjective
:
a new FluxObjective object instance.
Sets the value of the "type" attribute of this Objective.
The type must be a ObjectiveType_t value.
(ObjectiveType_t)
string value of the "type" attribute to be set. Valid values
include:
OBJECTIVE_TYPE_MAXIMIZE
,
OBJECTIVE_TYPE_MINIMIZE
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
An integral component in a complete description of a steady-state model is the so-called objective function, which generally consists of a linear combination of model variables (fluxes) and a sense (direction). In the SBML Level 3 fbc ("fbc") package, this concept is succinctly captured in the Objective class. An Objective object includes a list of flux objectives, each in the form of a FluxObjective object.
The FluxObjective class is a relatively simple container for a model variable weighted by a signed linear coefficient. In addition to the common SBML object attributes of "id" and "name" (both of which are optional), it adds two required attributes: "reaction" and "coefficient".
The "reaction" attribute must have a value of type SIdRef
,
and its value is restricted to the identifier of a Reaction object in the
model. The "reaction" attribute identifiers the reaction to which the
FluxObjective applies. The "coefficient" attribute must have a value of
type double
, and refers to the coefficient that this
FluxObjective takes in the enclosing Objective. Its unit of measurement
is dimensionless
. The meaning of these two attributes
together is given by the formula coefficient times;
reaction-flux. Since reactions in SBML Level 3 are in units of
extent, the units of a flux objective are thus extent per
time.
The following example illustrates the use of these attributes:
<fbc:listOfObjectives fbc:activeObjective="obj1">
<fbc:objective fbc:id="obj1" fbc:type="maximize">
<fbc:listOfFluxObjectives>
<fbc:fluxObjective fbc:reaction="R1" fbc:coefficient="1"/>
<fbc:fluxObjective fbc:reaction="R2" fbc:coefficient="2"/>
</fbc:listOfFluxObjectives>
</fbc:objective>
</fbc:listOfObjectives>
Unsets the value of the "reaction" attribute of this FluxObjective.
Unsets the value of the "coefficient" attribute of this FluxObjective.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
FbcAnd class is used in Version 2 of the SBML Level 3 fbc ("fbc") package to represent an "and" relationship between two or more child FbcAssociation objects. In other words, it indicates that all of the child objects are included. Note that since the FbcAssociation class is the parent class of GeneProductRef, FbcAnd and FbcOr, a given FbcAnd can potentially include nested "and"/"or" combinations of gene products.
Get the nth object from the ListOfFbcAssociations.
(number)
the index number of the FbcAssociation to get
FbcAssociation
:
the nth FbcAssociation in the ListOfFbcAssociations within this
FbcAnd.
If the index n is invalid, NULL is returned.
Adds a copy the given FbcAssociation to this FbcAnd.
(FbcAssociation)
the FbcAssociation object to add
Get the number of FbcAssociation objects in this FbcAnd.
any
:
the number of FbcAssociation objects in this FbcAnd.
Converts this FbcAssociation object into an infix string representation.
any
:
the association as infix string.
Creates a new GeneProductRef object, adds it to this FbcAnd's ListOfFbcAssociations and returns the GeneProductRef object created.
GeneProductRef
:
a new GeneProductRef object instance.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
Get a Association from the ListOfFbcAssociations.
(number)
the index number of the Association to get
FbcAssociation
:
the nth Association in the ListOfFbcAssociations within this FbcOr.
If the index n is invalid, NULL is returned.
Adds a copy the given FbcAssociation to this FbcOr.
(FbcAssociation)
the FbcAssociation object to add
Creates a new GeneProductRef object, adds it to this FbcOr's ListOfFbcAssociations and returns the GeneProductRef object created.
GeneProductRef
:
a new GeneProductRef object instance.
Removes the nth Association from the ListOfFbcAssociations within this FbcOr and returns a pointer to it.
The caller owns the returned item and is responsible for deleting it.
(FbcAssociation)
the index of the Association to remove
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
The FbcAssociation class is the abstract base class for the classes that can be used as children of the GeneProductAssociation child of a Reaction. The FbcAnd class is used when all of its children are definitely associated with the Reaction; the FbcOr class is used when at least one of its children are associated with the Reaction; and the GeneProductRef class is used to denote a particular GeneProduct.
Parses a gene association in infix format and returns a corresponding Association object.
This parses a string that has a list of gene names and conjunctions or disjunctions. For example:
(b2422) and (b2425) and (b2423) and (b2424) or (b2422) and (b2423) and (b2424) and (b2413) and (b3917)
The 'and' operator takes precedence over the 'or' operator, meaning that the above input string would turn into two groups of gene names: either "b2422, b2425, b2423, and b2424" or "b2422, b2423, b2424, b2413, and b3917". Parentheses may be added to make things more clear, and to encode alternative schemes.
This method also creates missing GeneProduct objects, in case the unique reference does not yet exist.
(string)
the string to parse
(FbcModelPlugin)
the FbcModelPlugin on which to add the geneProduct elements
(boolean)
boolean indicating whether the infix assumes identifiers (true)
or labels (false default)
(boolean)
boolean indicating whether to add missing geneProducts
(true default) or not (false)
FbcAssociation
:
the parsed association, or NULL in case of an error.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
In the SBML Level 3 @ref fbc (“fbc”) package
representation format, a GeneProduct object represents a single gene or
implied gene product. The gene or gene product is identified using the
required attribute "label", which is a text string. (This attribute is
separate from the usual SBML "id" attribute, which is used to
cross-reference entities within an SBML model.) A GeneProduct object can
also possess an optional "associatedSpecies" attribute; if this a
attribute is defined, it should have a value of type SIdRef
and be the identifier of a Species object defined in the enclosing Model.
An "associatedSpecies", if it exists, is interpreted to be a species
associated with the gene or gene product that is represented by the
GeneProduct object.
Unsets the value of the "label" attribute of this GeneProduct.
Unsets the value of the "associatedSpecies" attribute of this GeneProduct.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
In Version 2 of the SBML Level 3 fbc ("fbc") package specification, GeneProductAssociation is a class derived from SBase used to associate one more genes or gene products with reactions. GeneProductAssociation objects are essentially containers, with one such container optionally attached as a subelement to a Reaction object in a model. The container can contain one of three kinds of objects, all of which are subclasses of the libSBML parent class FbcAssociation. (Note that this class is named Association in the "fbc" Version 2 specification, but in libSBML is named FbcAssociation to avoid a name conflict with an existing class.)
One of the kinds of FbcAssociation subclasses that can appear in a GeneProductAssociation is GeneProductRef. This class of objects references a GeneProduct declared in a ListOfGeneProducts attached to the enclosing Model object. In the "fbc" approach, when more than one gene (or gene product) is present in an association, they are written as logical expressions using Boolean logical operators and and or through the classes (in libSBML) FbcAnd and FbcOr. (In the "fbc" Version 2 specification, these are simply named And and Or, respectively.) The FbcAnd and FbcOr objects in turn can contain either GeneProductRef objects or other FbcAnd and/or FbcOr objects.
Here is a concrete example of what the XML representation of a simple or relationship might look like: <reaction id = "R_ABTA" ... rest of Reaction declaration elided for this example ...> <fbc:geneProductAssociation fbc:id="ga_16"> <fbc:or> <fbc:geneProductRef fbc:geneProduct="g_b2662"/> <fbc:geneProductRef fbc:geneProduct="g_b1302"/> </fbc:or> </fbc:geneProductAssociation>
Returns the "association" element of this GeneProductAssociation.
FbcAssociation
:
the "association" element of this GeneProductAssociation.
Creates a new "association" and sets it for this GeneProductAssociation.
GeneProductRef
:
Sets the "association" element of this GeneProductAssociation.
(FbcAssociation)
FbcAssociation to be set
Unsets the value of the "name" attribute of this GeneProductAssociation.
Unsets the "association" element of this GeneProductAssociation.
GeneProductRef encodes a references to a GeneProduct object declared in a ListOfGeneProducts attached to the enclosing Model object. GeneProductRef is derived from the FbcAssociation class.
GeneProductRef objects are used to construct the content of GeneProductAssociation objects. As described more fully in the documentation of the latter, a GeneProductAssociation is a container that may contain either (i) a single GeneProductRef or (ii) a logical expression built up with FbcAnd and FbcOr and ultimately containing two or more GeneProductRef objects.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
Returns the XML namespace URI for the package to which this object belongs.
In the XML representation of an SBML document, XML namespaces are used to identify the origin of each XML construct used. XML namespaces are identified by their unique resource identifiers (URIs). The core SBML specifications stipulate the namespaces that must be used for core SBML constructs; for example, all XML elements that belong to SBML Level 3 Version 1 Core must be placed in the XML namespace identified by the URI "http://www.sbml.org/sbml/level3/version1/core". Individual SBML Level 3 packages define their own XML namespaces; for example, all elements belonging to the SBML Level 3 Layout Version 1 package must be placed in the XML namespace "http://www.sbml.org/sbml/level3/version1/layout/version1/".
This method first looks into the SBMLNamespaces object possessed by the parent SBMLDocument object of the current object. If this cannot be found, this method returns the result of getElementNamespace().
string
:
a string, the URI of the XML namespace to which this object belongs.
The FbcReactionPlugin class inherits from the SBasePlugin class, and codifies the extentions to the Reaction class defined in the @ref fbc package ("fbc"). This extention allows the modeler to define (in Version 2 of the "fbc" package) an upper and lower flux bound, with the 'upperFluxBound' and 'lowerFluxBound' attributes, as well as a way to reference any GeneProduct associated with this Reaction, through the GeneProductAssociation child.
Returns the GeneProductAssociation from this FbcReactionPlugin object.
GeneProductAssociation
:
the GeneProductAssociation from object in this FbcReactionPlugin object.
Sets the GeneProductAssociation element in this FbcReactionPlugin object.
(GeneProductAssociation)
the geneProductAssociation to be set
Creates a new GeneProductAssociation object and adds it to the FbcReactionPlugin object.
any
:
the newly created GeneProductAssociation object.
Returns the value of the "lowerFluxBound" attribute of this FbcReactionPlugin.
any
:
the value of the "lowerFluxBound" attribute of this FbcReactionPlugin as a string.
Returns the value of the "upperFluxBound" attribute of this FbcReactionPlugin.
any
:
the value of the "upperFluxBound" attribute of this FbcReactionPlugin as a string.
Unsets the value of the "lowerFluxBound" attribute of this FbcReactionPlugin.
Unsets the value of the "upperFluxBound" attribute of this FbcReactionPlugin.
Unsets the the "geneProduct" element of this FbcReactionPlugin.
Returns the XML namespace URI for the package to which this object belongs.
In the XML representation of an SBML document, XML namespaces are used to identify the origin of each XML construct used. XML namespaces are identified by their unique resource identifiers (URIs). The core SBML specifications stipulate the namespaces that must be used for core SBML constructs; for example, all XML elements that belong to SBML Level 3 Version 1 Core must be placed in the XML namespace identified by the URI "http://www.sbml.org/sbml/level3/version1/core". Individual SBML Level 3 packages define their own XML namespaces; for example, all elements belonging to the SBML Level 3 Layout Version 1 package must be placed in the XML namespace "http://www.sbml.org/sbml/level3/version1/layout/version1/".
This method first looks into the SBMLNamespaces object possessed by the parent SBMLDocument object of the current object. If this cannot be found, this method returns the result of getElementNamespace().
string
:
a string, the URI of the XML namespace to which this object belongs.
The FbcModelPlugin object is used to extend the standard SBML Model object with features used in the SBML Level 3 fbc ("fbc") package. In Version 1 of the "fbc" specification, the extended Model class has two optional subobjects: ListOfObjectives and ListOfFluxBounds. In Version 2 of the specification, the extended Model object is defined differently: it is extended with a new required attribute named "strict", and the two optional subobjects ListOfObjectives and ListOfGeneProducts. (ListOfFluxBounds is not used in Version 2.)
The mandatory attribute "strict", of type boolean
, in
Version 2 of this package, is used to
apply an additional set of restrictions to the model. The "strict"
attribute helps ensure that the Flux Balance Constraints package can be
used to encode legacy flux-balance analysis models expressible as Linear
Programs (LP's) for software that is unable to analyze arbitrary
mathematical expressions that may appear in an SBML model. In addition, a
"strict" model is fully described and mathematically consistent, for
example, by ensuring that all fluxes have a valid upper or lower bound.
The following restrictions are in effect if an "fbc" model
object has a value of true
for the attribute "strict" on
Model:
Each Reaction in a Model must define values for the attributes "lowerFluxBound" and "upperFluxBound", with each attribute pointing to a valid Parameter object defined in the current Model.
Each Parameter object referred to by the Reaction attributes
"lowerFluxBound" and "upperFluxBound" must have its "constant" attribute
set to the value true
and its "value" attribute set to a
value of type double
. This value may not be
NaN
.
SpeciesReference objects in Reaction objects must have their
"stoichiometry" attribute set to a double
value that is not
NaN
, nor -INF
, nor INF
. In
addition, the value of their "constant" attribute must be set to
true
.
InitialAssignment objects may not target the Parameter objects referenced by the Reaction attributes "lowerFluxBound" and "upperFluxBound", nor any SpeciesReference objects.
All defined FluxObjective objects must have their coefficient
attribute set to a double
value that is not
NaN
, nor -INF
, nor INF
.
A Reaction "lowerFluxBound" attribute may not point to a Parameter
object that has a value of INF
.
A Reaction "upperFluxBound" attribute may not point to a Parameter
object that has a value of -INF
.
For all Reaction objects, the value of a "lowerFluxBound" attribute must be less than or equal to the value of the "upperFluxBound" attribute.
While it is not compulsory for a "strict" Flux Balance Constraints model to define an Objective, doing so does does allow the model to be formulated as a Linear Program and optimized. However, this decision is left to the modeler. Note that all other properties of the objects referred to in the list above are to be set as specified in the relevant SBML Level 3 Version 1 Core and fbc ("fbc") specifications.
Alternatively, if the value of the strict attribute is
false
, then none of these restrictions apply and the model
creator can choose to define "fbc" models that are not
necessarily encodable as an LP. For example, if strict is
false
, the InitialAssignment construct may be used to set
any valid numerical entity, including Parameter values and stoichiometric
coefficients, with any value of type double
. In addition,
Parameter elements are no longer required to be flagged as constant, thus
allowing for a Flux Balance Constraints model's use in alternative, hybrid
modeling strategies.
The ListOfObjectives is used to define the objectives of a given "fbc" model. Objectives generally consist of linear combinations of model variables (fluxes) and a direction for the optimality constraint (either maximization or minimization). Each Objective has a ListOfFluxObjectives subobjects.
In Version 2 of "fbc", the ListOfGeneProducts is used to define the gene products represented by the "fbc" model.
In Version 1 of "fbc", there is no ListOfGeneProducts, and instead, Model can have an optional ListOfFluxBounds.
See Objective, FluxObjective, FluxBound
Unsets the value of the "strict" attribute of this FbcModelPlugin.
Removes the nth FluxBound object from this plugin object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
(FluxBound)
the index of the FluxBound object to remove
any
:
the FluxBound object removed. As mentioned above, the
caller owns the returned object. NULL is returned if the
given index is out of range.
Removes the nth Objective from the ListOfObjectives within this FbcModelPlugin. and returns a pointer to it.
The caller owns the returned item and is responsible for deleting it.
Sets the id of the active objective.
Unsets the "activeObjective" attribute of the ListOfObjectives.
Get a GeneProduct from the ListOfGeneProducts.
(number)
the index number of the GeneProduct to get
GeneProduct
:
the nth GeneProduct in the ListOfGeneProducts within this FbcModelPlugin.
If the index n is invalid, NULL is returned.
Get a GeneProduct from the ListOfGeneProducts based on its label.
(string)
a string representing the label
of the GeneProduct to get
any
:
the GeneProduct in the ListOfGeneProducts
with the given label or NULL if no such
GeneProduct exists.
Adds a copy the given GeneProduct to this FbcModelPlugin.
(GeneProduct)
the GeneProduct object to add
Get the number of GeneProduct objects in this FbcModelPlugin.
any
:
the number of GeneProduct objects in this FbcModelPlugin.
Creates a new GeneProduct object, adds it to this FbcModelPlugin's ListOfGeneProducts and returns the GeneProduct object created.
GeneProduct
:
a new GeneProduct object instance.
Returns the XML namespace URI for the package to which this object belongs.
In the XML representation of an SBML document, XML namespaces are used to identify the origin of each XML construct used. XML namespaces are identified by their unique resource identifiers (URIs). The core SBML specifications stipulate the namespaces that must be used for core SBML constructs; for example, all XML elements that belong to SBML Level 3 Version 1 Core must be placed in the XML namespace identified by the URI "http://www.sbml.org/sbml/level3/version1/core". Individual SBML Level 3 packages define their own XML namespaces; for example, all elements belonging to the SBML Level 3 Layout Version 1 package must be placed in the XML namespace "http://www.sbml.org/sbml/level3/version1/layout/version1/".
This method first looks into the SBMLNamespaces object possessed by the parent SBMLDocument object of the current object. If this cannot be found, this method returns the result of getElementNamespace().
string
:
a string, the URI of the XML namespace to which this object belongs.
There are currently two possible namespaces defined for the Flux Balance Constraints package: "http://www.sbml.org/sbml/level3/version1/fbc/version1" and "http://www.sbml.org/sbml/level3/version1/fbc/version2". Despite both referencing SBML Level 3 Version 1 explicitly, both versions of this package (and all such packages) can be used without change in SBML Level 3 Version 2 documents. The only caveat is that features of the SBML Level 3 Version 2 specification that were not present in Level 1 may not be used by constructs from the Flux Balance Constraints package.
The Group class is the first and most central class in the SBML Level 3 Groups package. This class represents a group of entities: a simple mechanism for indicating that particular components of an SBML model are related in some way. The nature of the relationship is left up to the modeler, and can be clarified by means of annotations on model components. Groups may contain either the same or different types of SBML objects, and groups may be nested if desired. There are no predefined modeling or mathematical semantics associated with groups.
The Groups class has one required attribute, "kind"; two optional attributes, "id" and "name"; and a single child element, ListOfMembers. The membership of a group is determined by the contents of the list of members stored in Member objects within the ListOfMembers child of a Group object. Since the Group class of objects is derived from SBase, and SBase provides the ability to attach SBO terms as well as MIRIAM annotations, the semantics of a given group in a model can be made more precise using references to external controlled vocabularies and ontologies.
The attribute "kind" on Group is used to indicate the nature of the group defined by a Group instance. The "kind" attribute must always have one of the following three possible values:
"classification": The group represents a class, and its members have an is-a relationship to the group. For example, the group could represent a type of molecule such as ATP, and the members could be species located in different compartments, thereby establishing that the species are pools of the same molecule in different locations.
"partonomy": The group represents a collection of parts, and its members have a part-of relationship to the group. For example, the group could represent a cellular structure, and individual compartments could be made members of the group to indicate they represent subparts of that cellular structure.
"collection": The grouping is merely a collection for convenience, without an implied relationship between the members. For example, the group could be used to collect together multiple disparate components of a model—species, reactions, events—involved in a particular phenotype, and apply a common annotation rather than having to copy the same annotation to each component individually.
In the libSBML API for Groups, these possible values for the "kind" attribute are programmatically represented as constants so that callers will not normally need to deal with text string values. The following are the constants defined for the three values of "kind" (plus an additional constant to represent unrecognized values):
libsbml.GROUP_KIND_CLASSIFICATION
libsbml.GROUP_KIND_PARTONOMY
libsbml.GROUP_KIND_COLLECTION
libsbml.GROUP_KIND_UNKNOWN
If an SBML element is referenced by a Group's child Member (directly or indirectly), it is considered to be a member of that Group. If the same element is referenced by multiple Member objects, this is equivalent to including it just once. (It is considered best practice to avoid this, but does not make for an invalid SBML document.)
Children of referenced elements are not considered to be members of the Group: a KineticLaw of a referenced Reaction is not itself a Group member. Even the membership of so-called SBML container classes (e.g., ListOfSpecies, ListOfCompartments, etc.) does not imply inclusion of children as members of the Group. The sole exception to this rule is the handling of ListOfMembers class. See the libSBML C++ documentation for more info.
Returns the value of the "kind" attribute of this Group.
GroupKind_t
:
the value of the "kind" attribute of this Group as a GroupKind_t.
Sets the value of the "kind" attribute of this Group.
(GroupKind_t)
of the
"kind" attribute to be set.
The value must be one of the predefined constants that represent
valid SBML Level 3 Version 1 Group "kind" names, which
means it must be one of the following values:
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
The Member class has four optional attributes: id and name, which identify the element, and idRef and metaIdRef which reference the identifiers of other elements. There must be exactly one (and only one) method used to reference another element: either idRef or metaIdRef may be defined, but not both. (Multiple attributes are needed to account for the different types of identifiers that a given object may have.) The referenced object (including, potentially, another Group object) is thus made a member of the group in which the Member object is contained.
Since Member is derived from SBase and, as mentioned above, SBase provides both the ability to attach SBO terms as well as MIRIAM annotations, the semantics of a given member in a model can be made more precise by reference to external controlled vocabularies and ontologies.
Unsets the value of the "idRef" attribute of this Member.
Unsets the value of the "metaIdRef" attribute of this Member.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
Returns the XML namespace URI for the package to which this object belongs.
In the XML representation of an SBML document, XML namespaces are used to identify the origin of each XML construct used. XML namespaces are identified by their unique resource identifiers (URIs). The core SBML specifications stipulate the namespaces that must be used for core SBML constructs; for example, all XML elements that belong to SBML Level 3 Version 1 Core must be placed in the XML namespace identified by the URI "http://www.sbml.org/sbml/level3/version1/core". Individual SBML Level 3 packages define their own XML namespaces; for example, all elements belonging to the SBML Level 3 Layout Version 1 package must be placed in the XML namespace "http://www.sbml.org/sbml/level3/version1/layout/version1/".
This method first looks into the SBMLNamespaces object possessed by the parent SBMLDocument object of the current object. If this cannot be found, this method returns the result of getElementNamespace().
string
:
a string, the URI of the XML namespace to which this object belongs.
This class extends SBMLDocumentPlugin, a class that is used by libSBML plugins as part of their implementation of SBML Level 3 packages.
Returns the XML namespace URI for the package to which this object belongs.
In the XML representation of an SBML document, XML namespaces are used to identify the origin of each XML construct used. XML namespaces are identified by their unique resource identifiers (URIs). The core SBML specifications stipulate the namespaces that must be used for core SBML constructs; for example, all XML elements that belong to SBML Level 3 Version 1 Core must be placed in the XML namespace identified by the URI "http://www.sbml.org/sbml/level3/version1/core". Individual SBML Level 3 packages define their own XML namespaces; for example, all elements belonging to the SBML Level 3 Layout Version 1 package must be placed in the XML namespace "http://www.sbml.org/sbml/level3/version1/layout/version1/".
This method first looks into the SBMLNamespaces object possessed by the parent SBMLDocument object of the current object. If this cannot be found, this method returns the result of getElementNamespace().
string
:
a string, the URI of the XML namespace to which this object belongs.
This is the Groups package extension of the SBMLExtension class that is used to facilitate libSBML plug-ins in the implementation of an SBMLLevel 3 package.
The MultiASTPlugin object is used to extend the standard SBML AST (abstract syntax tree) base object (ASTBase) to allow a "ci" element (libsbml.AST_NAME) to have an optional "speciesReference" attribute. This attribute is used to distinguish which version of a Species should be used in the mathematics. If a "template" type Species appears as both a reactant and a product in the same Reaction, for example, it may have one amount as a reactant and a different amount as a product, since the same template is being used to match slightly different pools of elements in each case. By defining the "speciesReference" attribute on an libsbml.AST_NAME that references that Species, the modeler may determine which amount is being referenced. Similarly, an libsbml.AST_NAME node may reference a SpeciesFeature that appears in multiple Species in the Reaction, and this attribute can be used to specify which one should be used.
Unsets the species reference.
Unset the representation type.
Returns the XML namespace URI for the package to which this object belongs.
In the XML representation of an SBML document, XML namespaces are used to identify the origin of each XML construct used. XML namespaces are identified by their unique resource identifiers (URIs). The core SBML specifications stipulate the namespaces that must be used for core SBML constructs; for example, all XML elements that belong to SBML Level 3 Version 1 Core must be placed in the XML namespace identified by the URI "http://www.sbml.org/sbml/level3/version1/core". Individual SBML Level 3 packages define their own XML namespaces; for example, all elements belonging to the SBML Level 3 Layout Version 1 package must be placed in the XML namespace "http://www.sbml.org/sbml/level3/version1/layout/version1/".
This method first looks into the SBMLNamespaces object possessed by the parent SBMLDocument object of the current object. If this cannot be found, this method returns the result of getElementNamespace().
string
:
a string, the URI of the XML namespace to which this object belongs.
The MultiCompartmentPlugin object is used to extend the standard SBML Compartment base object with an optional "compartmentType" attribute, a required "isType" Boolean attribute, and a child ListOfCompartmentReferences. The "isType" attribute flags whether this Compartment should be treated as a standard SBML Compartment (if false), or as a more generic rule-based "type" of Compartment (if true). A compartment "type" is a template (in the sense of prototype) for all Compartment objects referencing it (via "compartmentType" attributes). A Species object directly referencing a compartment type is not a "fully defined" species, but rather a "template" species. If the value of the "isType" attribute is false, the Compartment object is a "not-a-type" compartment, and it is similar to a SBML core Compartment except it can reference a compartment type and can have a ListOfCompartmentReferences child. Each child CompartmentReference in the ListOfCompartmentReferences defines a subcompartment of the parent Compartment. The "compartmentType" attribute identifies this Compartment as the CompartmentType defined elsewhere in the Model. If the "compartmentType" attribute is set, the "isType" attribute must be true.
Unsets the value of the "compartmentType" attribute.
Unsets the value of the "isType" attribute.
Returns the nth CompartmentReference object from the ListOfCompartmentReferences.
(number)
the index number of the CompartmentReference to get.
CompartmentReference
:
the nth CompartmentReference, or NULL if the index n is out
of range.
Adds a copy of the given CompartmentReference object to the ListOfCompartmentReferences.
(CompartmentReference)
the CompartmentReference object to add.
Creates a new CompartmentReference object and adds it to the ListOfCompartmentReferences.
CompartmentReference
:
the newly created CompartmentReference object.
Removes the nth CompartmentReference object from the ListOfCompartmentReferences.
(number)
the index of the CompartmentReference to remove.
CompartmentReference
:
the CompartmentReference object removed, or NULL if the given
index n is out of range. Note that the caller owns the returned
object and is responsible for deleting it.
Returns the XML namespace URI for the package to which this object belongs.
In the XML representation of an SBML document, XML namespaces are used to identify the origin of each XML construct used. XML namespaces are identified by their unique resource identifiers (URIs). The core SBML specifications stipulate the namespaces that must be used for core SBML constructs; for example, all XML elements that belong to SBML Level 3 Version 1 Core must be placed in the XML namespace identified by the URI "http://www.sbml.org/sbml/level3/version1/core". Individual SBML Level 3 packages define their own XML namespaces; for example, all elements belonging to the SBML Level 3 Layout Version 1 package must be placed in the XML namespace "http://www.sbml.org/sbml/level3/version1/layout/version1/".
This method first looks into the SBMLNamespaces object possessed by the parent SBMLDocument object of the current object. If this cannot be found, this method returns the result of getElementNamespace().
string
:
a string, the URI of the XML namespace to which this object belongs.
The MultiSBMLDocumentPlugin class inherits from the SBMLDocumentPlugin class, and codifies the extensions to the SBMLDocument class defined in the SBML Level 3 @ref multi ("multi") package. This extension defines a required flag named "required", which indicates whether "multi" constructs can be used to change the core mathematical interpretation of the Model defined in the SBML input. Since "multi" constructs can, this attribute must be set to the value "true".
Returns the XML namespace URI for the package to which this object belongs.
In the XML representation of an SBML document, XML namespaces are used to identify the origin of each XML construct used. XML namespaces are identified by their unique resource identifiers (URIs). The core SBML specifications stipulate the namespaces that must be used for core SBML constructs; for example, all XML elements that belong to SBML Level 3 Version 1 Core must be placed in the XML namespace identified by the URI "http://www.sbml.org/sbml/level3/version1/core". Individual SBML Level 3 packages define their own XML namespaces; for example, all elements belonging to the SBML Level 3 Layout Version 1 package must be placed in the XML namespace "http://www.sbml.org/sbml/level3/version1/layout/version1/".
This method first looks into the SBMLNamespaces object possessed by the parent SBMLDocument object of the current object. If this cannot be found, this method returns the result of getElementNamespace().
string
:
a string, the URI of the XML namespace to which this object belongs.
This is the Multistate, Multicomponent and Multicompartment Species package extension of the SBMLExtension class. This is a class that every libSBML plug-in must implement in order to implement an SBML Level 3 package.
There is currently exactly one namespace defined for the Multistate, Multicomponent and Multicompartment Species package: "http://www.sbml.org/sbml/level3/version1/multi/version1". Despite referencing SBML Level 3 Version 1 explicitly, this package (and all such packages) can be used without change in SBML Level 3 Version 2 documents. The only caveat is that features of the SBML Level 3 Version 2 specification that were not present in Level 1 may not be used by constructs from Level 1 packages. However, this restriction should not affect the 'multi' package.
The MultiListOfReactionsPlugin class extends the ListOfReactions class to allow a ListOfReactions to contain IntraSpeciesReaction objects as well as Reaction objects.
Returns the XML namespace URI for the package to which this object belongs.
In the XML representation of an SBML document, XML namespaces are used to identify the origin of each XML construct used. XML namespaces are identified by their unique resource identifiers (URIs). The core SBML specifications stipulate the namespaces that must be used for core SBML constructs; for example, all XML elements that belong to SBML Level 3 Version 1 Core must be placed in the XML namespace identified by the URI "http://www.sbml.org/sbml/level3/version1/core". Individual SBML Level 3 packages define their own XML namespaces; for example, all elements belonging to the SBML Level 3 Layout Version 1 package must be placed in the XML namespace "http://www.sbml.org/sbml/level3/version1/layout/version1/".
This method first looks into the SBMLNamespaces object possessed by the parent SBMLDocument object of the current object. If this cannot be found, this method returns the result of getElementNamespace().
string
:
a string, the URI of the XML namespace to which this object belongs.
The MultiModelPlugin object is used to extend the standard SBML Model object to allow a ListOfSpeciesTypes child.
Returns the MultiSpeciesType object that belongs to the given index. If the index is invalid, NULL is returned.
(number)
the index number of the MultiSpeciesType to get
MultiSpeciesType
:
the nth MultiSpeciesType in the ListOfMultiSpeciesTypes
If the index @p n is invalid, NULL is returned.
Adds a copy of the given MultiSpeciesType to the ListOfMultiSpeciesTypes in this plugin object.
(MultiSpeciesType)
the multiSpeciesType to be added.
Creates a new MultiSpeciesType object and adds it to the ListOfMultiSpeciesTypes in this plugin object.
MultiSpeciesType
:
the newly created MultiSpeciesType object.
Creates a new BindingSiteSpeciesType object and adds it to the ListOfMultiSpeciesTypes in this plugin object.
BindingSiteSpeciesType
:
the newly created BindingSiteSpeciesType object.
Removes the nth MultiSpeciesType object from this plugin object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
(number)
the index of the MultiSpeciesType to remove
MultiSpeciesType
:
the MultiSpeciesType object removed
or NULL index was out of range.
Creates a new IntraSpeciesReaction object and adds it to the ListOfReactions.
IntraSpeciesReaction
:
the newly created IntraSpeciesReaction object.
Returns the XML namespace URI for the package to which this object belongs.
In the XML representation of an SBML document, XML namespaces are used to identify the origin of each XML construct used. XML namespaces are identified by their unique resource identifiers (URIs). The core SBML specifications stipulate the namespaces that must be used for core SBML constructs; for example, all XML elements that belong to SBML Level 3 Version 1 Core must be placed in the XML namespace identified by the URI "http://www.sbml.org/sbml/level3/version1/core". Individual SBML Level 3 packages define their own XML namespaces; for example, all elements belonging to the SBML Level 3 Layout Version 1 package must be placed in the XML namespace "http://www.sbml.org/sbml/level3/version1/layout/version1/".
This method first looks into the SBMLNamespaces object possessed by the parent SBMLDocument object of the current object. If this cannot be found, this method returns the result of getElementNamespace().
string
:
a string, the URI of the XML namespace to which this object belongs.
The MultiSpeciesPlugin class extends the SimpleSpeciesReference class with a new optional attribute "compartmentReference", of type SIdRef, that points to a CompartmentReference. The compartmentReference attribute can serve to indicate in which subcompartment the SpeciesReference or ModifierSpeciesReference (which inherit from SimpleSpeciesReference) is located.
Unsets the value of the "compartmentReference" attribute of this SimpleSpeciesReference.
Returns the XML namespace URI for the package to which this object belongs.
In the XML representation of an SBML document, XML namespaces are used to identify the origin of each XML construct used. XML namespaces are identified by their unique resource identifiers (URIs). The core SBML specifications stipulate the namespaces that must be used for core SBML constructs; for example, all XML elements that belong to SBML Level 3 Version 1 Core must be placed in the XML namespace identified by the URI "http://www.sbml.org/sbml/level3/version1/core". Individual SBML Level 3 packages define their own XML namespaces; for example, all elements belonging to the SBML Level 3 Layout Version 1 package must be placed in the XML namespace "http://www.sbml.org/sbml/level3/version1/layout/version1/".
This method first looks into the SBMLNamespaces object possessed by the parent SBMLDocument object of the current object. If this cannot be found, this method returns the result of getElementNamespace().
string
:
a string, the URI of the XML namespace to which this object belongs.
The MultiSpeciesPlugin class extends the Species class to have a new attribute "speciesType", and two extra optional ListOfOutwardBindingSites and ListOfSpeciesFeatures children. A species may have a ListOfOutwardBindingSites child and/or a ListOfSpeciesFeatures child only when its speciesType attribute has been defined. The relationship among the elements of a ListOfOutwardBindingSites or a ListOfSpeciesFeatures is "and".
Unsets the value of the "speciesType" attribute on this "multi" Species.
Returns the nth OutwardBindingSite object.
(number)
the index number of the OutwardBindingSite to get
OutwardBindingSite
:
the nth OutwardBindingSite in the ListOfOutwardBindingSites. If
the index is invalid, NULL is returned.
Adds a copy of the given OutwardBindingSite to the ListOfOutwardBindingSites.
(OutwardBindingSite)
the outwardBindingSite to be added.
Creates a new OutwardBindingSite object and adds it to the ListOfOutwardBindingSites.
OutwardBindingSite
:
the newly created OutwardBindingSite object.
Removes the nth OutwardBindingSite object and returns a pointer to it.
(number)
the index of the OutwardBindingSite to remove.
OutwardBindingSite
:
the OutwardBindingSite object removed or @c NULL index was out of
range. Note that the caller owns the returned object and is responsible
for deleting it.
Returns the nth SpeciesFeature object.
(number)
the index number of the SpeciesFeature to get.
SpeciesFeature
:
the nth SpeciesFeature in the ListOfSpeciesFeatures. If the
index is invalid, NULL is returned.
Adds a copy of the given SpeciesFeature to the ListOfSpeciesFeatures of this "multi" Species.
(SpeciesFeature)
the SpeciesFeature to be added.
Creates a new SpeciesFeature object and adds it to the ListOfSpeciesFeatures of this "multi" Species.
SpeciesFeature
:
the newly created SpeciesFeature object.
Removes the nth SpeciesFeature object and returns a pointer to it.
(any)
the index of the SpeciesFeature to remove.
SpeciesFeature
:
the SpeciesFeature object removed or @c NULL index was out of
range. Note that the caller owns the returned object and is responsible
for deleting it.
Returns the nth SubListOfSpeciesFeatures object.
(number)
the index number of the SubListOfSpeciesFeatures to get
SubListOfSpeciesFeatures
:
the nth SubListOfSpeciesFeatures in the ListOfSpeciesFeatures.
If the index is invalid, NULL is returned.
Adds a copy of the given SubListOfSpeciesFeatures to the ListOfSpeciesFeatures.
(SubListOfSpeciesFeatures)
the SubListOfSpeciesFeatures to be added.
Creates a new SubListOfSpeciesFeatures object and adds it to the SubListOfSpeciesFeatures.
SubListOfSpeciesFeatures
:
the newly created SubListOfSpeciesFeatures object.
Returns the XML namespace URI for the package to which this object belongs.
In the XML representation of an SBML document, XML namespaces are used to identify the origin of each XML construct used. XML namespaces are identified by their unique resource identifiers (URIs). The core SBML specifications stipulate the namespaces that must be used for core SBML constructs; for example, all XML elements that belong to SBML Level 3 Version 1 Core must be placed in the XML namespace identified by the URI "http://www.sbml.org/sbml/level3/version1/core". Individual SBML Level 3 packages define their own XML namespaces; for example, all elements belonging to the SBML Level 3 Layout Version 1 package must be placed in the XML namespace "http://www.sbml.org/sbml/level3/version1/layout/version1/".
This method first looks into the SBMLNamespaces object possessed by the parent SBMLDocument object of the current object. If this cannot be found, this method returns the result of getElementNamespace().
string
:
a string, the URI of the XML namespace to which this object belongs.
The MultiSpeciesReferencePlugin class inherits from the MultiSimpleSpeciesReferencePlugin class, and extends the SpeciesReference class to establish component mappings between the reactant species and the product species when the mappings cannot be inferred from the ids of the SpeciesTypeInstance objects. A MultiSpeciesReferencePlugin object defines an optional ListOfSpeciesTypeComponentMapInProducts child. Only a reaction product can contain the ListOfSpeciesTypeComponentMapInProducts child and it is not necessary to store the mappings again in the reactants.
Returns the nth SpeciesTypeComponentMapInProduct object.
(number)
the index number of the SpeciesTypeComponentMapInProduct to get.
SpeciesTypeComponentMapInProduct
:
the nth SpeciesTypeComponentMapInProduct in the
ListOfSpeciesTypeComponentMapInProducts. If the index is invalid, NULL
is returned.
Adds a copy of the given SpeciesTypeComponentMapInProduct to the ListOfSpeciesTypeComponentMapInProducts.
(SpeciesTypeComponentMapInProduct)
the
speciesTypeComponentMapInProduct to be added.
Creates a new SpeciesTypeComponentMapInProduct object and adds it to the ListOfSpeciesTypeComponentMapInProducts.
SpeciesTypeComponentMapInProduct
:
the newly created SpeciesTypeComponentMapInProduct object. Note
that the caller owns the returned object and is responsible for deleting
it.
Removes the nth SpeciesTypeComponentMapInProduct object and returns a pointer to it.
(number)
the index of the SpeciesTypeComponentMapInProduct to remove.
SpeciesTypeComponentMapInProduct
:
the SpeciesTypeComponentMapInProduct object removed or NULL
index was out of range. Note that the caller owns the returned object
and is responsible for deleting it.
Unsets the value of the "compartmentReference" attribute of this SimpleSpeciesReference.
Returns the XML namespace URI for the package to which this object belongs.
In the XML representation of an SBML document, XML namespaces are used to identify the origin of each XML construct used. XML namespaces are identified by their unique resource identifiers (URIs). The core SBML specifications stipulate the namespaces that must be used for core SBML constructs; for example, all XML elements that belong to SBML Level 3 Version 1 Core must be placed in the XML namespace identified by the URI "http://www.sbml.org/sbml/level3/version1/core". Individual SBML Level 3 packages define their own XML namespaces; for example, all elements belonging to the SBML Level 3 Layout Version 1 package must be placed in the XML namespace "http://www.sbml.org/sbml/level3/version1/layout/version1/".
This method first looks into the SBMLNamespaces object possessed by the parent SBMLDocument object of the current object. If this cannot be found, this method returns the result of getElementNamespace().
string
:
a string, the URI of the XML namespace to which this object belongs.
A BindingSiteSpeciesType inherits from MultiSpeciesType, and also is a child of the extended Model (via the MultiModelPlugin). A BindingSiteSpeciesType object defines a binding site, and therefore its instance can further define the bindingStatus attribute and can participate a binding internally and explicitly in an InSpeciesTypeBond object, or externally and implicitly defined by an OutwardBindingSite object. A binding site must be an atomic component which means that a BindingSiteSpeciesType object cannot contain a ListOfSpeciesTypeInstances subobject. Note: In the Multi package, a binding site can only participate in one binding at a time. That means a binding site cannot bind two partners at the same time. The binding relationship is one-to-one.
Unsets the value of the "compartment" attribute of this MultiSpeciesType.
Returns the nth SpeciesFeatureType object from the ListOfSpeciesFeatureTypes.
(number)
the index number of the SpeciesFeatureType to get.
SpeciesFeatureType
:
the nth SpeciesFeatureType in the ListOfSpeciesFeatureTypes
within this MultiSpeciesType.
If the index n is invalid, NULL is returned.
Adds a copy the given "SpeciesFeatureType" to this MultiSpeciesType.
(SpeciesFeatureType)
the SpeciesFeatureType object to add
Creates a new SpeciesFeatureType object and adds it to this MultiSpeciesTypes ListOfSpeciesFeatureTypes.
SpeciesFeatureType
:
the newly created SpeciesFeatureType object instance.
Removes the nth SpeciesFeatureType from the ListOfSpeciesFeatureTypes within this MultiSpeciesType object.
(any)
the index of the SpeciesFeatureType to remove.
SpeciesFeatureType
:
the SpeciesFeatureType object removed, or NULL if the given
index n is out of range. Note that the caller owns the returned
object and is responsible for deleting it.
Get the nth SpeciesTypeInstance object from the ListOfSpeciesTypeInstances.
(number)
the index number of the SpeciesTypeInstance to get.
SpeciesTypeInstance
:
the nth SpeciesTypeInstance object in the
ListOfSpeciesTypeInstances, or NULL if the given index is out of range.
Adds a copy the given "SpeciesTypeInstance" to this MultiSpeciesType.
(SpeciesTypeInstance)
the SpeciesTypeInstance object to add
Creates a new SpeciesTypeInstance object and adds it to this MultiSpeciesTypes ListOfSpeciesTypeInstances.
SpeciesTypeInstance
:
a new SpeciesTypeInstance object instance.
Removes the nth SpeciesTypeInstance from the ListOfSpeciesTypeInstances within this MultiSpeciesType.
(number)
the index of the SpeciesTypeInstance to remove.
SpeciesTypeInstance
:
the object removed, or NULL if no such object exists. Note that
the caller owns the returned object and is responsible for deleting it.
Get the nth SpeciesTypeComponentIndex object from the ListOfSpeciesTypeComponentIndexes.
(number)
the index number of the SpeciesTypeComponentIndex to get from
the ListOfSpeciesTypeComponentIndexes.
SpeciesTypeComponentIndex
:
the nth object in the ListOfSpeciesTypeComponentIndexes, or NULL
if the index n is out of range.
Adds a copy of the given SpeciesTypeComponentIndex object to this MultiSpeciesType.
(SpeciesTypeComponentIndex)
the SpeciesTypeComponentIndex object to add
Creates a new SpeciesTypeComponentIndex object and adds it to the ListOfSpeciesTypeComponentIndexes.
SpeciesTypeComponentIndex
:
a new SpeciesTypeComponentIndex object instance to add to the
ListOfSpeciesTypeComponentIndexes object within this MultiSpeciesType
object.
Removes the nth SpeciesTypeComponentIndex object from the ListOfSpeciesTypeComponentIndexes.
(number)
the index of the SpeciesTypeComponentIndex to remove.
SpeciesTypeComponentIndex
:
the object removed, or NULL if no such object exists. Note that
the caller owns the returned object and is responsible for deleting it.
Get the nth InSpeciesTypeBond object from the ListOfInSpeciesTypeBonds.
(number)
the index number of the InSpeciesTypeBond to get.
InSpeciesTypeBond
:
the nth object, or NULL if the index is out of range.
Adds a copy the given InSpeciesTypeBond object to this MultiSpeciesType.
(InSpeciesTypeBond)
the InSpeciesTypeBond object to add
Creates a new InSpeciesTypeBond object and adds it to the ListOfInSpeciesTypeBonds.
InSpeciesTypeBond
:
a new InSpeciesTypeBond object instance.
Removes the nth InSpeciesTypeBond object from the ListOfInSpeciesTypeBonds. and returns a pointer to it.
(number)
the index of the InSpeciesTypeBond to remove.
InSpeciesTypeBond
:
the nth object, or NULL if the index is out of range.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
A CompartmentReference object is a child of an extended Compartment (via the MultiCompartmentPlugin), and provides a way for that Compartment to reference another Compartment, and indicates that the referenced Compartment is a sub-compartment in a composite parent compartment. Compartments may be arbitrarily nested in this way, but this nesting cannot be circular.
The ListOfCompartmentReferences is a container for CompartmentReference objects.
Unsets the value of the "compartment" attribute of this CompartmentReference.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
The InSpeciesTypeBond object is a child of MultiSpeciesType, and defines a bond existing within that MultiSpeciesType. The bond therefore exists in every species that references the MultiSpeciesType. The binding relationship in an InSpeciesTypeBond is one-to-one. The uniqueness of an InSpeciesTypeBond is ensured by the pair of referenced attributes "bindingSite1" and "bindingSite2", both of type SBaseRef. The referenced identifiers of the binding sites can be the ids of SpeciesTypeInstance objects (binding sites), or the ids of the SpeciesTypeComponentIndex objects indexing the binding sites and the ultimately referenced components must be the BindingSiteSpeciesType objects. Obviously, attributes "bindingSite1" and "bindingSite2" must not reference the same BindingSiteSpeciesType object.
Returns the value of the "bindingSite1" attribute of this InSpeciesTypeBond.
any
:
the value of the "bindingSite1" attribute of this
InSpeciesTypeBond as a string.
Unsets the value of the "bindingSite1" attribute of this InSpeciesTypeBond.
Sets the value of the "bindingSite2" attribute of this InSpeciesTypeBond.
(any)
the new value of the "bindingSite2" attribute.
Unsets the value of the "bindingSite2" attribute of this InSpeciesTypeBond.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
An IntraSpeciesReaction is derived from Reaction for the reactions happening within a Species. A particular Reaction may happen within a Species as an IntraSpeciesReaction if the following conditions are fulfilled:
The Reaction is either an association reaction or a dissociation reaction.
If it is an association reaction, each of the two reactant Species has at least one OutwardBindingSite free ("unbound").
If it is a dissociation reaction, each of the two product Species has at least one OutwardBindingSite free ("unbound").
Note: Technically, transformations are also reactions happening with one Species, but they do not have the ambiguity of association and dissociation reactions. Therefore, a transformation reaction does not have to be defined as an IntraSpeciesReaction.
Returns the nth reactant species (as a SpeciesReference object) in the list of reactants in this Reaction.
Callers should first call getNumReactants() to find out how many reactants there are, to avoid using an invalid index number.
(number)
the index of the reactant sought
SpeciesReference
:
the nth reactant (as a SpeciesReference object) of this
Reaction.
If the index n is invalid, NULL is returned.
Returns the nth product species (as a SpeciesReference object) in the list of products in this Reaction.
Callers should first call getNumProducts() to find out how many products there are, to avoid using an invalid index number.
(number)
the index of the product sought
SpeciesReference
:
the nth product (as a SpeciesReference object) of this
Reaction.
If the index n is invalid, NULL is returned.
Returns the nth modifier species (as a ModifierSpeciesReference object) in the list of modifiers of this Reaction.
Callers should first call getNumModifiers() to find out how many modifiers there are, to avoid using an invalid index number.
(number)
the index of the modifier species sought.
ModifierSpeciesReference
:
the nth modifier (as a ModifierSpeciesReference object) of
this Reaction.
If the index n is invalid, NULL is returned.
Adds a given SpeciesReference object as a reactant in this Reaction.
The SpeciesReference instance in sr is copied.
(SpeciesReference)
a SpeciesReference object referring to a Species in the
enclosing Model.
Adds a given SpeciesReference object as a product in this Reaction.
The SpeciesReference instance in sr is copied.
(SpeciesReference)
a SpeciesReference object referring to a Species in the
enclosing Model
Adds a given ModifierSpeciesReference object as a product in this Reaction.
The ModifierSpeciesReference instance in msr is copied.
(addModifier)
a ModifierSpeciesReference object referring to a Species in
the enclosing Model
Creates a new SpeciesReference, adds it to this Reaction's list of reactants, and returns it.
SpeciesReference
:
a new SpeciesReference object.
Creates a new SpeciesReference, adds it to this Reaction's list of products, and returns it.
SpeciesReference
:
a new SpeciesReference object.
Creates a new ModifierSpeciesReference, adds it to this Reaction's list of modifiers and returns it.
ModifierSpeciesReference
:
a new ModifierSpeciesReference object.
Removes the nth reactant species (SpeciesReference object) in the list of reactants in this Reaction and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it. The caller should first call getNumReactants() to find out how many reactants there are, to avoid using an invalid index number.
(number)
the index of the reactant SpeciesReference object to remove
SpeciesReference
:
the removed reactant SpeciesReference object, or NULL if the
given index is out of range.
Removes the nth product species (SpeciesReference object) in the list of products in this Reaction and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it. The caller should first call getNumProducts() to find out how many products there are, to avoid using an invalid index number.
(number)
the index of the product SpeciesReference object to remove
SpeciesReference
:
the removed product SpeciesReference object, or NULL if the
given index is out of range.
Removes the nth modifier species (ModifierSpeciesReference object) in the list of modifiers in this Reaction and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it. The caller should first call getNumModifiers() to find out how many modifiers there are, to avoid using an invalid index number.
(number)
the index of the ModifierSpeciesReference object to remove.
ModifierSpeciesReference
:
the removed ModifierSpeciesReference object, or NULL if the
given index is out of range.
Creates a new KineticLaw object, installs it as this Reaction's "kineticLaw" subelement, and returns it.
If this Reaction had a previous KineticLaw, it will be destroyed.
KineticLaw
:
the new KineticLaw object.
Returns the KineticLaw object contained in this Reaction.
KineticLaw
:
the KineticLaw instance.
Sets the "kineticLaw" subelement of this Reaction to a copy of the given KineticLaw object.
(KineticLaw)
the KineticLaw object to use
Unsets the "kineticLaw" subelement of this Reaction.
Unsets the value of the "reversible" attribute of this Reaction.
Unsets the value of the "compartment" attribute of this Reaction.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
The OutwardBindingSite object is a child of a Species (via the MultiSpeciesPlugin). It has two optional attributes, "id" and "name", and two required attributes, "bindingStatus" and "component". A binding site not involved in any InSpeciesTypeBond object in the MultiSpeciesType referenced by a Species is an OutwardBindingSite. The bindingStatus attribute is of type {*nk BindingStatus_t}. The component attribute, of type SIdRef, references a component which ultimately references a BindingSiteSpeciesType object. The attribute value must be the identifier of a SpeciesTypeInstance, SpeciesTypeComponentIndex or MultiSpeciesType object. An OutwardBindingSite cannot be a binding site referenced by any InSpeciesTypeBond in the species. There are three scenarios for the component attribute to have the value of an identifier of MultiSpeciesType, SpeciesTypeInstance, or SpeciesTypeComponentIndex respectively:
Returns the value of the "bindingStatus" attribute of this OutwardBindingSite.
BindingStatus_t
:
the value of the "bindingStatus" attribute of this
OutwardBindingSite.
Sets the value of the "bindingStatus" attribute of this OutwardBindingSite.
(BindingStatus_t)
the new value of the "bindingStatus" attribute.
Unsets the value of the "bindingStatus" attribute of this OutwardBindingSite.
Returns the value of the "component" attribute of this OutwardBindingSite.
any
:
the value of the "component" attribute of this
OutwardBindingSite as a string.
Unsets the value of the "component" attribute of this OutwardBindingSite.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
The PossibleSpeciesFeatureValue object is a child of a SpeciesFeatureType, and defines one value (though its optional "numericValue" attribute) which the parent SpeciesFeatureType can hold.
Unsets the value of the "numericValue" attribute of this PossibleSpeciesFeatureValue.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
Each SpeciesFeature object is a child of the MultiSpeciesPlugin, which extends the Species. Each defines one feature of the parent Species. It has three optional attributes, "id", "name" and "component", and two required attributes, "speciesFeatureType" and "occur", and a required child ListOfSpeciesFeatureValues. SpeciesFeature serves to define the state of a component in a species by selecting values from the ListOfPossibleSpeciesFeatureValues of the referenced SpeciesFeatureType. Its "speciesFeatureType" attribue references the particular SpeciesFeatureType of which this Species is an example. The "occur" attribute defines the number of instances of the referenced SpeciesFeatureType. The optional "component" attribute, of type SIdRef, can be used to indicate which component of a Species the SpeciesFeature belongs to, and is required when the component cannot be identified only based on the speciesFeatureType attribute. The ListOfSpeciesFeatureValues contain one or more SpeciesFeatureValue objects—if more than one, the relationship between them is "or", defining a list of mutually exclusive possibilities. Each SpeciesFeatureValue serves to specify a value for a SpeciesFeature to select from the ListOfPossibleSpeciesFeatureValues defined in the referenced SpeciesFeatureType.
Unsets the value of the "speciesFeatureType" attribute of this SpeciesFeature.
Unsets the value of the "occur" attribute of this SpeciesFeature.
Unsets the value of the "component" attribute of this SpeciesFeature.
Get the nth SpeciesFeatureValue object from the ListOfSpeciesFeatureValues.
(number)
the index number of the SpeciesFeatureValue to get.
SpeciesFeatureValue
:
the nth object, or @c NULL if the index @p is out of range.
Adds a copy the given "SpeciesFeatureValue" to this SpeciesFeature.
(SpeciesFeatureValue)
the SpeciesFeatureValue object to add
Creates a new SpeciesFeatureValue object and adds it to this SpeciesFeatures ListOfSpeciesFeatureValues.
SpeciesFeatureValue
:
a new SpeciesFeatureValue object instance
Removes the nth SpeciesFeatureValue from the ListOfSpeciesFeatureValues.
(string)
the index of the SpeciesFeatureValue to remove.
SpeciesFeatureValue
:
the object removed, or @c NULL if no such object exists. Note that
the caller owns the returned object and is responsible for deleting it.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
The SpeciesFeatureType object is a child of a MultiSpeciesType, and serves to provide frameworks or templates to define the referencing SpeciesFeature objects. SpeciesFeatureType has two required attributes "id" and "occur", an optional attribute "name", and a required child ListOfPossibleSpeciesFeatureValues. The multiple PossibleSpeciesFeatureValue children of the ListOfPossibleSpeciesFeatureValues object permit constructing multistate species via its SpeciesFeature children of the ListOfSpeciesFeatures or SubListOfSpeciesFeatures object. The "occur" attribute is used to indicate the number of instances of the SpeciesFeatureType. This attribute can be used to infer the number of the instances in the "don"t care" state in a referencing SpeciesFeature.
Unsets the value of the "occur" attribute of this SpeciesFeatureType.
Get the nth PossibleSpeciesFeatureValue object from the ListOfPossibleSpeciesFeatureValues.
(number)
the index number of the PossibleSpeciesFeatureValue to get.
PossibleSpeciesFeatureValue
:
the nth object, or NULL if the index @p is out of range.
Adds a copy the given "PossibleSpeciesFeatureValue" to this SpeciesFeatureType.
(PossibleSpeciesFeatureValue)
the PossibleSpeciesFeatureValue object to add
Creates a new PossibleSpeciesFeatureValue object and adds it to this SpeciesFeatureTypes.
PossibleSpeciesFeatureValue
:
a new PossibleSpeciesFeatureValue object instance
Removes the nth PossibleSpeciesFeatureValue object from the ListOfPossibleSpeciesFeatureValues.
(any)
the index of the PossibleSpeciesFeatureValue to remove.
PossibleSpeciesFeatureValue
:
the object removed, or NULL if no such object exists. Note that
the caller owns the returned object and is responsible for deleting it.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
The SpeciesFeatureValue object is a child of a SpeciesFeature, and serves to specify a value for a SpeciesFeature to select from the ListOfPossibleSpeciesFeatureValues defined in the SpeciesFeatureType referenced by the parent SpeciesFeature.
Unsets the value of the "value" attribute of this SpeciesFeatureValue.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
The MultiSpeciesType class (defined simply as SpeciesType in the SBML Level 3 "multi" specification, but called MultiSpeciesType here to distinguish it from the SpeciesType class defined in SBML Level 2), is a child of the extended Model object (via the MultiModelPlugin class). It defines "id" and "name" attributes, an optional "compartment" attribute for indicating which Compartment the referencing Species is in, and four optional lists for child SpeciesFeatureType, SpeciesTypeInstance, SpeciesTypeComponentIndex, and InSpeciesTypeBond objects. Together those children define the species type. The ListOfSpeciesTypeInstances subobject provides a way to define multicomponents which are instances of other MultiSpeciesType objects. The ListOfSpeciesFeatureTypes subobject and its SpeciesFeatureType children set up a framework for the referencing species or the instances of MultiSpeciesType objects to be able to have multistates. The ListOfSpeciesTypeComponentIndexes subobject provides a flexible way to reference any component in a MultiSpeciesType. The ListOfInSpeciesTypeBonds subobject and its InSpeciesTypeBond children provides a way to define bonds within a MultiSpeciesType.
Unsets the value of the "compartment" attribute of this MultiSpeciesType.
Returns the nth SpeciesFeatureType object from the ListOfSpeciesFeatureTypes.
(number)
the index number of the SpeciesFeatureType to get.
SpeciesFeatureType
:
the nth SpeciesFeatureType in the ListOfSpeciesFeatureTypes
within this MultiSpeciesType.
If the index n is invalid, NULL is returned.
Adds a copy the given "SpeciesFeatureType" to this MultiSpeciesType.
(SpeciesFeatureType)
the SpeciesFeatureType object to add
Creates a new SpeciesFeatureType object and adds it to this MultiSpeciesTypes ListOfSpeciesFeatureTypes.
SpeciesFeatureType
:
the newly created SpeciesFeatureType object instance.
Removes the nth SpeciesFeatureType from the ListOfSpeciesFeatureTypes within this MultiSpeciesType object.
(any)
the index of the SpeciesFeatureType to remove.
SpeciesFeatureType
:
the SpeciesFeatureType object removed, or NULL if the given
index n is out of range. Note that the caller owns the returned
object and is responsible for deleting it.
Get the nth SpeciesTypeInstance object from the ListOfSpeciesTypeInstances.
(number)
the index number of the SpeciesTypeInstance to get.
SpeciesTypeInstance
:
the nth SpeciesTypeInstance object in the
ListOfSpeciesTypeInstances, or NULL if the given index is out of range.
Adds a copy the given "SpeciesTypeInstance" to this MultiSpeciesType.
(SpeciesTypeInstance)
the SpeciesTypeInstance object to add
Creates a new SpeciesTypeInstance object and adds it to this MultiSpeciesTypes ListOfSpeciesTypeInstances.
SpeciesTypeInstance
:
a new SpeciesTypeInstance object instance.
Removes the nth SpeciesTypeInstance from the ListOfSpeciesTypeInstances within this MultiSpeciesType.
(number)
the index of the SpeciesTypeInstance to remove.
SpeciesTypeInstance
:
the object removed, or NULL if no such object exists. Note that
the caller owns the returned object and is responsible for deleting it.
Get the nth SpeciesTypeComponentIndex object from the ListOfSpeciesTypeComponentIndexes.
(number)
the index number of the SpeciesTypeComponentIndex to get from
the ListOfSpeciesTypeComponentIndexes.
SpeciesTypeComponentIndex
:
the nth object in the ListOfSpeciesTypeComponentIndexes, or NULL
if the index n is out of range.
Adds a copy of the given SpeciesTypeComponentIndex object to this MultiSpeciesType.
(SpeciesTypeComponentIndex)
the SpeciesTypeComponentIndex object to add
Creates a new SpeciesTypeComponentIndex object and adds it to the ListOfSpeciesTypeComponentIndexes.
SpeciesTypeComponentIndex
:
a new SpeciesTypeComponentIndex object instance to add to the
ListOfSpeciesTypeComponentIndexes object within this MultiSpeciesType
object.
Removes the nth SpeciesTypeComponentIndex object from the ListOfSpeciesTypeComponentIndexes.
(number)
the index of the SpeciesTypeComponentIndex to remove.
SpeciesTypeComponentIndex
:
the object removed, or NULL if no such object exists. Note that
the caller owns the returned object and is responsible for deleting it.
Get the nth InSpeciesTypeBond object from the ListOfInSpeciesTypeBonds.
(number)
the index number of the InSpeciesTypeBond to get.
InSpeciesTypeBond
:
the nth object, or NULL if the index is out of range.
Adds a copy the given InSpeciesTypeBond object to this MultiSpeciesType.
(InSpeciesTypeBond)
the InSpeciesTypeBond object to add
Creates a new InSpeciesTypeBond object and adds it to the ListOfInSpeciesTypeBonds.
InSpeciesTypeBond
:
a new InSpeciesTypeBond object instance.
Removes the nth InSpeciesTypeBond object from the ListOfInSpeciesTypeBonds. and returns a pointer to it.
(number)
the index of the InSpeciesTypeBond to remove.
InSpeciesTypeBond
:
the nth object, or NULL if the index is out of range.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
The SpeciesTypeComponentIndex object is a child of MultiSpeciesType, and provides a way to identify or index a component within that MultiSpeciesType. A SpeciesTypeComponentIndex object can be referenced by other class objects, such as InSpeciesTypeBond, OutwardBindingSite, SpeciesFeature or SpeciesTypeComponentMapInProduct objects, which need to identify a component in a particular MultiSpeciesType. A SpeciesTypeComponentIndex should be unambiguous. For example, a SpeciesTypeComponentIndex should not reference a MultiSpeciesType which is referenced by two SpeciesTypeInstance objects contained in the same MultiSpeciesType object.
Unsets the value of the "component" attribute of this SpeciesTypeComponentIndex.
Unsets the value of the "identifyingParent" attribute of this SpeciesTypeComponentIndex.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
The SpeciesTypeComponentMapInProduct object is a child of a SpeciesReference (via the MultiSpeciesReferencePlugin) in a Reaction, and defines the mapping between a component in a reactant and a component in a product. The identifications of a component and the SpeciesReference should be sufficient to identify the component in the context of a reaction. The attributes "reactant" and "reactantComponent" can identify the component in a reactant, and the "productComponent" attribute and the product storing the mapping information can identify the component in a product.
Unsets the value of the "reactant" attribute of this SpeciesTypeComponentMapInProduct.
Unsets the value of the "reactantComponent" attribute of this SpeciesTypeComponentMapInProduct.
Unsets the value of the "productComponent" attribute of this SpeciesTypeComponentMapInProduct.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
The SpeciesTypeInstance object is a child of MultiSpeciesType, and provides a way to construct MultiSpeciesType objects and Species with multiple components. A MultiSpeciesType can contain a list of instances of other MultiSpeciesType objects which can also have their own SpeciesTypeInstance objects, so the complete construct of a MultiSpeciesType has a tree structure. A MultiSpeciesType cannot contain an instance of any other MultiSpeciesType that already contains the instance of it. In other words, circular references are not allowed when constructing MultiSpeciesType objects. For example, if a MultiSpeciesType "A" contains the instance of another MultiSpeciesType "B", "B" must not contain the instance of "A" anywhere in the complete structure of "B". The optional attribute compartmentReference, of type SIdRef, can be used to indicate which sub-compartment in a composite compartment the SpeciesTypeInstance is located in.
Unsets the value of the "speciesType" attribute of this SpeciesTypeInstance.
Unsets the value of the "compartmentReference" attribute of this SpeciesTypeInstance.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
The SubListOfSpeciesFeatures object is an optional child of the ListOfSpeciesFeatures list child of the extended Species (via the MultiSpeciesPlugin object). Listed alongside its sibling SpeciesFeature objects, it allows the user to define a set of two or more SpeciesFeature elements that have a logical relationship with each other. This relationship is defined by the "relation" attribute, which is an enumeration of values representing "and", "or", "not". (An "unknown" option is provided here for incomplete models, but cannot be used in a valid SBML document.) The following constants represent the values: libsbml.MULTI_RELATION_AND, libsbml.MULTI_RELATION_OR, libsbml.MULTI_RELATION_NOT, and libsbml.MULTI_RELATION_UNKNOWN. If any SpeciesFeature involved in a SubListOfSpeciesFeatures references a SpeciesFeatureType with an "occur" attribute greater than 1, the SubListOfSpeciesFeatures can only have the value "and" for its relation attribute.
Unsets the value of the "component" attribute of this SubListOfSpeciesFeatures.
Creates a new SpeciesFeature object and adds it to this SubListOfSpeciesFeatures object.
SpeciesFeature
:
the newly created SpeciesFeature object.
Get the nth SpeciesFeature object from the SubListOfSpeciesFeatures.
(number)
the index number of the SpeciesFeature to get.
SpeciesFeature
:
the nth object, or NULL if the index is out of range.
Removes the nth SpeciesFeature object from this SubListOfSpeciesFeatures.
(number)
the index of the SpeciesFeature to remove.
SpeciesFeature
:
the object removed, or NULL if no such object exists. Note that
the caller owns the returned object and is responsible for deleting it.
Returns the value of the "relation" attribute of this SubListOfSpeciesFeatures.
Relation_t
:
the value of the "relation" attribute of this
SubListOfSpeciesFeatures.
Sets the value of the "relation" attribute of this SubListOfSpeciesFeatures.
(Relation_t)
value of the "relation" attribute to be set
Unsets the value of the "relation" attribute of this SubListOfSpeciesFeatures.
Adds an item to the end of this ListOf's list of items.
This method does not clone the disownedItem 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.
(SBase)
the item to be added to the list.
Will become a child of the parent list.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
The DefaultTerm defines the default result of a Transition, held in the (required) "resultLevel" attribute. This term is used when there are no other FunctionTerm elements or when none of the Math elements of the FunctionTerm elements evaluate to @c true.
Unsets the value of the "resultLevel" attribute of this DefaultTerm.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
Each FunctionTerm is associated with a result and with a Boolean function inside a Math element that can be used to set the conditions under which this term is selected.
Unsets the value of the "resultLevel" attribute of this FunctionTerm.
Unsets the "math" element of this FunctionTerm.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Predicate returning true if this object's "name" attribute is set.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
Each Input refers to a QualitativeSpecies that participates in the corresponding Transition. In Petri nets, these are the input places of the transition. In logical models, they are the regulators of the species whose behaviour is defined by the transition.
Returns the value of the "transitionEffect" attribute of this Input.
InputTransitionEffect_t
:
the value of the "transitionEffect" attribute of this Input as a string.
Returns the value of the "sign" attribute of this Input.
InputSign_t
:
the value of the "sign" attribute of this Input as a string.
Sets the value of the "transitionEffect" attribute of this Input.
(InputTransitionEffect_t)
the value of the "transitionEffect" attribute to be set.
Sets the value of the "sign" attribute of this Input.
(InputSign_t)
the value of the "sign" attribute to be set.
Unsets the value of the "qualitativeSpecies" attribute of this Input.
Unsets the value of the "transitionEffect" attribute of this Input.
Unsets the value of the "sign" attribute of this Input.
Unsets the value of the "thresholdLevel" attribute of this Input.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
Each Output refers to a QualitativeSpecies that participates in (is affected by) the corresponding Transition. In Petri net models these are the output places of the transition.
In a logical model, a QualitativeSpecies should be referenced in at most one ListOfOutputs, (that of the Transition defining the evolution of this species). When a Transition has several outputs, it is because the referenced species share the same regulators and the same logical rules.
Returns the value of the "transitionEffect" attribute of this Output.
OutputTransitionEffect_t
:
the value of the "transitionEffect" attribute of this Output as a string.
Sets the value of the "transitionEffect" attribute of this Output.
(OutputTransitionEffect_t)
the value of the "transitionEffect" attribute to be set.
Unsets the value of the "qualitativeSpecies" attribute of this Output.
Unsets the value of the "transitionEffect" attribute of this Output.
Unsets the value of the "name" attribute of this Output.
Unsets the value of the "outputLevel" attribute of this Output.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
Similarly to the Species in SBML, the components of qualitative models refer to pools of entities that are considered indistinguishable and are each located in a specific Compartment. However, here components are characterised by their qualitative influences rather than by taking part in reactions. Therefore, we define the QualitativeSpecies element to represent such pools of entities.
In a Petri net, qualitative species refer to the places of the model, while in a logical model, they refer to the variables of this model (i.e. nodes of the influence graph).
A QualitativeSpecies describes a pool of indistinguishable entities in a Compartment. It is associated with a level (an integer representing e.g. an activity state, or a functional level of concentration, etc.)
Unsets the value of the "compartment" attribute of this QualitativeSpecies.
Unsets the value of the "constant" attribute of this QualitativeSpecies.
Unsets the value of the "initialLevel" attribute of this QualitativeSpecies.
Unsets the value of the "maxLevel" attribute of this QualitativeSpecies.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
A Transition element contains at most one ListOfInputs and one ListOfOutputs and exactly one ListOfFunctionTerms.
A Transition defines the changes in level associated with the QualitativeSpecies that occur when a Transition is enabled.
In logical models, a Transition is used to specify the logical rule associated with a QualitativeSpecies (that appears as an Output of this Transition). For example, the rule "if A > 1 : B = 2" would be encapsulated as a Transition with QualitativeSpecies "A" as an Input and "B" as an Output; the "if A > 1" rule being encode by the math element of a FunctionTerm with the resultLevel attribute having a value "2".
In Petri net models, a Transition is interpreted, using the common Petri net semantics, as events that might occur within the system causing tokens to be moved.
Get a FunctionTerm from the ListOfFunctionTerms.
(number)
the index number of the FunctionTerm to get.
FunctionTerm
:
the nth FunctionTerm in the ListOfFunctionTerms within this Transition.
If the index n is invalid, NULL is returned.
Adds a copy the given FunctionTerm to this Transition.
(any)
the FunctionTerm object to add.
Creates a new FunctionTerm object, adds it to this Transition's ListOfFunctionTerms and returns the FunctionTerm object created.
FunctionTerm
:
a new FunctionTerm object instance.
Removes the nth FunctionTerm from the ListOfFunctionTerms within this Transition. and returns a pointer to it.
The caller owns the returned item and is responsible for deleting it.
(number)
the index of the FunctionTerm to remove.
FunctionTerm
:
Creates a new DefaultTerm object, adds it to this Transition's ListOfFunctionTerms and returns the DefaultTerm object created.
DefaultTerm
:
a new DefaultTerm object instance.
Sets the given DefaultTerm to this Transition.
(DefaultTerm)
the DefaultTerm object to add.
Get the DefaultTerm from the ListOfFunctionTerms.
DefaultTerm
:
the DefaultTerm in the ListOfFunctionTerms within this Transition, or NULL if no such value is set.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
The extension of SBML Level 3 Core's Model class is relatively straightforward: the Qualitative Models Package adds two lists, one for holding qualitativeSpecies (ListOfQualitativeSpecies), and the other for holding transitions (ListOfTransitions). The Model element may contain at most one ListOfQualitativeSpecies, which must contain at least one QualitativeSpecies. It may also contain at most one ListOfTransitions which must contain at least one Transition.
Returns the QualitativeSpecies object that belongs to the given index. If the index is invalid, NULL is returned.
(number)
the index number of the QualitativeSpecies to get.
QualitativeSpecies
:
the nth QualitativeSpecies in the ListOfQualitativeSpecies.
If the index n is invalid, @c NULL is returned.
Adds a copy of the given QualitativeSpecies object to the list of qual.
(QualitativeSpecies)
the QualitativeSpecies object to be added to the list of qual.
Creates a new qual object and adds it to the list of qual objects and returns it.
QualitativeSpecies
:
a newly created QualitativeSpecies object.
Removes the nth QualitativeSpecies object from this plugin object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
(number)
the index of the QualitativeSpecies object to remove.
QualitativeSpecies
:
the QualitativeSpecies object removed. As mentioned above, the
caller owns the returned object. NULL is returned if the
given index is out of range.
Returns the Transition object that belongs to the given index. If the index is invalid, NULL is returned.
(number)
the index number of the Transition to get.
Transition
:
the nth Transition in the ListOfTransitions.
If the index n is invalid, @c NULL is returned.
Adds a copy of the given Transition object to the list of qual.
(Transition)
the Transition object to be added to the list of qual.
Creates a new qual object and adds it to the list of qual objects and returns it.
Transition
:
a newly created Transition object.
Removes the nth Transition object from this plugin object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
(number)
the index of the Transition object to remove.
Transition
:
the Transition object removed. As mentioned above, the
caller owns the returned object. NULL is returned if the
given index is out of range.
Returns the XML namespace URI for the package to which this object belongs.
In the XML representation of an SBML document, XML namespaces are used to identify the origin of each XML construct used. XML namespaces are identified by their unique resource identifiers (URIs). The core SBML specifications stipulate the namespaces that must be used for core SBML constructs; for example, all XML elements that belong to SBML Level 3 Version 1 Core must be placed in the XML namespace identified by the URI "http://www.sbml.org/sbml/level3/version1/core". Individual SBML Level 3 packages define their own XML namespaces; for example, all elements belonging to the SBML Level 3 Layout Version 1 package must be placed in the XML namespace "http://www.sbml.org/sbml/level3/version1/layout/version1/".
This method first looks into the SBMLNamespaces object possessed by the parent SBMLDocument object of the current object. If this cannot be found, this method returns the result of getElementNamespace().
string
:
a string, the URI of the XML namespace to which this object belongs.
The QualSBMLDocumentPlugin class inherits from the SBMLDocumentPlugin class, and codifies the extensions to the SBMLDocument class defined in the SBML Level 3 qual ("qual") package.
The QualSBMLDocumentPlugin defines a
required flag named required, which indicates whether the
'qual' constructs can be used to change the core mathematics of the
model
child of the sbml
element.
Because they can not, this attribute must be set false.
Returns the XML namespace URI for the package to which this object belongs.
In the XML representation of an SBML document, XML namespaces are used to identify the origin of each XML construct used. XML namespaces are identified by their unique resource identifiers (URIs). The core SBML specifications stipulate the namespaces that must be used for core SBML constructs; for example, all XML elements that belong to SBML Level 3 Version 1 Core must be placed in the XML namespace identified by the URI "http://www.sbml.org/sbml/level3/version1/core". Individual SBML Level 3 packages define their own XML namespaces; for example, all elements belonging to the SBML Level 3 Layout Version 1 package must be placed in the XML namespace "http://www.sbml.org/sbml/level3/version1/layout/version1/".
This method first looks into the SBMLNamespaces object possessed by the parent SBMLDocument object of the current object. If this cannot be found, this method returns the result of getElementNamespace().
string
:
a string, the URI of the XML namespace to which this object belongs.
There is currently one possible namespace defined for the Qualitative Modeling package: "http://www.sbml.org/sbml/level3/version1/qual/version1". Despite referencing SBML Level 3 Version 1 explicitly, this package (and all such packages) can be used without change in SBML Level 3 Version 2 documents. The only caveat is that features of the SBML Level 3 Version 2 specification that were not present in Level 1 may not be used by constructs from the Qualitative Modeling package.
The CompBase class derives from SBase, and defines a few functions and features common to all SBase-derived classes in the SBML Level 3 comp ("comp") package.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
The SBaseRef class was introduced by the SBML Level 3 comp ("comp") package as the principle way by which submodel elements may be referenced. The SBaseRef class is usually found as the base class of a Port, Deletion, ReplacedElement, or ReplacedBy class, but may appear as an child of one of the above classes if the parent object references a Submodel.
An SBaseRef object must reference an element using exactly one of the optional attributes of the class. Subclasses of SBaseRef may define additional optional attributes that are legal ways to reference an element.
SBaseRef objects may reference elements that do not live in the Model parent of the SBaseRef object. However, the SBaseRef class itself does not provide a method of determining which Model or Submodel is being referenced. The subclasses of SBaseRef provide methods for this instead.
Once the Model to which the SBaseRef object is referencing has been established, there are four optional attributes defined in the SBaseRef class that are each methods of referencing an element:
PortSIdRef
): As its name implies, this attribute is used to
refer to a port identifier, in the case when the reference being
ructed with the SBaseRef is intended to refer to a port on a
submodel. The namespace of the PortSIdRef
value is the set
of identifiers of type PortSId
defined in the submodel, not
the parent model.SIdRef
): As its name implies, this attribute is used to
refer to a regular identifier (i.e., the value of an "id"
attribute on some other object), in the case when the reference being
ructed with the SBaseRef is intended to refer to an object that
does not have a port identifier. The namespace of the SIdRef
value is the set of identifiers of type SId defined in the
submodel, not the parent model.UnitSIdRef
): This attribute is used to refer to the identifier
of a UnitDefinition object. The namespace of the UnitSIdRef
value is the set of unit identifiers defined in the submodel, not the
parent model. (Note that even though this attribute is of type UnitSIdRef
,
the reserved unit identifiers that are defined by SBML Level 3 (see
Section 3.1.10 of the core specification) are
not permitted as values of "unitRef". Reserved unit
identifiers may not be replaced or deleted.)IDREF
): This attribute is used to refer to a "metaid"
attribute value on some other object, in the case when the reference
beingructed with the SBaseRef is intended to refer to an object
that does not have a port identifier. The namespace of the "metaIdRef"
value is the entire document in which the referenced model resides, but
must refer to a subelement of the referenced model. Since meta identifiers are
optional attributes of SBase, all SBML objects have the potential to
have a meta identifier value.An SBaseRef object may have up to one subcomponent named "SBaseRef", of type SBaseRef. This permits recursive structures to beructed so that objects inside submodels can be referenced.
The form of such recursive references must be as follows. The highest-level SBaseRef object of such a chain (which will necessarily be an object of class Port, Deletion, ReplacedElement or ReplacedBy, because they are the only classes derived from the class SBaseRef) must refer to a Submodel object in the containing model. All child SBaseRef objects in the chain must refer to components inside the Model instance to which the Submodel refers.
Sets the value of the "metaIdRef" attribute of this SBaseRef.
This method fails if the id is not a valid syntax for an IDREF
(libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE), or if the SBaseRef already
points to an element of the submodel using a different interface (libsbml.LIBSBML_OPERATION_FAILED). An SBaseRef must use exactly one
method to point to a submodel element.
Unsets the value of the "metaIdRef" attribute of this SBaseRef.
Sets the value of the "portRef" attribute of this SBaseRef. Fails if
the id is not a valid syntax for a PortSIdRef
(libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE), or if the SBaseRef already
points to an element of the submodel using a different interface (libsbml.LIBSBML_OPERATION_FAILED). An SBaseRef must use exactly one
method to point to a submodel element.
Unsets the value of the "portRef" attribute of this SBaseRef.
Returns the value of the "idRef" attribute of this SBaseRef.
any
:
the value of the "idRef" attribute of this SBaseRef.
Sets the value of the "idRef" attribute of this SBaseRef.
This method fails if the id is not a valid syntax for an SIdRef
(libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE), or if the SBaseRef already
points to an element of the submodel using a different interface (libsbml.LIBSBML_OPERATION_FAILED). A SBaseRef must use exactly one
method to point to a submodel element.
Unsets the value of the "idRef" attribute of this SBaseRef.
Sets the value of the "unitRef" attribute of this SBaseRef.
This method fails if the id is not a valid syntax for a UnitSIdRef
(libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE), or if the SBaseRef already
points to an element of the submodel using a different interface (libsbml.LIBSBML_OPERATION_FAILED). A SBaseRef must use exactly one
method to point to a submodel element.
Unsets the value of the "unitRef" attribute of this SBaseRef.
Get the child SBaseRef of this SBaseRef.
any
:
the SBaseRef child of this SBaseRef, or NULL if none exists.
Sets the SBaseRef definition of this SBaseRef to a copy of the given SBaseRef object instance.
This method fails if the added SBaseRef does not match the level/version/package of the parent object or if the added SBaseRef cannot be copied.
(SBaseRef)
SBaseRef object instance to use
Unsets the child SBaseRef of this SBaseRef. Deletes the former SBaseRef child, if one existed.
Returns how many elements are being referred to by this SBaseRef. A valid SBaseRef will have exactly one. Possible referents are portRef, idRef, unitRef, and metaIdRef.
number
:
integer value between 0 and 4: the number of different ways this element points to its referent.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
The Port class was introduced by the SBML Level 3 comp ("comp") package to allow a Model to define a standard interface between it and other models that might use it as a submodel. It derives from the SBaseRef class, and the elements defined there refer to elements in the same parent Model as the Port object. A Port object instance therefore uses those attributes to define a port for a component in a model. When other SBaseRef or SBaseRef-derived classes refer to a Port object using a "portRef" attribute, the element being referenced is the element the Port object itself points to.
In the present formulation of the Hierarchical Model Composition package, the use of ports is not enforced, nor is there any mechanism to restrict which ports may be used in what ways---they are only an advisory construct. Future versions of this SBML package may provide additional functionality to support explicit restrictions on port use. For the present definition of Hierarchical Model Composition, users of models containing ports are encouraged to respect the modeler's intention in defining ports, and use the port definitions to interact with components through their ports (when they have ports defined) rather than interact directly with the components.
The required attribute "id" is used to give an identifier to a Port object so that other objects can refer to it. The attribute has type PortSId and is essentially identical to the SBML primitive type SId, except that its namespace is limited to the identifiers of Port objects defined within a Model object. In parallel, the PortSId type has a companion type, PortSIdRef, that corresponds to the SBML primitive type SIdRef; the value space of PortSIdRef is limited to PortSId values.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
Sets the value of the "metaIdRef" attribute of this SBaseRef.
This method fails if the id is not a valid syntax for an IDREF
(libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE), or if the SBaseRef already
points to an element of the submodel using a different interface (libsbml.LIBSBML_OPERATION_FAILED). An SBaseRef must use exactly one
method to point to a submodel element.
Unsets the value of the "metaIdRef" attribute of this SBaseRef.
Sets the value of the "portRef" attribute of this SBaseRef. Fails if
the id is not a valid syntax for a PortSIdRef
(libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE), or if the SBaseRef already
points to an element of the submodel using a different interface (libsbml.LIBSBML_OPERATION_FAILED). An SBaseRef must use exactly one
method to point to a submodel element.
Unsets the value of the "portRef" attribute of this SBaseRef.
Returns the value of the "idRef" attribute of this SBaseRef.
any
:
the value of the "idRef" attribute of this SBaseRef.
Sets the value of the "idRef" attribute of this SBaseRef.
This method fails if the id is not a valid syntax for an SIdRef
(libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE), or if the SBaseRef already
points to an element of the submodel using a different interface (libsbml.LIBSBML_OPERATION_FAILED). A SBaseRef must use exactly one
method to point to a submodel element.
Unsets the value of the "idRef" attribute of this SBaseRef.
Sets the value of the "unitRef" attribute of this SBaseRef.
This method fails if the id is not a valid syntax for a UnitSIdRef
(libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE), or if the SBaseRef already
points to an element of the submodel using a different interface (libsbml.LIBSBML_OPERATION_FAILED). A SBaseRef must use exactly one
method to point to a submodel element.
Unsets the value of the "unitRef" attribute of this SBaseRef.
Get the child SBaseRef of this SBaseRef.
any
:
the SBaseRef child of this SBaseRef, or NULL if none exists.
Sets the SBaseRef definition of this SBaseRef to a copy of the given SBaseRef object instance.
This method fails if the added SBaseRef does not match the level/version/package of the parent object or if the added SBaseRef cannot be copied.
(SBaseRef)
SBaseRef object instance to use
Unsets the child SBaseRef of this SBaseRef. Deletes the former SBaseRef child, if one existed.
Returns how many elements are being referred to by this SBaseRef. A valid SBaseRef will have exactly one. Possible referents are portRef, idRef, unitRef, and metaIdRef.
number
:
integer value between 0 and 4: the number of different ways this element points to its referent.
The comp ("comp") package allows multiple Model objects
to be defined in a single SBMLDocument. While these new Model objects are
not new SBML classes, they are given a new name,
<modelDefinition>
, and reside in ListOfModelDefinition
objects. In libSBML, this class inherits from the Model class, changing
only the expected parent of the object, and the XML name.
An additional restriction is placed on the "id" attribute of ModelDefinition objects: not only must it be unique across all such attributes of type SId within the ModelDefinition, it must also be unique across all Model, ModelDefinition, and ExternalModelDefinition objects in the same SBMLDocument.
Adds the given Reaction object to this Model.
❗DANGER: in libSBML, addX methods can have complex ownership semantics. Model#createReaction should be used instead.
(Reaction)
the Reaction object to add
Removes the nth Reaction object from this Model object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
(number)
the index of the Reaction object to remove.
Reaction
:
the Reaction object removed, or NULL if the given index is
out of range.
Adds the given Species object to this Model.
❗DANGER: in libSBML, addX methods can have complex ownership semantics. Model#createSpecies should be used instead.
(Species)
the Species object to add
Removes the nth Species object from this Model object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
(number)
the index of the Species object to remove.
Species
:
the Species object removed, or NULL if the given index is out
of range.
Get the nth UnitDefinition object in this Model.
(number)
the index of the object to return
UnitDefinition
:
the nth UnitDefinition of this Model.
If the index n is invalid, NULL is returned.
Get the nth Compartment object in this Model.
(number)
the index of the object to return.
Compartment
:
the nth Compartment of this Model.
If the index n is invalid, NULL is returned.
Creates a new Compartment inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as any SBML package namespaces, are used to initialize this object's corresponding attributes.
Compartment
:
the Compartment object created.
Removes the nth Compartment object from this Model object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
(number)
the index of the Compartment object to remove.
Compartment
:
the Compartment object removed, or @c NULL if the given index is
out of range.
Get the nth FunctionDefinitions object in this Model.
(number)
the index of the object to return
FunctionDefinition
:
the nth FunctionDefinition of this Model.
If the index n is invalid, NULL is returned.
Get a SpeciesReference object based on its identifier.
(string)
the identifier to search for
SpeciesReference
:
the SpeciesReference in this Model with the identifier sid or NULL
if no such SpeciesReference exists.
Get a ModifierSpeciesReference object based on its identifier.
(string)
the identifier to search for
ModifierSpeciesReference
:
the ModifierSpeciesReference in this Model with the
identifier sid or NULL
if no such ModifierSpeciesReference exists.
Get the nth InitialAssignment object in this Model.
(number)
the index of the object to return
InitialAssignment
:
the nth InitialAssignment of this Model.
If the index n is invalid, NULL is returned.
Get an InitialAssignment object based on the symbol to which it assigns a value.
(string)
the symbol to search for
InitialAssignment
:
the InitialAssignment in this Model with the given "symbol"
attribute value or NULL if no such InitialAssignment exists.
Creates a new InitialAssignment inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as any SBML package namespaces, are used to initialize this object's corresponding attributes.
InitialAssignment
:
the InitialAssignment object created.
Creates a new AlgebraicRule inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as any SBML package namespaces, are used to initialize this object's corresponding attributes.
AlgebraicRule
:
the AlgebraicRule object created.
Creates a new AssignmentRule inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as any SBML package namespaces, are used to initialize this object's corresponding attributes.
AssignmentRule
:
the AssignmentRule object created.
Creates a new Constraint inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as any SBML package namespaces, are used to initialize this object's corresponding attributes.
Constraint
:
the Constraint object created.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
The ExternalModelDefinition class was introduced by the SBML Level 3 comp ("comp") package to define references to Model objects defined in other files.
ExternalModelDefinition objects are model definitions---in and of themselves, they are definitions of models but not uses of those models. The class provides a way to declare and identify them so that Model objects in the present SBML document can use them in Submodel objects.
ExternalModelDefinition contains two required attributes ("source" and "id") and three optional attributes ("modelRef", "md5" and "name").
The "id" attribute serves to provide a handle for the external model reference so that Submodel objects can refer to it. Crucially, it is not the identifier of the model being referenced; rather, it is an identifier for this ExternalModelDefinition object within the current SBML document. The "id" attribute takes a required value of type SId, and must be unique across all Model and ExternalModelDefinition objects present in the document.
ExternalModelDefinition also has an optional "name" attribute, of type 'string'. The "name" attribute may be used to provide a human-readable description of the ExternalModelDefintion object.
The required attribute "source" is used to locate the SBML document containing an external model definition. The value of this attribute must be of type anyURI. Since URIs may be either URLs, URNs, or relative or absolute file locations, this offers flexibility in referencing SBML documents. In all cases, the "source" attribute value must refer specifically to an SBML Level 3 document; prior Levels/Versions of SBML are not supported by this package. The entire file at the given location is referenced. The "source" attribute must have a value for every ExternalModelDefinition instance.
It should be noted that even though there is currently only a Hierarchical Model Composition package for SBML Level 3 Version 1, it may be used in SBML Level 3 Version 2, as long as nothing new from that package is used. This allows the ExternalModelDefinition to reference any SBML Level 3 document, so long as only constructs from Version 1 are used.
ExternalModelDefinition's optional attribute "modelRef", of type SIdRef, is used to identify a Model or ExternalModelDefinition object within the SBML document located at "source". The object referenced may be the main model in the document, or it may be a model definition contained in the SBML document's ListOfModelDefinitions or ListOfExternalModelDefinitions lists. Loops are not allowed: it must be possible to follow a chain of ExternalModelDefinition objects to its end in a Model object.
In core SBML, the "id" on Model is an optional attribute, and therefore,
it is possible that the Model object in a given SBML document does not
have an identifier. In that case, there is no value to give to the
"modelRef" attribute in ExternalModelDefinition. If "modelRef" does not
have a value, then the main model (i.e., the <model>
element within the <sbml>
element) in the referenced
file is interpreted as being the model referenced by this
ExternalModelDefinition instance.
Finally, the optional "md5" attribute takes a string value. If set, it must be an MD5 checksum value computed over the document referenced by "source". This checksum can serve as a data integrity check over the contents of the "source". Applications may use this to verify that the contents have not changed since the time that the ExternalModelDefinition reference was constructed.
Unsets the value of the "modelRef" attribute of this ExternalModelDefinition.
Unsets the value of the "md5" attribute of this ExternalModelDefinition.
Unsets the value of the "source" attribute of this ExternalModelDefinition.
Resolves and returns the referenced Model object of this ExternalModelDefinition. If none can be found, an error is set and NULL is returned. The returned Model is a non-owning pointer to the model; the original Model is saved (along with the SBMLDocument from which it comes) as a child of the CompSBMLDocumentPlugin of the SBMLDocument to which this Model belongs. If this ExternalModelDefinition is not part of any SBMLDocument, NULL will be returned.
Model
:
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
The Submodel class was introduced by the SBML Level 3 comp ("comp") package as the principle way by which models are structured hierarchically. Submodels are instantiations of models contained within other models. They reference another Model that is to be instantiated within its parent Model, and additionally define how that Model is to be modified before instantiation.
The Submodel object class has a required attribute "modelRef", which must reference another Model or ExternalModelDefinition object present in the SBML Document. This referenced Model is the model to be instantiated.
It also has a required attribute, "id", to give the submodel a unique identifier by which other parts of an SBML model definition can refer to it, and an optional "name" attribute of type string. Identifiers and names must be used according to the guidelines described in the SBML specification.
The Submodel class also providesructs that define how the referenced Model object is to be modified before it is instantiated in the enclosing model. If numerical values in the referenced model must be changed in order to fit them into their new context as part of the submodel, the changes can be handled through conversion factors. If one or more structural features in the referenced model are undesirable and should be removed, the changes can be handled through deletions. (For example, an initial assignment or reaction may not be relevant in its new context and should be removed.)
In some cases, the referenced Model may have been written with different units than the containing model. For most model elements, this is not a problem: it is already possible to have Species and Parameter objects with different units in a single model, for example, so in this case the resulting hierarchical model would be treated in exactly the same way as any other model with Species and Parameters with different units.
However, two units in SBML models are fixed and must not vary between SBML elements: time and extent. The units of time are set once per model, and affect the core elements of RateRule, KineticLaw, Delay, and the csymbols 'time' and 'delay'. Even if the model does not explicitly state what the units of time actually are, they are defined to be consistent across the model, and therefore might differ from the units of time across a parent model. To correct this imbalance, the optional attribute "timeConversionFactor" may be used, which, if defined, must reference a ant parameter in the parent model. The value of the time conversion factor should be defined such that a single unit of time in the Submodel multiplied by the time conversion factor should equal a single unit of time in the parent model.
Extent is the unit in SBML that defines how the KineticLaw of a Reaction affects species quantities: kinetic laws are defined to be in units of extent/time. No other SBML coreruct is defined in terms of extent. If the effective units of extent in a submodel differ from the effective units of extent in the parent model (regardless of whether either defined what those units actually are), the optional attribute "extentConversionFactor" may be used, which, if defined, must reference a ant parameter in the parent model. The value of the extent conversion factor should be defined such that a single unit of extent in the Submodel multiplied by the extent conversion factor should equal a single unit of extent in the parent model.
If features of the referenced model must be removed, a Deletion should be added to the Submodel object. A Submodel may contain a child ListOfDeletions, which in turn may contain one or more Deletion items. Each Deletion references a single element of the referenced Model that must be removed before instantiating that Model as a submodel of the parent Model.
Unsets the value of the "modelRef" attribute of this Submodel.
Automatically fails, since "substanceConversionFactor" is not a part of the comp spec.
Automatically fails, since "substanceConversionFactor" is not a part of the comp spec.
Sets the value of the "timeConversionFactor" attribute of this Submodel. Fails if the id is not a valid syntax for an SIdRef.
Unsets the value of the "timeConversionFactor" attribute of this Submodel.
Sets the value of the "extentConversionFactor" attribute of this Submodel. Fails if the id is not a valid syntax for an SIdRef.
Unsets the value of the "extentConversionFactor" attribute of this Submodel.
Adds a copy of the given Deletion object to the list of deletions.
(any)
the Deletion object to be added to the list of
deletions. Fails if the added deletion is NULL, does not match the
level/version/package of the parent object, or cannot be added to the
list of deletions
(Deletion)
Removes the deletion with the given index from the Submodel. A pointer to the deletion that was removed is returned. If no deletion has been removed, NULL is returned.
(number)
the index of the Deletion object to remove
Deletion
:
the Deletion object removed. As mentioned above,
the caller owns the returned object. NULL is returned if
the given index is out of range.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
The Deletion class was introduced by the SBML Level 3 comp ("comp") package to allow elements of submodels to be removed before instantiation.
The Deletion object class is used to define a deletion operation to be applied when a submodel instantiates a model definition. Deletions may be useful in hierarchical model composition scenarios for various reasons. For example, some components in a submodel may be redundant in the composed model, perhaps because the same features are implemented in a different way in the new model.
Deletions function as follows. When the Model to which the Submodel object refers (via the "modelRef" attribute) is read and processed for inclusion into the composed model, each Deletion object identifies an object to remove from that Model instance. The resulting submodel instance consists of everything in the Model object instance minus the entities referenced by the list of Deletion objects.
As might be expected, deletions can have wide-ranging implications, especially when the object deleted has substantial substructure, as in the case of reactions. The following are rules regarding deletions and their effects.
The Deletion object class is subclassed from SBaseRef, and reuses all the machinery provided by SBaseRef. In addition, it defines two optional attributes, "id" and "name". The "id" attribute can be used to give an identifier to a given deletion operation. The identifier has no mathematical meaning, but it may be useful for creating submodels that can be manipulated more directly by other submodels. (Indeed, it is legitimate for an enclosing model definition to delete a deletion!)
The optional "name" attribute is provided on Deletion for the same reason it is provided on other elements that have identifiers; viz., to provide for the possibility of giving a human-readable name to the object. The name may be useful in situations when deletions are displayed to modelers.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
Sets the value of the "metaIdRef" attribute of this SBaseRef.
This method fails if the id is not a valid syntax for an IDREF
(libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE), or if the SBaseRef already
points to an element of the submodel using a different interface (libsbml.LIBSBML_OPERATION_FAILED). An SBaseRef must use exactly one
method to point to a submodel element.
Unsets the value of the "metaIdRef" attribute of this SBaseRef.
Sets the value of the "portRef" attribute of this SBaseRef. Fails if
the id is not a valid syntax for a PortSIdRef
(libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE), or if the SBaseRef already
points to an element of the submodel using a different interface (libsbml.LIBSBML_OPERATION_FAILED). An SBaseRef must use exactly one
method to point to a submodel element.
Unsets the value of the "portRef" attribute of this SBaseRef.
Returns the value of the "idRef" attribute of this SBaseRef.
any
:
the value of the "idRef" attribute of this SBaseRef.
Sets the value of the "idRef" attribute of this SBaseRef.
This method fails if the id is not a valid syntax for an SIdRef
(libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE), or if the SBaseRef already
points to an element of the submodel using a different interface (libsbml.LIBSBML_OPERATION_FAILED). A SBaseRef must use exactly one
method to point to a submodel element.
Unsets the value of the "idRef" attribute of this SBaseRef.
Sets the value of the "unitRef" attribute of this SBaseRef.
This method fails if the id is not a valid syntax for a UnitSIdRef
(libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE), or if the SBaseRef already
points to an element of the submodel using a different interface (libsbml.LIBSBML_OPERATION_FAILED). A SBaseRef must use exactly one
method to point to a submodel element.
Unsets the value of the "unitRef" attribute of this SBaseRef.
Get the child SBaseRef of this SBaseRef.
any
:
the SBaseRef child of this SBaseRef, or NULL if none exists.
Sets the SBaseRef definition of this SBaseRef to a copy of the given SBaseRef object instance.
This method fails if the added SBaseRef does not match the level/version/package of the parent object or if the added SBaseRef cannot be copied.
(SBaseRef)
SBaseRef object instance to use
Unsets the child SBaseRef of this SBaseRef. Deletes the former SBaseRef child, if one existed.
Returns how many elements are being referred to by this SBaseRef. A valid SBaseRef will have exactly one. Possible referents are portRef, idRef, unitRef, and metaIdRef.
number
:
integer value between 0 and 4: the number of different ways this element points to its referent.
The ReplacedElement class was introduced by the SBML Level 3 comp ("comp") package to allow submodel elements to be replaced, but still allow references to those elements to be valid. A ReplacedElement object is essentially a pointer to a submodel object that should be considered 'replaced'. The object holding the ReplacedElement instance is the one doing the replacing; the object pointed to by the ReplacedElement object is the object being replaced.
A replacement implies that dependencies involving the replaced object must be updated: all references to the replaced object elsewhere in the model are taken to refer to the replacement object instead. For example, if one species replaces another, then any reference to the original species in mathematical formulas, or lists of reactants or products or modifiers in reactions, or initial assignments, or any other SBML construct, are taken to refer to the replacement species, with its value possibly modified by either this object's "conversionFactor" attribute or the relevant submodel's conversion factors. Moreover, any annotations that refer to the replaced species' "metaid" value must be made to refer to the replacement species' "metaid" value instead; and anything else that referred either to an object identifier (i.e., attributes such as the "id" attribute whose types inherit from the SId primitive data type) or the meta identifier (i.e., the "metaid" attribute or any other attribute that inherits from the ID primitive data type) must be made to refer to the replacement species object instead.
It is worth noting that local parameters (inside Reaction objects) pose an
interesting edge case for these rules. In order to determine which element
is pointed to by a cn
element within the
math
element of a KineticLaw object, it is necessary
to examine the local parameters of that kinetic law's parent Reaction
object. Whether the cn
element is considered to
point to something new, then, depends on whether it pointed to the local
parameter and whether that local parameter was replaced, even if the text
of the element matched the SId value of another element in the model.
Note that local parameters may only effectively be replaced by global
parameters, since references to its SId are only valid from within the
Reaction element to which it belongs.
When referencing an element within the Submodel pointed to by the "submodelRef" attribute (defined in libSBML in the Replacing class), any of the four attributes inherited from SBaseRef for the purpose may be used (portRef, idRef, unitRef, or metaIdRef), or a new optional attribute "deletion" may be used. This attribute must be the identifier of a Deletion object in the parent Model of the ReplacedElement (i.e., the value of some Deletion object's "id" attribute). When "deletion" is set, it means the ReplacedElement object is actually an annotation to indicate that the replacement object replaces something deleted from a submodel. The use of the "deletion" attribute overrides the use of the attributes inherited from SBaseRef: instead of using, e.g., "portRef" or "idRef", the ReplacedElement instance sets "deletion" to the identifier of the Deletion object. In addition, the referenced Deletion must be a child of the Submodel referenced by the "submodelRef" attribute.
The use of ReplacedElement objects to refer to deletions has no effect on the composition of models or the mathematical properties of the result. It serves instead to help record the decision-making process that lead to a given model. It can be particularly useful for visualization purposes, as well as to serve as scaffolding where other types of annotations can be added using the normal Annotation subcomponents available on all SBase objects in SBML.
As with the Submodel class, it may be that the units of the replaced element may not match the units of the replacement element. In this case, the optional "conversionFactor" attribute may be used. This attribute, if present, defines how to transform or rescale the replaced object's value so that it is appropriate for the new contexts in which the object appears. This attribute takes a value of type SIdRef, and the value must refer to a Parameter object instance defined in the model. This parameter then acts as a conversion factor.
The value of the conversion factor should be defined such that a single unit of the replaced element multiplied by the conversion factor should equal a single unit of the replacement element, and the units of the conversion factor should be commensurate with that transformation. The referenced Parameter may be non-constant, particularly if a Species is replaced by a Species with a different "hasOnlySubstanceUnits" attribute value, thus changing amount to concentration, or visa versa.
Unsets the value of the "conversionFactor" attribute of this ReplacedElement.
Sets the value of the "deletion" attribute of this ReplacedElement.
(string)
This method fails if the id is not a valid syntax for an SIdRef (libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE), or if the SBaseRef already
points to an element of the submodel using a different interface (libsbml.LIBSBML_OPERATION_FAILED). A ReplacedElement must use exactly
one method to point to a submodel element: deletion, port, idRef,
unitRef, or metaIdRef.
Unsets the value of the "deletion" attribute of this ReplacedElement.
Returns how many elements are being referred to by this ReplacedElement. A valid ReplacedElement will have exactly one. Possible referents are deletion, port, idRef, unitRef, and metaIdRef.
number
:
integer value between 0 and 5: the number of different ways this
element points to its referent.
Unsets the value of the "SubmodelRef" attribute of this SBaseRef.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
Sets the value of the "metaIdRef" attribute of this SBaseRef.
This method fails if the id is not a valid syntax for an IDREF
(libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE), or if the SBaseRef already
points to an element of the submodel using a different interface (libsbml.LIBSBML_OPERATION_FAILED). An SBaseRef must use exactly one
method to point to a submodel element.
Unsets the value of the "metaIdRef" attribute of this SBaseRef.
Sets the value of the "portRef" attribute of this SBaseRef. Fails if
the id is not a valid syntax for a PortSIdRef
(libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE), or if the SBaseRef already
points to an element of the submodel using a different interface (libsbml.LIBSBML_OPERATION_FAILED). An SBaseRef must use exactly one
method to point to a submodel element.
Unsets the value of the "portRef" attribute of this SBaseRef.
Returns the value of the "idRef" attribute of this SBaseRef.
any
:
the value of the "idRef" attribute of this SBaseRef.
Sets the value of the "idRef" attribute of this SBaseRef.
This method fails if the id is not a valid syntax for an SIdRef
(libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE), or if the SBaseRef already
points to an element of the submodel using a different interface (libsbml.LIBSBML_OPERATION_FAILED). A SBaseRef must use exactly one
method to point to a submodel element.
Unsets the value of the "idRef" attribute of this SBaseRef.
Sets the value of the "unitRef" attribute of this SBaseRef.
This method fails if the id is not a valid syntax for a UnitSIdRef
(libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE), or if the SBaseRef already
points to an element of the submodel using a different interface (libsbml.LIBSBML_OPERATION_FAILED). A SBaseRef must use exactly one
method to point to a submodel element.
Unsets the value of the "unitRef" attribute of this SBaseRef.
Get the child SBaseRef of this SBaseRef.
any
:
the SBaseRef child of this SBaseRef, or NULL if none exists.
Sets the SBaseRef definition of this SBaseRef to a copy of the given SBaseRef object instance.
This method fails if the added SBaseRef does not match the level/version/package of the parent object or if the added SBaseRef cannot be copied.
(SBaseRef)
SBaseRef object instance to use
Unsets the child SBaseRef of this SBaseRef. Deletes the former SBaseRef child, if one existed.
The ReplacedBy class was introduced by the SBML Level 3 @ref comp ("comp") package to allow submodel elements to be 'canonical' versions of the element while still allowing the parent model to reference those elements. Whereas a ReplacedElement object indicates that the containing object replaces another, a ReplacedBy object indicates the converse: the parent object is to be replaced by another object.
As is the case with ReplacedElement, the ReplacedBy class inherits from SBaseRef. It additionally defines one required attribute ("submodelRef"), defined in libSBML in the Replacing class.
Unsets the value of the "SubmodelRef" attribute of this SBaseRef.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
Sets the value of the "metaIdRef" attribute of this SBaseRef.
This method fails if the id is not a valid syntax for an IDREF
(libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE), or if the SBaseRef already
points to an element of the submodel using a different interface (libsbml.LIBSBML_OPERATION_FAILED). An SBaseRef must use exactly one
method to point to a submodel element.
Unsets the value of the "metaIdRef" attribute of this SBaseRef.
Sets the value of the "portRef" attribute of this SBaseRef. Fails if
the id is not a valid syntax for a PortSIdRef
(libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE), or if the SBaseRef already
points to an element of the submodel using a different interface (libsbml.LIBSBML_OPERATION_FAILED). An SBaseRef must use exactly one
method to point to a submodel element.
Unsets the value of the "portRef" attribute of this SBaseRef.
Returns the value of the "idRef" attribute of this SBaseRef.
any
:
the value of the "idRef" attribute of this SBaseRef.
Sets the value of the "idRef" attribute of this SBaseRef.
This method fails if the id is not a valid syntax for an SIdRef
(libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE), or if the SBaseRef already
points to an element of the submodel using a different interface (libsbml.LIBSBML_OPERATION_FAILED). A SBaseRef must use exactly one
method to point to a submodel element.
Unsets the value of the "idRef" attribute of this SBaseRef.
Sets the value of the "unitRef" attribute of this SBaseRef.
This method fails if the id is not a valid syntax for a UnitSIdRef
(libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE), or if the SBaseRef already
points to an element of the submodel using a different interface (libsbml.LIBSBML_OPERATION_FAILED). A SBaseRef must use exactly one
method to point to a submodel element.
Unsets the value of the "unitRef" attribute of this SBaseRef.
Get the child SBaseRef of this SBaseRef.
any
:
the SBaseRef child of this SBaseRef, or NULL if none exists.
Sets the SBaseRef definition of this SBaseRef to a copy of the given SBaseRef object instance.
This method fails if the added SBaseRef does not match the level/version/package of the parent object or if the added SBaseRef cannot be copied.
(SBaseRef)
SBaseRef object instance to use
Unsets the child SBaseRef of this SBaseRef. Deletes the former SBaseRef child, if one existed.
The Replacing class does not exist officialy in the the @ref comp ("comp") package, but is implemented here as a convenience subclass of the ReplacedElement and ReplacedBy classes, since both of those classes define a 'submodelRef' attribute.
The required attribute "submodelRef" takes a value of type SIdRef, which must be the identifier of a Submodel object in the containing model. The model referenced by the Submodel object establishes the object namespaces for the "portRef", "idRef", "unitRef" and "metaIdRef" attributes: only objects within the Model object may be referenced by those attributes.
Unsets the value of the "SubmodelRef" attribute of this SBaseRef.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
Sets the value of the "metaIdRef" attribute of this SBaseRef.
This method fails if the id is not a valid syntax for an IDREF
(libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE), or if the SBaseRef already
points to an element of the submodel using a different interface (libsbml.LIBSBML_OPERATION_FAILED). An SBaseRef must use exactly one
method to point to a submodel element.
Unsets the value of the "metaIdRef" attribute of this SBaseRef.
Sets the value of the "portRef" attribute of this SBaseRef. Fails if
the id is not a valid syntax for a PortSIdRef
(libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE), or if the SBaseRef already
points to an element of the submodel using a different interface (libsbml.LIBSBML_OPERATION_FAILED). An SBaseRef must use exactly one
method to point to a submodel element.
Unsets the value of the "portRef" attribute of this SBaseRef.
Returns the value of the "idRef" attribute of this SBaseRef.
any
:
the value of the "idRef" attribute of this SBaseRef.
Sets the value of the "idRef" attribute of this SBaseRef.
This method fails if the id is not a valid syntax for an SIdRef
(libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE), or if the SBaseRef already
points to an element of the submodel using a different interface (libsbml.LIBSBML_OPERATION_FAILED). A SBaseRef must use exactly one
method to point to a submodel element.
Unsets the value of the "idRef" attribute of this SBaseRef.
Sets the value of the "unitRef" attribute of this SBaseRef.
This method fails if the id is not a valid syntax for a UnitSIdRef
(libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE), or if the SBaseRef already
points to an element of the submodel using a different interface (libsbml.LIBSBML_OPERATION_FAILED). A SBaseRef must use exactly one
method to point to a submodel element.
Unsets the value of the "unitRef" attribute of this SBaseRef.
Get the child SBaseRef of this SBaseRef.
any
:
the SBaseRef child of this SBaseRef, or NULL if none exists.
Sets the SBaseRef definition of this SBaseRef to a copy of the given SBaseRef object instance.
This method fails if the added SBaseRef does not match the level/version/package of the parent object or if the added SBaseRef cannot be copied.
(SBaseRef)
SBaseRef object instance to use
Unsets the child SBaseRef of this SBaseRef. Deletes the former SBaseRef child, if one existed.
Returns how many elements are being referred to by this SBaseRef. A valid SBaseRef will have exactly one. Possible referents are portRef, idRef, unitRef, and metaIdRef.
number
:
integer value between 0 and 4: the number of different ways this element points to its referent.
The CompModelPlugin class inherits from the SBMLSBasePlugin class, and codifies the extensions to the Model class defined in the SBML Level"3 @ref comp ("comp") package. This extension allows a Model to define Submodels (other Models that are instantiated as new parts of the parent Model), and Ports, a defined interface for including the given Model as a Submodel of a different Model.
Submodels are stored in an optional child ListOfSubmodels object, which, if present, must contain one or more Submodel objects. All of the Submodels present in the ListOfSubmodels are defined to be instantiated in the 'complete' Model.
Ports are stored in an optional child ListOfPorts object, which, if present, must contain one or more Port objects. All of the Ports present in the ListOfPorts collectively define the 'port interface' of the Model.
Returns the submodel with the given index. If the index is invalid, NULL is returned.
any
:
the nth Submodel in the ListOfSubmodels or NULL if
no such object exists.
Adds a copy of the given Submodel object to the list of submodels.
Fails if the added submodel is NULL, does not match the level/version/package of the parent object, or cannot be added to the list of submodels.
(Submodel)
the Submodel object to be added to the list of
submodels
Returns the number of submodels for this CompModelPlugin.
any
:
the number of submodels for this CompModelPlugin.
Removes the submodel with the given index. A pointer to the submodel that was removed is returned. The caller owns the returned item and is responsible for deleting it.
(number)
the index of the Submodel object to remove
Submodel
:
the Submodel object removed. As mentioned above, the caller
owns the returned object. NULL is returned if the given index is
out of range and no submodel has been removed, NULL is returned.
Removes the port with the given index. The caller owns the returned item and is responsible for deleting it.
(any)
the index of the Port object to remove
any
:
the Port object removed. As mentioned above,
the caller owns the returned object. NULL is returned if
the given index is out of range.
Set the string used as the divider between names when renaming and flattening models.
The divider string consists of two underscore characters
(__
) by default. This method will fail if called
with an empty divider, or a divider that cannot be used internally as part
of a valid SBML SId.
(string)
Get the string used as the divider between names when renaming and flattening models.
The divider string consists of two underscore characters
(__
) by default, and can be overridden
with the setDivider() function.
string
:
the divider that will be used by any call to flattenModel().
Returns the XML namespace URI for the package to which this object belongs.
In the XML representation of an SBML document, XML namespaces are used to identify the origin of each XML construct used. XML namespaces are identified by their unique resource identifiers (URIs). The core SBML specifications stipulate the namespaces that must be used for core SBML constructs; for example, all XML elements that belong to SBML Level 3 Version 1 Core must be placed in the XML namespace identified by the URI "http://www.sbml.org/sbml/level3/version1/core". Individual SBML Level 3 packages define their own XML namespaces; for example, all elements belonging to the SBML Level 3 Layout Version 1 package must be placed in the XML namespace "http://www.sbml.org/sbml/level3/version1/layout/version1/".
This method first looks into the SBMLNamespaces object possessed by the parent SBMLDocument object of the current object. If this cannot be found, this method returns the result of getElementNamespace().
string
:
a string, the URI of the XML namespace to which this object belongs.
The CompSBasePlugin class inherits from the SBasePlugin class, and codifies the extensions to the SBase class defined in the comp ("comp") package. This extension allows the modeler to define one or more submodel elements which the parent SBase object replaces, and/or a single submodel element which replaces the parent SBase object.
This is accomplished through the addition of an optional ListOfReplacedElements child, which may contain one or more ReplacedElement objects, each of which references a submodel object to be replaced by the containing SBase object, and through the addition of a single optional ReplacedBy child, which references a submodel object which is to replace the containing SBase object.
If a single SBase element both contains a ListOfReplacedElements and has a ReplacedBy child, it and all the referenced ReplacedElement objects are to be replaced by the object referenced by the ReplacedBy element.
Returns the ReplacedElement with the given index.
(number)
the index number of the ReplacedElement to get.
ReplacedElement
:
the nth ReplacedElement in the ListOfReplacedElements. If the
index is invalid, NULL is returned.
Adds a copy of the given ReplacedElement object to the list of ReplacedElements.
(ReplacedElement)
the ReplacedElement object to be added to the
list of ReplacedElements. Fails if the added ReplacedElement is NULL,
does not match the level/version/package of the parent object, or cannot
be added to the list of replaced elements.
Remove all ReplacedElements, if any exist.
Creates a ReplacedElement object, adds it to the end of the ReplacedElement objects list and returns a pointer to the newly created object.
ReplacedElement
:
a newly created ReplacedElement object.
Removes the ReplacedElement with the given index.
A pointer to the ReplacedElement that was removed is returned. If no ReplacedElement has been removed, NULL is returned.
(number)
the index of the ReplacedElement object to remove.
ReplacedElement
:
the ReplacedElement object removed. As mentioned above,
the caller owns the returned object. NULL is returned if
the given index is out of range.
Get the child ReplacedBy of this SBase.
ReplacedBy
:
the ReplacedBy child of this SBase.
Sets the ReplacedBy definition of this SBase to a copy of the given ReplacedBy object instance.
This method fails if the added ReplacedBy does not match the level/version/package of the parent object or if the added ReplacedBy cannot be copied.
(ReplacedBy)
the ReplacedBy object instance to use.
Creates a new, empty ReplacedBy, adds it to this CompSBasePlugin and returns the created ReplacedBy.
ReplacedBy
:
the newly created ReplacedBy object instance.
Unsets the child ReplacedBy of this SBase.
Returns the XML namespace URI for the package to which this object belongs.
In the XML representation of an SBML document, XML namespaces are used to identify the origin of each XML construct used. XML namespaces are identified by their unique resource identifiers (URIs). The core SBML specifications stipulate the namespaces that must be used for core SBML constructs; for example, all XML elements that belong to SBML Level 3 Version 1 Core must be placed in the XML namespace identified by the URI "http://www.sbml.org/sbml/level3/version1/core". Individual SBML Level 3 packages define their own XML namespaces; for example, all elements belonging to the SBML Level 3 Layout Version 1 package must be placed in the XML namespace "http://www.sbml.org/sbml/level3/version1/layout/version1/".
This method first looks into the SBMLNamespaces object possessed by the parent SBMLDocument object of the current object. If this cannot be found, this method returns the result of getElementNamespace().
string
:
a string, the URI of the XML namespace to which this object belongs.
The CompSBMLDocumentPlugin class inherits from the SBMLDocumentPlugin class, and codifies the extensions to the SBMLDocument class defined in the SBML Level 3 comp ("comp") package. This extension allows multiple Model objects to be defined in a single SBMLDocument, stored in an optional child ListOfModelDefinitions object, as well as define references to Model objects in other files, stored in the optional child ListOfExternalModelDefinitions object. These model definitions, if present, allow Submodel objects to reference other Models to instantiate.
The presence of any ModelDefinition or ExternalModelDefinition in an SBMLDocument does not change the default Model in the file. If a SBMLDocument is submitted somewhere to be simulated, it is still the "model" child of the "sbml" element that should be simulated.
In addition, as all packages do, the CompSBMLDocumentPlugin defines a required flag named "required", which indicates whether "comp" constructs can be used to change the core mathematics of the "model" child of the "sbml" element. Because they can, this attribute must be set true.
Returns the ModelDefinition with the given index.
(number)
the index number of the ModelDefinition to get.
ModelDefinition
:
the nth ModelDefinition in the ListOfModelDefinitions. If the
index is invalid, NULL is returned.
Adds a copy of the given ModelDefinition object to the ListOfModelDefinitions.
(ModelDefinition)
the ModelDefinition object to be added to the
ListOfModelDefinitions. Fails if the added ModelDefinition is NULL,
does not match the level/version/package of the parent object, or cannot
be added to the list of replaced elements
Returns the number of ModelDefinition objects for this SBMLDocumentPlugin.
any
:
the number of ModelDefinition objects.
Creates a ModelDefinition object, adds it to the end of the ModelDefinition objects list and returns a pointer to the newly created object.
ModelDefinition
:
a newly created ModelDefinition object.
Removes the ModelDefinition with the given index from the CompSBMLDocumentPlugin.
A pointer to the ModelDefinition that was removed is returned. If no ModelDefinition has been removed, NULL is returned.
(number)
the index of the ModelDefinition object to remove
ModelDefinition
:
the ModelDefinition object removed. As mentioned above,
the caller owns the returned object. NULL is returned if
the given index is out of range.
Returns the ExternalModelDefinition with the given index.
(number)
the index number of the ExternalModelDefinition to get.
ExternalModelDefinition
:
the nth ExternalModelDefinition in the
ListOfExternalModelDefinitions. If the index is invalid, NULL is
returned.
Adds a copy of the given ExternalModelDefinition object to the ListOfExternalModelDefinitions.
(ExternalModelDefinition)
the ExternalModelDefinition object to be
added to the ListOFExternalModelDefinitions. Fails if the added
ExternalModelDefinition is NULL, does not match the
level/version/package of the parent object, or cannot be added to the
list of external model definitions
Creates a ExternalModelDefinition object, adds it to the end of the ExternalModelDefinition objects list and returns a pointer to the newly created object.
ExternalModelDefinition
:
a newly created ExternalModelDefinition object.
Removes the ExternalModelDefinition with the given index.
A pointer to the ExternalModelDefinition that was removed is returned. If no ExternalModelDefinition has been removed, NULL is returned.
(number)
the index of the ExternalModelDefinition object to remove.
ExternalModelDefinition
:
the ExternalModelDefinition object removed. As mentioned above,
the caller owns the returned object. NULL is returned if
the given index is out of range.
Unsets the value of the "required" attribute of this SBMLDocumentPlugin.
Returns the XML namespace URI for the package to which this object belongs.
In the XML representation of an SBML document, XML namespaces are used to identify the origin of each XML construct used. XML namespaces are identified by their unique resource identifiers (URIs). The core SBML specifications stipulate the namespaces that must be used for core SBML constructs; for example, all XML elements that belong to SBML Level 3 Version 1 Core must be placed in the XML namespace identified by the URI "http://www.sbml.org/sbml/level3/version1/core". Individual SBML Level 3 packages define their own XML namespaces; for example, all elements belonging to the SBML Level 3 Layout Version 1 package must be placed in the XML namespace "http://www.sbml.org/sbml/level3/version1/layout/version1/".
This method first looks into the SBMLNamespaces object possessed by the parent SBMLDocument object of the current object. If this cannot be found, this method returns the result of getElementNamespace().
string
:
a string, the URI of the XML namespace to which this object belongs.
There is currently exactly one namespace defined for the Hierarchical Model Composition package: "http://www.sbml.org/sbml/level3/version1/comp/version1". Despite referencing SBML Level 3 Version 1 explicitly, this package (and all such packages) can be used without change in SBML Level 3 Version 2 documents. The only caveat is that features of the SBML Level 3 Version 2 specification that were not present in Level 1 may not be used by constructs from the Hierarchical Model Composition package. The most relevant restriction this implies is that if a Level 2 SBML element has an "id" attribute that was newly added in Level 2 (when "id" was added to SBase itself), an SBaseRef "idRef" attribute may not reference it, and it must continue to use the "metaIdRef" attribute instead.
Extension of SBMLDocument.
Returns the XML namespace URI for the package to which this object belongs.
In the XML representation of an SBML document, XML namespaces are used to identify the origin of each XML construct used. XML namespaces are identified by their unique resource identifiers (URIs). The core SBML specifications stipulate the namespaces that must be used for core SBML constructs; for example, all XML elements that belong to SBML Level 3 Version 1 Core must be placed in the XML namespace identified by the URI "http://www.sbml.org/sbml/level3/version1/core". Individual SBML Level 3 packages define their own XML namespaces; for example, all elements belonging to the SBML Level 3 Layout Version 1 package must be placed in the XML namespace "http://www.sbml.org/sbml/level3/version1/layout/version1/".
This method first looks into the SBMLNamespaces object possessed by the parent SBMLDocument object of the current object. If this cannot be found, this method returns the result of getElementNamespace().
string
:
a string, the URI of the XML namespace to which this object belongs.
Base extension class.
Extension of SBase.
Get a Index from the ArraysSBasePlugin based on the arrayIndex to which it refers.
(number)
an unsigned long representing the arrayDimension attribute of the Index
object to retrieve.
Index
:
the first Index in this ArraysSBasePlugin based on the given
arrayDimension attribute or NULL if no such Index exists.
Get a Dimension from the ArraysSBasePlugin based on the Size to which it refers.
(string)
a string representing the size attribute of the Dimension
object to retrieve.
Dimension
:
the first Dimension in this ArraysSBasePlugin based on the given
size attribute or NULL if no such Dimension exists.
Get a Dimension from the ArraysSBasePlugin based on the arrayDimension to which it refers.
(number)
an unsigned long representing the arrayDimension attribute of the Dimension
object to retrieve.
Dimension
:
the first Dimension in this ArraysSBasePlugin based on the given
arrayDimension attribute or NULL if no such Dimension exists.
Returns the XML namespace URI for the package to which this object belongs.
In the XML representation of an SBML document, XML namespaces are used to identify the origin of each XML construct used. XML namespaces are identified by their unique resource identifiers (URIs). The core SBML specifications stipulate the namespaces that must be used for core SBML constructs; for example, all XML elements that belong to SBML Level 3 Version 1 Core must be placed in the XML namespace identified by the URI "http://www.sbml.org/sbml/level3/version1/core". Individual SBML Level 3 packages define their own XML namespaces; for example, all elements belonging to the SBML Level 3 Layout Version 1 package must be placed in the XML namespace "http://www.sbml.org/sbml/level3/version1/layout/version1/".
This method first looks into the SBMLNamespaces object possessed by the parent SBMLDocument object of the current object. If this cannot be found, this method returns the result of getElementNamespace().
string
:
a string, the URI of the XML namespace to which this object belongs.
The SBML Arrays Dimension class.
Sets the value of the "arrayDimension" attribute of this Dimension.
Unsets the value of the "size" attribute of this Dimension.
Unsets the value of the "arrayDimension" attribute of this Dimension.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
The SBML Arrays Index class.
Type: String
Unsets the value of the "referencedAttribute" attribute of this Index.
Unsets the value of the "arrayDimension" attribute of this Index.
Returns the value of the "math" element of this Index.
any
:
the value of the "math" element of this Index as a ASTNode.
Unsets the value of the "math" element of this Index.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
Unsets the value of the "cboTerm" attribute of this DynCompartmentPlugin.
Get a SpatialComponent from the ListOfSpatialComponents.
(number)
the index number of the SpatialComponent to get.
SpatialComponent
:
the nth SpatialComponent in the ListOfSpatialComponents within this DynCompartmentPlugin.
Adds a copy the given "SpatialComponent" to this DynCompartmentPlugin.
(SpatialComponent)
; the SpatialComponent object to add
Creates a new SpatialComponent object, adds it to this DynCompartmentPlugins ListOfSpatialComponents and returns the SpatialComponent object created.
SpatialComponent
:
a new SpatialComponent object instance
Removes the nth SpatialComponent from the ListOfSpatialComponents within this DynCompartmentPlugin. and returns a pointer to it.
The caller owns the returned item and is responsible for deleting it.
(number)
the index of the SpatialComponent to remove.
SpatialComponent
:
Returns the XML namespace URI for the package to which this object belongs.
In the XML representation of an SBML document, XML namespaces are used to identify the origin of each XML construct used. XML namespaces are identified by their unique resource identifiers (URIs). The core SBML specifications stipulate the namespaces that must be used for core SBML constructs; for example, all XML elements that belong to SBML Level 3 Version 1 Core must be placed in the XML namespace identified by the URI "http://www.sbml.org/sbml/level3/version1/core". Individual SBML Level 3 packages define their own XML namespaces; for example, all elements belonging to the SBML Level 3 Layout Version 1 package must be placed in the XML namespace "http://www.sbml.org/sbml/level3/version1/layout/version1/".
This method first looks into the SBMLNamespaces object possessed by the parent SBMLDocument object of the current object. If this cannot be found, this method returns the result of getElementNamespace().
string
:
a string, the URI of the XML namespace to which this object belongs.
Returns the XML namespace URI for the package to which this object belongs.
In the XML representation of an SBML document, XML namespaces are used to identify the origin of each XML construct used. XML namespaces are identified by their unique resource identifiers (URIs). The core SBML specifications stipulate the namespaces that must be used for core SBML constructs; for example, all XML elements that belong to SBML Level 3 Version 1 Core must be placed in the XML namespace identified by the URI "http://www.sbml.org/sbml/level3/version1/core". Individual SBML Level 3 packages define their own XML namespaces; for example, all elements belonging to the SBML Level 3 Layout Version 1 package must be placed in the XML namespace "http://www.sbml.org/sbml/level3/version1/layout/version1/".
This method first looks into the SBMLNamespaces object possessed by the parent SBMLDocument object of the current object. If this cannot be found, this method returns the result of getElementNamespace().
string
:
a string, the URI of the XML namespace to which this object belongs.
Unsets the value of the "cboTerm" attribute of this DynEventPlugin.
Unsets the value of the "applyToAll" attribute of this DynEventPlugin.
Returns the XML namespace URI for the package to which this object belongs.
In the XML representation of an SBML document, XML namespaces are used to identify the origin of each XML construct used. XML namespaces are identified by their unique resource identifiers (URIs). The core SBML specifications stipulate the namespaces that must be used for core SBML constructs; for example, all XML elements that belong to SBML Level 3 Version 1 Core must be placed in the XML namespace identified by the URI "http://www.sbml.org/sbml/level3/version1/core". Individual SBML Level 3 packages define their own XML namespaces; for example, all elements belonging to the SBML Level 3 Layout Version 1 package must be placed in the XML namespace "http://www.sbml.org/sbml/level3/version1/layout/version1/".
This method first looks into the SBMLNamespaces object possessed by the parent SBMLDocument object of the current object. If this cannot be found, this method returns the result of getElementNamespace().
string
:
a string, the URI of the XML namespace to which this object belongs.
Returns the value of the "cboTerm" attribute of this DynSBasePlugin.
any
:
the value of the "cboTerm" attribute of this DynSBasePlugin as a string.
Predicate returning @c true or @c false depending on whether this DynSBasePlugin's "cboTerm" attribute has been set.
any
:
@c true if this DynSBasePlugin's "cboTerm" attribute has been set,
otherwise @c false is returned.
Sets the value of the "cboTerm" attribute of this DynSBasePlugin.
(any)
; DOMString value of the "cboTerm" attribute to be set
Unsets the value of the "cboTerm" attribute of this DynSBasePlugin.
Returns the XML namespace URI for the package to which this object belongs.
In the XML representation of an SBML document, XML namespaces are used to identify the origin of each XML construct used. XML namespaces are identified by their unique resource identifiers (URIs). The core SBML specifications stipulate the namespaces that must be used for core SBML constructs; for example, all XML elements that belong to SBML Level 3 Version 1 Core must be placed in the XML namespace identified by the URI "http://www.sbml.org/sbml/level3/version1/core". Individual SBML Level 3 packages define their own XML namespaces; for example, all elements belonging to the SBML Level 3 Layout Version 1 package must be placed in the XML namespace "http://www.sbml.org/sbml/level3/version1/layout/version1/".
This method first looks into the SBMLNamespaces object possessed by the parent SBMLDocument object of the current object. If this cannot be found, this method returns the result of getElementNamespace().
string
:
a string, the URI of the XML namespace to which this object belongs.
Sets the value of the "idRef" attribute of this DynElement.
(any)
; DOMString value of the "idRef" attribute to be set
Sets the value of the "metaIdRef" attribute of this DynElement.
(any)
; DOMString value of the "metaIdRef" attribute to be set
Unsets the value of the "idRef" attribute of this DynElement.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
Returns the value of the "spatialIndex" attribute of this SpatialComponent.
SpatialKind_t
:
the value of the "spatialIndex" attribute of this SpatialComponent as a SpatialKind_t.
Sets the value of the "spatialIndex" attribute of this SpatialComponent.
(SpatialKind_t)
; SpatialKind_t value of the "spatialIndex" attribute to be set
Unsets the value of the "spatialIndex" attribute of this SpatialComponent.
Unsets the value of the "variable" attribute of this SpatialComponent.
Returns the value of the "id" attribute of this SBML object, if it has one, or the "variable" attribute of a Rule, or the "symbol" attribute of an InitialAssignment.
string
:
the id of this SBML object, or the "variable" if the object is a
Rule, or the "symbol" if the object is an InitialAssignment.
Note: Because of the inconsistent behavior of this function with respect to assignments and rules, callers should use getIdAttribute() instead.
Returns the URL representation of the "sboTerm" attribute of this object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN
.
number
:
the value of the "sboTerm" attribute as an identifiers.org URL,
or an empty string if the value is not set.
Unsets the value of the "sboTerm" attribute of this SBML object.
Sets the value of the "annotation" subelement of this SBML object.
The content of annotation is copied, and any previous content of this object's "annotation" subelement is deleted.
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 not 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 "any", 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).
(any)
an XML string that is to be used as the content
of the "annotation" subelement of this object.
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 not 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 "any", 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.
Returns the content of the "annotation" subelement of this object as a character string.
The annotations returned by this method will be in string form. See the method getAnnotation() for a version that returns annotations in XML form.
string
:
the annotation of this SBML object as a character string.
Returns the content of the "notes" subelement of this object as a string.
For an alternative method of accessing the notes, see getNotes(), which returns the content as an XMLNode tree structure. Depending on an application's needs, one or the other method may be more convenient.
string
:
the content of the "notes" subelement of this SBML object as a
string.
Predicate returning true if this object's "notes" subelement exists and has content.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
string
:
true if a "notes" subelement exists, false otherwise.
Unsets the value of the "notes" subelement of this SBML object.
The optional SBML 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. To help verify the formatting of "notes" content, libSBML provides the static utility method SyntaxChecker::hasExpectedXHTMLSyntax however, readers are urged to consult the appropriate SBML specification document for the Level and Version of their model for more in-depth explanations. The SBML Level 2 and 3 specifications have considerable detail about how "notes" element content must be structured.
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object. This method is the converse of SBase#disablePackage.
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other objects connected by child-parent links in the same SBMLDocument object.
An example of when this may be useful is during construction of model components when mixing existing and new models. Suppose your application read an SBML document containing a model that used the SBML Hierarchical Model Composition ("comp") package, and extracted parts of that model in order to construct a new model in memory. The new, in-memory model will not accept a component drawn from an other SBMLDocument with different package namespace declarations. You could reconstruct the same namespaces in the in-memory model first, but as a shortcut, you could also disable the package namespace on the object being added. Here is a code example to help clarify this:
libsbml().then((libsbml) => {
// We read in an SBML L3V1 model that uses the 'comp'
// package namespace.
const doc = new libsbml.SBMLReader().readSBMLFromString("...sbml with comp elements...")
// We extract one of the species from the model.
const s1 = doc.getModel().getSpecies(0)
// We construct a new model. This model does not use the
// 'comp' package.
const newModel = new libsbml.Model(3,1)
// The following will fail with an error, because addSpecies()
// will first check that the parent of the given object has
// namespaces declared, and will discover that s1 does but
// newModel does not.
// newModel.addSpecies(s1)
// However, if we disable the 'comp' package on s1, then
// the call to addSpecies will work.
s1.disablePackage("http://www.sbml.org/sbml/level3/version1/comp/version1", "comp")
newModel.addSpecies(s1)
})
(string)
the URI of the package
Abstract Syntax Trees (ASTs) are a simple kind of data structure used in libSBML for storing mathematical expressions. The ASTNode is the cornerstone of libSBML's AST representation. An AST "node" represents the most basic, indivisible part of a mathematical formula and come in many types. For instance, there are node types to represent numbers (with subtypes to distinguish integer, real, and rational numbers), names (e.g., constants or variables), simple mathematical operators, logical or relational operators and functions. LibSBML ASTs provide a canonical, in-memory representation for all mathematical formulas regardless of their original format (which might be MathML or might be text strings).
The ASTNodeType_t type contains all permitted AST nodes.
The text-string form of mathematical formulas handled by SBMLFormulaParser#parseL3Formula are in a simple C-inspired infix notation. A formula in this text-string form can be handed to a program that understands SBML mathematical expressions, or used as part of a translation system.
The formula strings may contain operators, function calls, symbols, and white space characters. The allowable white space characters are tab and space. The following are illustrative examples of formulas expressed in the syntax:
0.10 * k4^2
(vm * s1)/(km + s1)
The libSBML documentation shows the precedence rules in this syntax.
A program parsing a formula in an SBML model should assume that names appearing in the formula are the identifiers of Species, Parameter, Compartment, FunctionDefinition, Reaction (in SBML Levels 2 and 3), or SpeciesReference (in SBML Level 3 only) objects defined in a model. When a function call is involved, the syntax consists of a function identifier, followed by optional white space, followed by an opening parenthesis, followed by a sequence of zero or more arguments separated by commas (with each comma optionally preceded and/or followed by zero or more white space characters), followed by a closing parenthesis. There is an almost one-to-one mapping between the list of predefined functions available, and those defined in MathML. All of the MathML functions are recognized; this set is larger than the functions defined in SBML Level 1. In the subset of functions that overlap between MathML and SBML Level 1, there exist a few differences.
For constructing ASTs use SBMLFormulaParser#parseL3Formula.
AST_PLUS
AST_MINUS
AST_TIMES
AST_DIVIDE
AST_POWER
AST_INTEGER
AST_REAL
AST_REAL_E
AST_RATIONAL
AST_NAME
AST_NAME_AVOGADRO
AST_NAME_TIME
AST_CONSTANT_E
AST_CONSTANT_FALSE
AST_CONSTANT_PI
AST_CONSTANT_TRUE
AST_LAMBDA
AST_FUNCTION
AST_FUNCTION_ABS
AST_FUNCTION_ARCCOS
AST_FUNCTION_ARCCOSH
AST_FUNCTION_ARCCOT
AST_FUNCTION_ARCCOTH
AST_FUNCTION_ARCCSC
AST_FUNCTION_ARCCSCH
AST_FUNCTION_ARCSEC
AST_FUNCTION_ARCSECH
AST_FUNCTION_ARCSIN
AST_FUNCTION_ARCSINH
AST_FUNCTION_ARCTAN
AST_FUNCTION_ARCTANH
AST_FUNCTION_CEILING
AST_FUNCTION_COS
AST_FUNCTION_COSH
AST_FUNCTION_COT
AST_FUNCTION_COTH
AST_FUNCTION_CSC
AST_FUNCTION_CSCH
AST_FUNCTION_DELAY
AST_FUNCTION_EXP
AST_FUNCTION_FACTORIAL
AST_FUNCTION_FLOOR
AST_FUNCTION_LN
AST_FUNCTION_LOG
AST_FUNCTION_PIECEWISE
AST_FUNCTION_POWER
AST_FUNCTION_ROOT
AST_FUNCTION_SEC
AST_FUNCTION_SECH
AST_FUNCTION_SIN
AST_FUNCTION_SINH
AST_FUNCTION_TAN
AST_FUNCTION_TANH
AST_LOGICAL_AND
AST_LOGICAL_NOT
AST_LOGICAL_OR
AST_LOGICAL_XOR
AST_RELATIONAL_EQ
AST_RELATIONAL_GEQ
AST_RELATIONAL_GT
AST_RELATIONAL_LEQ
AST_RELATIONAL_LT
AST_RELATIONAL_NEQ
AST_END_OF_CORE
AST_FUNCTION_MAX
AST_FUNCTION_MIN
AST_FUNCTION_QUOTIENT
AST_FUNCTION_RATE_OF
AST_FUNCTION_REM
AST_LOGICAL_IMPLIES
AST_CSYMBOL_FUNCTION
AST_DISTRIB_FUNCTION_NORMAL
AST_DISTRIB_FUNCTION_UNIFORM
AST_DISTRIB_FUNCTION_BERNOULLI
AST_DISTRIB_FUNCTION_BINOMIAL
AST_DISTRIB_FUNCTION_CAUCHY
AST_DISTRIB_FUNCTION_CHISQUARE
AST_DISTRIB_FUNCTION_EXPONENTIAL
AST_DISTRIB_FUNCTION_GAMMA
AST_DISTRIB_FUNCTION_LAPLACE
AST_DISTRIB_FUNCTION_LOGNORMAL
AST_DISTRIB_FUNCTION_POISSON
AST_DISTRIB_FUNCTION_RAYLEIGH
AST_LINEAR_ALGEBRA_VECTOR
AST_LINEAR_ALGEBRA_SELECTOR
AST_LINEAR_ALGEBRA_MATRIX
AST_LINEAR_ALGEBRA_MATRIXROW
AST_LINEAR_ALGEBRA_DETERMINANT
AST_LINEAR_ALGEBRA_TRANSPOSE
AST_LINEAR_ALGEBRA_VECTOR_PRODUCT
AST_LINEAR_ALGEBRA_SCALAR_PRODUCT
AST_LINEAR_ALGEBRA_OUTER_PRODUCT
AST_LOGICAL_EXISTS
AST_LOGICAL_FORALL
AST_STATISTICS_MEAN
AST_STATISTICS_MEDIAN
AST_STATISTICS_MODE
AST_STATISTICS_MOMENT
AST_SERIES_PRODUCT
AST_STATISTICS_SDEV
AST_SERIES_SUM
AST_STATISTICS_VARIANCE
AST_UNKNOWN
Enumeration of predefined SBML base units.
See the libSBML C++ docs for UnitKind_t.
UNIT_KIND_AMPERE
UNIT_KIND_AVOGADRO
UNIT_KIND_BECQUEREL
UNIT_KIND_CANDELA
UNIT_KIND_CELSIUS
UNIT_KIND_COULOMB
UNIT_KIND_DIMENSIONLESS
UNIT_KIND_FARAD
UNIT_KIND_GRAM
UNIT_KIND_GRAY
UNIT_KIND_HENRY
UNIT_KIND_HERTZ
UNIT_KIND_ITEM
UNIT_KIND_JOULE
UNIT_KIND_KATAL
UNIT_KIND_KELVIN
UNIT_KIND_KILOGRAM
UNIT_KIND_LITER
UNIT_KIND_LITRE
UNIT_KIND_LUMEN
UNIT_KIND_LUX
UNIT_KIND_METER
UNIT_KIND_METRE
UNIT_KIND_MOLE
UNIT_KIND_NEWTON
UNIT_KIND_OHM
UNIT_KIND_PASCAL
UNIT_KIND_RADIAN
UNIT_KIND_SECOND
UNIT_KIND_SIEMENS
UNIT_KIND_SIEVERT
UNIT_KIND_STERADIAN
UNIT_KIND_TESLA
UNIT_KIND_VOLT
UNIT_KIND_WATT
UNIT_KIND_WEBER
UNIT_KIND_INVALID
LibSBML diagnostic return codes.
Many methods in libSBML return a status code to indicate whether the operation requested by the caller succeeded or failed. This enumeration lists all the possible return codes from any libSBML methods.
LIBSBML_OPERATION_SUCCESS
LIBSBML_INDEX_EXCEEDS_SIZE
LIBSBML_UNEXPECTED_ATTRIBUTE
LIBSBML_OPERATION_FAILED
LIBSBML_INVALID_ATTRIBUTE_VALUE
LIBSBML_INVALID_OBJECT
LIBSBML_DUPLICATE_OBJECT_ID
LIBSBML_LEVEL_MISMATCH
LIBSBML_VERSION_MISMATCH
LIBSBML_INVALID_XML_OPERATION
LIBSBML_NAMESPACES_MISMATCH
LIBSBML_DUPLICATE_ANNOTATION_NS
LIBSBML_ANNOTATION_NAME_NOT_FOUND
LIBSBML_ANNOTATION_NS_NOT_FOUND
LIBSBML_MISSING_METAID
LIBSBML_PKG_VERSION_MISMATCH
LIBSBML_PKG_UNKNOWN
LIBSBML_PKG_UNKNOWN_VERSION
LIBSBML_PKG_DISABLED
LIBSBML_PKG_CONFLICTED_VERSION
LIBSBML_PKG_CONFLICT
LIBSBML_CONV_INVALID_TARGET_NAMESPACE
LIBSBML_CONV_PKG_CONVERSION_NOT_AVAILABLE
LIBSBML_CONV_INVALID_SRC_DOCUMENT
LIBSBML_CONV_CONVERSION_NOT_AVAILABLE
LIBSBML_CONV_PKG_CONSIDERED_UNKNOWN
SpeciesReferenceRole_t is the enumeration of possible values for the 'role' attribute of a SpeciesReferenceGlyph.
The role attribute is of type SpeciesReferenceRole and is used to specify how the species reference should be displayed. Allowed values are 'substrate', 'product', 'sidesubstrate', 'sideproduct', 'modifier', 'activator', 'inhibitor' and 'undefined'.
This attribute is optional and should only be necessary if the optional speciesReference attribute is not given or if the respective information from the model needs to be overridden.
SPECIES_ROLE_UNDEFINED
SPECIES_ROLE_SUBSTRATE
SPECIES_ROLE_PRODUCT
SPECIES_ROLE_SIDESUBSTRATE
SPECIES_ROLE_SIDEPRODUCT
SPECIES_ROLE_MODIFIER
SPECIES_ROLE_ACTIVATOR
SPECIES_ROLE_INHIBITOR
SPECIES_ROLE_INVALID
The possible legal values are less than or equal to, greater than or equal to, or equal to. The two options "FLUXBOUND_OPERATION_LESS" and " FLUXBOUND_OPERATION_GREATER" are not legal values for the FluxBound 'operation' attribute, but are provided to allow backwards compatibility with an earlier version of the draft specification.
FLUXBOUND_OPERATION_LESS_EQUAL
FLUXBOUND_OPERATION_GREATER_EQUAL
FLUXBOUND_OPERATION_LESS
FLUXBOUND_OPERATION_GREATER
FLUXBOUND_OPERATION_EQUAL
FLUXBOUND_OPERATION_UNKNOWN
Enumeration of possible values for the 'type' attribute of an Objective object.
OBJECTIVE_TYPE_MAXIMIZE
OBJECTIVE_TYPE_MINIMIZE
OBJECTIVE_TYPE_UNKNOWN
Enumeration of values permitted as the value of the "kind" attribute on Group objects.
GROUP_KIND_CLASSIFICATION
GROUP_KIND_PARTONOMY
GROUP_KIND_COLLECTION
GROUP_KIND_UNKNOWN
Enumeration of possible binding status of a OutwardBindingSite in the libSBML "multi" package implementation.
MULTI_BINDING_STATUS_BOUND
MULTI_BINDING_STATUS_UNBOUND
MULTI_BINDING_STATUS_EITHER
MULTI_BINDING_STATUS_UNKNOWN
Enumeration of possible relations between the children of a SubListOfSpeciesFeatures in the libSBML "multi" package implementation.
MULTI_RELATION_AND
MULTI_RELATION_OR
MULTI_RELATION_NOT
MULTI_RELATION_UNKNOWN
Enumeration of possible values for the 'transitionEffect' attribute of an Input. Must be 'none' or 'consumption'.
INPUT_TRANSITION_EFFECT_NONE
INPUT_TRANSITION_EFFECT_CONSUMPTION
INPUT_TRANSITION_EFFECT_UNKNOWN
Enumeration of possible values for the 'transitionEffect' attribute of an Input. Must be 'positive', 'negative', 'dual', or 'unknown'.
INPUT_SIGN_POSITIVE
INPUT_SIGN_NEGATIVE
INPUT_SIGN_DUAL
INPUT_SIGN_UNKNOWN
INPUT_SIGN_VALUE_NOTSET
Enumeration of possible values for the 'transitionEffect' attribute of an Output.
OUTPUT_TRANSITION_EFFECT_PRODUCTION
OUTPUT_TRANSITION_EFFECT_ASSIGNMENT_LEVEL
OUTPUT_TRANSITION_EFFECT_UNKNOWN
SpatialKind_t
SPATIALKIND_UNKNOWN
DYN_SPATIALKIND_CARTESIANX
DYN_SPATIALKIND_CARTESIANY
DYN_SPATIALKIND_CARTESIANZ
DYN_SPATIALKIND_ALPHA
DYN_SPATIALKIND_BETA
DYN_SPATIALKIND_GAMMA
DYN_SPATIALKIND_FX
DYN_SPATIALKIND_FY
DYN_SPATIALKIND_FZ
Cast an object to the given derived type. This method is a built-in feature of Emscripten No type checking is performed. In libsbml.js this method is primarily used to cast SBasePlugin to a derived type such as FbcModelPlugin or CompSBasePlugin.
(Object)
The object instance
(Type)
The target type to cast to
any
:
The instance cast to the derived type