libsbml.SBase Class Reference

Inheritance diagram for libsbml.SBase:

Inheritance graph
[legend]

List of all members.


Detailed Description

LibSBML implementation of SBase, the base class of all SBML objects.

Most components in SBML are derived from a single abstract base type, SBase. In addition to serving as the parent class for most other classes of objects in SBML, this base type is designed to allow a modeler or a software package to attach arbitrary information to each major element or list in an SBML model.

SBase has an optional subelement called 'notes'. It is intended to serve as a place for storing optional information intended to be seen by humans. An example use of the 'notes' element would be to contain formatted user comments about the model element in which the 'notes' element is enclosed. There are certain conditions on the XHTML content permitted inside the 'notes' element; these are described separately below.

SBase has another optional subelement called 'annotation'. Whereas the 'notes' element described above is a container for content to be shown directly to humans, the 'annotation' element is a container for optional software-generated content 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. They are described separately below.

It is worth pointing out that the 'annotation' element in the definition of SBase exists in order that software developers may attach optional application-specific data to the elements in an SBML model. However, it is important that this facility not be misused. In particular, it is critical that data essential to a model definition or that can be encoded in existing SBML elements is not stored in 'annotation'. Parameter values, functional dependencies between model elements, etc., should not be recorded as annotations. It is crucial to keep in mind the fact that data placed in annotations can be freely ignored by software applications. If such data affects the interpretation of a model, then software interoperability is greatly impeded.

Beginning with SBML Level 2, SBase also has an optional attribute named 'metaid' for supporting metadata annotations using RDF (Resource Description Format). The attribute value has the data type XML ID, the XML identifier type, which means each 'metaid' value must be globally unique within an SBML file. (Importantly, this uniqueness criterion applies across any attribute with type XML ID, not just the 'metaid' attribute used by SBML—something to be aware of if your application-specific XML content inside the 'annotation' subelement happens to use XML ID.) The 'metaid' value serves to identify a model component for purposes such as referencing that component from metadata placed within 'annotation' subelements.

Beginning with SBML Level 2 Version 3, SBase also has an optional attribute named 'sboTerm' for supporting the use of the Systems Biology Ontology. In SBML proper, the data type of the attribute is a string of the form SBO:NNNNNNN, where NNNNNNN is a seven digit integer number; libSBML simplifies the representation by only storing the NNNNNNN integer portion. Thus, in libSBML, the 'sboTerm' attribute on SBase has data type int, and SBO identifiers are stored simply as integers. SBO terms are a type of optional annotation, and each different class of SBML object derived from SBase imposes its own requirements about the values permitted for 'sboTerm'. Please consult the SBML Level 2 Version 4 specification for more information about the use of SBO and the 'sboTerm' attribute.

Finally, note that, in the list of methods on SBase, there is no public constructor because SBase is an abstract class. The constructors reside in the subclasses derived from SBase.

Requirements for the content of the 'notes' subelement

The content of 'notes' elements must be in XHTML 1.0 format. (Plain HTML would not be usable because whatever appears inside the 'notes' element must be compatible with XML, which HTML is not, and in any case, the requirement for using XHTML does not prevent users from entering plain-text content ,which they can do using the standard <pre> ... </pre> elements of [X]HTML.)

The XML content of a 'notes' subelement must declare the use of the XHTML XML namespace. This can be done in multiple ways. One way is to place a namespace declaration for the appropriate namespace URI (which for XHTML is 'http://www.w3.org/1999/xhtml') on the top-level sbml element and then reference the namespace in the 'notes' element content using a prefix. The following example illustrates this approach:

 <sbml xmlns='http://www.sbml.org/sbml/level2/version4' level='2' version='4'
       xmlns:xhtml='http://www.w3.org/1999/xhtml'>
   ...
   <notes>
     <xhtml:body>
       <xhtml:center><xhtml:h2>A Simple Mitotic Oscillator</xhtml:h2></xhtml:center>
       <xhtml:p>A minimal cascade model for the mitotic oscillator
       involving cyclin and cdc2 kinase</xhtml:p>
     </xhtml:body>
   </notes>
   ...
 

Another approach is to declare the XHTML namespace within the 'notes' element content itself, as in the following example:

 ...
 <notes>
   <body xmlns='http://www.w3.org/1999/xhtml'>

     <center><h2>A Simple Mitotic Oscillator</h2></center>

     <p>A minimal cascade model for the mitotic oscillator
     involving cyclin and cdc2 kinase</p>

   </body>
 </notes>
 ...
 

The xmlns='http://www.w3.org/1999/xhtml' declaration on body as shown above changes the default XML namespace within it, such that all of its content is by default in the XHTML namespace. This is a particularly convenient approach because it obviates the need to prefix every element with a namespace prefix (i.e., xhtml: in the previous case). Other approaches are also possible.

SBML does not require the content of the 'notes' subelement to be any particular XHTML element; the content can be almost any well-formed XHTML content. SBML Level 2 Versions 2, 3 and 4 added some small restrictions and clarifications for the allowable content in order to promote greater interoperability between software tools. The first restriction comes from the requirements of XML: the 'notes' element must not contain an XML declaration nor a DOCTYPE declaration. That is, 'notes' must not contain

 <?xml version='1.0' encoding='UTF-8'?>  
 
nor (where the following is only one specific example of a DOCTYPE declaration)
 <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
       'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
 

The second restriction is intended to balance freedom of content with the complexity of implementing software that can interpret the content. The content of the 'notes' subelement in SBML can consist only of the following possibilities:

Another way to summarize the restrictions above is simply to say that the content of an SBML 'notes' element can be only be a complete html element, a body element, or whatever is permitted inside a body element. In practice, this does not limit in any meaningful way what can be placed inside a 'notes' element; for example, if an application or modeler wants to put a complete XHTML page, including a head element, it can be done by putting in everything starting with the html container. However, the restrictions above do make it somewhat simpler to write software that can read and write the 'notes' content.

Requirements for the content of the 'annotation' subelement

At the outset, software developers should keep in mind that multiple software tools may attempt to read and write annotation content. To reduce the potential for collisions between annotations written by different applications, SBML Level 2 stipulates that tools must use XML namespaces to specify the intended vocabulary of every annotation. The application's developers must choose a URI (Universal Resource Identifier) reference that uniquely identifies the vocabulary the application will use, and a prefix string for the annotations.

A important requirement is that application-specific annotation data is entirely contained inside a single top-level element within the SBML 'annotation' subelement. SBML Level 2 Versions 2, 3 and 4 place the following restrictions on annotations:

The use of XML namespaces in this manner is intended to improve the ability of multiple applications to place annotations on SBML model elements with reduced risks of interference or name collisions. Annotations stored by different simulation packages can therefore coexist in the same model definition. The rules governing the content of 'annotation' elements are designed to enable applications to easily add, change, and remove their annotations from SBML elements while simultaneously preserving annotations inserted by other applications when mapping SBML from input to output.

As a further simplification for developers of software and to improve software interoperability, applications are only required to preserve other annotations (i.e., annotations they do not recognize) when those annotations are self-contained entirely within 'annotation', complete with namespace declarations. The following is an example:

 <annotation>
     <topLevelElement xmlns:'URI'>
        ... content in the namespace identified by 'URI' ...
     </topLevelElement>
 </annotation>
 

Some more examples hopefully will make these points more clear. The next example is invalid because it contains a top-level element in the SBML XML namespace—this happens because no namespace is declared for the <cytoplasm> element, which means by default it falls into the enclosing SBML namespace:

 <annotation>
     <cytoplasm/>
 </annotation>
 

The following example is also invalid, this time because it contains two top-level elements using the same XML namespace. Note that it does not matter that these are two different top-level elements (<nodecolors> and <textcolors>); what matters is that these separate elements are both in the same namespace rather than having been collected and placed inside one overall container element for that namespace.

 <annotation>
     <mysim:nodecolors xmlns:mysim='http://www.mysim.org/ns'
         mysim:bgcolor='green' mysim:fgcolor='white'/>
     <mysim:textcolors xmlns:mysim='http://www.mysim.org/ns'
         mysim:bgcolor='green' mysim:fgcolor='white'/>
 </annotation>
 

On the other hand, the following example is valid:

 <annotation>
     <mysim:geometry xmlns:mysim='http://www.mysim.org/ns'
              mysim:bgcolor='green' mysim:fgcolor='white'>
         <graph:node xmlns:graph='http://www.graph.org/ns' 
              graph:x='4' graph:y='5' />
     </mysim:geometry>
     <othersim:icon xmlns:othersim='http://www.othersim.com/'>
         WS2002
     </othersim:icon>
 </annotation>
 

It is worth keeping in mind that although XML namespace names must be URIs, they are (like all XML namespace names) not required to be directly usable in the sense of identifying an actual, retrieval document or resource on the Internet. URIs such as 'http://www.mysim.org/' may appear as though they are (e.g.) Internet addresses, but there are not the same thing. This style of URI strings, using a domain name and other parts, is only a simple and commonly-used way of creating a unique name string.

Standard format for annotations linking data resources

SBML Level 2 Versions 2, 3 and 4 define a proposed regular format for encoding two particular categories of annotations: (a) references to controlled vocabulary terms and database identifiers which define and describe biological and biochemical entities in a model; and (b) descriptions of the provenance of a model, including its author(s) and modification history.

Definition at line 1169 of file libsbml.py.


Public Member Functions

def __init__
def addCVTerm
def appendAnnotation
def appendNotes
def clone
def getAncestorOfType
def getAnnotation
def getAnnotationString
def getColumn
def getCVTerm
def getElementName
def getId
def getLevel
def getLine
def getMetaId
def getModel
def getName
def getNamespaces
def getNotes
def getNotesString
def getNumCVTerms
def getParentSBMLObject
def getResourceBiologicalQualifier
def getResourceModelQualifier
def getSBMLDocument
def getSBOTerm
def getSBOTermID
def getTypeCode
def getVersion
def isSetAnnotation
def isSetId
def isSetMetaId
def isSetName
def isSetNotes
def isSetSBOTerm
def read
def setAnnotation
def setId
def setMetaId
def setName
def setNamespaces
def setNotes
def setParentSBMLObject
def setSBMLDocument
def setSBOTerm
def toSBML
def unsetAnnotation
def unsetCVTerms
def unsetId
def unsetMetaId
def unsetName
def unsetNotes
def unsetSBOTerm
def write

Public Attributes

 this

Member Function Documentation

def libsbml.SBase.__init__ (   self,
  args,
  kwargs 
)

Reimplemented in libsbml.SimpleSpeciesReference.

Definition at line 1486 of file libsbml.py.

def libsbml.SBase.addCVTerm (   args  ) 

Python method signature(s):

addCVTerm(self, CVTerm term)

Adds a copy of the given CVTerm to this SBML object.

Parameters:
term the CVTerm to assign
Note:
Since the CV Term uses the metaid of the object as a reference, if the object has no metaid set the CVTerm will not be added.
Warning:
The fact that this method copies the object passed to it means that the caller will be left holding a physically different object instance than the one contained in this object. Changes made to the original object instance (such as resetting attribute values) will not affect the instance added here. In addition, the caller should make sure to free the original object if it is no longer being used, or else a memory leak will result.

Definition at line 2874 of file libsbml.py.

def libsbml.SBase.appendAnnotation (   args  ) 

Python method signature(s):

appendAnnotation(self, XMLNode annotation)
appendAnnotation(self, string annotation)

Appends the annotation content given by annotation to any existing content in the 'annotation' subelement of this object.

Whereas the SBase 'notes' subelement is a container for content to be shown directly to humans, the 'annotation' element is a container for optional software-generated content 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.

Unlike SBase.setAnnotation(const XMLNode* annotation) or Sbase.setAnnotation(const std.string& annotation), this method allows other annotations to be preserved when an application adds its own data.

Some words of explanation about the set/unset/isSet methods: SBML Levels 1 and 2 define certain attributes on some classes of objects as optional. This requires an application to be careful about the distinction between two cases: (1) a given attribute has never been set to a value, and therefore should be assumed to have the SBML-defined default value, and (2) a given attribute has been set to a value, but the value happens to be an empty string. LibSBML supports these distinctions by providing methods to set, unset, and query the status of attributes that are optional. The methods have names of the form setAttribute(...), unsetAttribute(), and isSetAttribute(), where Attribute is the the name of the optional attribute in question.

Parameters:
annotation an XML string that is to be copied and appended to the content of the 'annotation' subelement of this object
See also:
getAnnotationString()

isSetAnnotation()

setAnnotation(const XMLNode* annotation)

setAnnotation(const std.string& annotation)

appendAnnotation(const XMLNode* annotation)

unsetAnnotation()

Reimplemented in libsbml.Model, and libsbml.SpeciesReference.

Definition at line 2444 of file libsbml.py.

def libsbml.SBase.appendNotes (   args  ) 

Python method signature(s):

appendNotes(self, XMLNode notes)
appendNotes(self, string notes)

Appends notes content to the 'notes' element attached to this object.

The content in notes is copied.

The optional element named 'notes', present on every major SBML component type, is intended as a place for storing optional information intended to be seen by humans. An example use of the 'notes' element would be to contain formatted user comments about the model element in which the 'notes' element is enclosed. Every object derived directly or indirectly from type SBase can have a separate value for 'notes', allowing users considerable freedom when adding comments to their models. The format of 'notes' elements must be XHTML 1.0. The SBML Level 2 specification has considerable detail about how 'notes' element content must be handled; please refer to the specifications.

Parameters:
notes an XML string that is to appended to the content of the 'notes' subelement of this object
See also:
getNotesString()

isSetNotes()

setNotes(const XMLNode* notes)

setNotes(const std.string& notes)

appendNotes(const XMLNode* notes)

unsetNotes()

Definition at line 2531 of file libsbml.py.

def libsbml.SBase.clone (   args  ) 

def libsbml.SBase.getAncestorOfType (   args  ) 

Python method signature(s):

getAncestorOfType(self, SBMLTypeCode_t type)    SBase

Returns the ancestor SBML object that corresponds to the given SBMLTypeCode_t.

This function allows any object to determine its exact location/function within a model. For example a StoichiometryMath object has ancestors of type SpeciesReference, ListOfProducts/ListOfReactants/ListOfModifiers, Reaction, ListOfReactions and Model; any of which can be accessed via this function.

Parameters:
type the SBMLTypeCode_t of the ancestor to be returned.
Returns:
the ancestor SBML object of this SBML object, that corresponds to the given SBMLTypeCode_t, NULL if none exists.

Definition at line 1874 of file libsbml.py.

def libsbml.SBase.getAnnotation (   args  ) 

Python method signature(s):

getAnnotation(self)    XMLNode

Returns the content of the 'annotation' subelement of this object as an XML node tree.

Whereas the SBase 'notes' subelement is a container for content to be shown directly to humans, the 'annotation' element is a container for optional software-generated content 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.

The annotations returned by this method will be in XML form. LibSBML provides an object model and related interfaces for certain specific kinds of annotations, namely model history information and RDF content. See the ModelHistory, CVTerm and RDFAnnotationParser classes for more information about the facilities available.

Returns:
the annotation of this SBML object as an XMLNode
See also:
getAnnotationString()

isSetAnnotation()

setAnnotation(const XMLNode* annotation)

setAnnotation(const std.string& annotation)

appendAnnotation(const XMLNode* annotation)

appendAnnotation(const std.string& annotation)

unsetAnnotation()

Definition at line 1730 of file libsbml.py.

def libsbml.SBase.getAnnotationString (   args  ) 

Python method signature(s):

getAnnotationString(self)    string

Returns the content of the 'annotation' subelement of this object as a character string.

Whereas the SBase 'notes' subelement is a container for content to be shown directly to humans, the 'annotation' element is a container for optional software-generated content 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.

The annotations returned by this method will be in string form.

Returns:
the annotation string of this SBML object.
See also:
getAnnotation()

isSetAnnotation()

setAnnotation(const XMLNode* annotation)

setAnnotation(const std.string& annotation)

appendAnnotation(const XMLNode* annotation)

appendAnnotation(const std.string& annotation)

unsetAnnotation()

Definition at line 1773 of file libsbml.py.

def libsbml.SBase.getColumn (   args  ) 

Python method signature(s):

getColumn(self)    unsigned int

Returns the column number on which this object first appears in the XML representation of the SBML document.

Returns:
the column number of this SBML object.
See also:
getLine()

Definition at line 1976 of file libsbml.py.

def libsbml.SBase.getCVTerm (   args  ) 

Python method signature(s):

getCVTerm(self, unsigned int n)    CVTerm

Returns the nth CVTerm in the list of CVTerms of this SBML object.

Parameters:
n unsigned int the index of the CVTerm to retrieve
Returns:
the nth CVTerm in the list of CVTerms for this SBML object.

Definition at line 2917 of file libsbml.py.

def libsbml.SBase.getElementName (   args  ) 

def libsbml.SBase.getId (   args  ) 

Python method signature(s):

getId(self)    string

Returns the value of the 'id' attribute of this object, if it has one.

Most (but not all) objects in SBML include two common attributes: 'id' and 'name'. The identifier given by an object's 'id' attribute value is used to identify the object within the SBML model definition. Other objects can refer to the component using this identifier. The data type of 'id' is always either Sid or UnitSId, depending on the object in question. Both data types are defined as follows:

  letter ::= 'a'..'z','A'..'Z'
  digit  ::= '0'..'9'
  idChar ::= letter | digit | '_'
  SId    ::= ( letter | '_' ) idChar*

The equality of SId and UnitSId type values in SBML is determined by an exact character sequence match; i.e., comparisons of these identifiers must be performed in a case-sensitive manner. This applies to all uses of SId and UnitSId.

Returns:
the id of this SBML object.
Note:
The fact that the value of attribute 'id' is defined on the SBase parent class object is a convenience provided by libSBML, and does not strictly follow SBML specifications. This libSBML implementation of SBase allows client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have identifiers), but beware that not all SBML object classes provide an 'id' attribute. LibSBML will allow the identifier to be set, but it will not read nor write 'id' attributes for objects that do not possess them according to the SBML specification for the Level and Version in use.
See also:
setId(const std.string& sid)

isSetId()

unsetId()

Definition at line 1537 of file libsbml.py.

def libsbml.SBase.getLevel (   args  ) 

Python method signature(s):

getLevel(self)    unsigned int

Returns the SBML Level of the overall SBML document.

Returns:
the SBML level of this SBML object.
See also:
getVersion()

Definition at line 3002 of file libsbml.py.

def libsbml.SBase.getLine (   args  ) 

Python method signature(s):

getLine(self)    unsigned int

Returns the line number on which this object first appears in the XML representation of the SBML document.

Returns:
the line number of this SBML object.
See also:
getColumn()

Definition at line 1958 of file libsbml.py.

def libsbml.SBase.getMetaId (   args  ) 

Python method signature(s):

getMetaId(self)    string

Returns the value of the 'metaid' attribute of this object.

The optional attribute named 'metaid', present on every major SBML component type, is for supporting metadata annotations using RDF (Resource Description Format). The attribute value has the data type XML ID, the XML identifier type, which means each 'metaid' value must be globally unique within an SBML file. (Importantly, this uniqueness criterion applies across any attribute with type XML ID, not just the 'metaid' attribute used by SBML—something to be aware of if your application-specific XML content inside the 'annotation' subelement happens to use XML ID.) The 'metaid' value serves to identify a model component for purposes such as referencing that component from metadata placed within 'annotation' subelements.

Returns:
the metaid of this SBML object.
See also:
isSetMetaId()

setMetaId(const std.string& metaid)

Definition at line 1505 of file libsbml.py.

def libsbml.SBase.getModel (   args  ) 

Python method signature(s):

getModel(self)    Model

Returns the Model object in which the current object is located.

Returns:
the parent Model of this SBML object.

Reimplemented in libsbml.SBMLDocument.

Definition at line 2987 of file libsbml.py.

def libsbml.SBase.getName (   args  ) 

Python method signature(s):

getName(self)    string

Returns the value of the 'name' attribute of this object, if it has one.

Most (but not all) objects in SBML include two common attributes: 'id' and 'name'. In contrast to the 'id' attribute, the 'name' attribute is optional and is not intended to be used for cross-referencing purposes within a model. Its purpose instead is to provide a human-readable label for the component. The data type of 'name' is the type string defined in XML Schema. SBML imposes no restrictions as to the content of 'name' attributes beyond those restrictions defined by the string type in XML Schema.

The recommended practice for handling 'name' is as follows. If a software tool has the capability for displaying the content of 'name' attributes, it should display this content to the user as a component's label instead of the component's 'id'. If the user interface does not have this capability (e.g., because it cannot display or use special characters in symbol names), or if the 'name' attribute is missing on a given component, then the user interface should display the value of the 'id' attribute instead. (Script language interpreters are especially likely to display 'id' instead of 'name'.)

As a consequence of the above, authors of systems that automatically generate the values of 'id' attributes should be aware some systems may display the 'id''s to the user. Authors therefore may wish to take some care to have their software create 'id' values that are: (a) reasonably easy for humans to type and read; and (b) likely to be meaningful, for example by making the 'id' attribute be an abbreviated form of the name attribute value.

An additional point worth mentioning is although there are restrictions on the uniqueness of 'id' values, there are no restrictions on the uniqueness of 'name' values in a model. This allows software packages leeway in assigning component identifiers.

Returns:
the name of this SBML object.
Note:
The fact that the 'name' attribute is defined on the SBase parent class object is a convenience provided by libSBML, and does not strictly follow SBML specifications. This libSBML implementation of SBase allows client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have identifiers), but beware that not all SBML object classes provide an 'id' attribute. LibSBML will allow the identifier to be set, but it will not read nor write 'id' attributes for objects that do not possess them according to the SBML specification for the Level and Version in use.
See also:
isSetName()

setName(const std.string& name)

unsetName()

Definition at line 1587 of file libsbml.py.

def libsbml.SBase.getNamespaces (   args  ) 

Python method signature(s):

getNamespaces(self)    XMLNamespaces

Returns a list of the XML Namespaces declared on this SBML document.

Returns:
the XML Namespaces associated with this SBML object

Reimplemented in libsbml.SBMLDocument.

Definition at line 1812 of file libsbml.py.

def libsbml.SBase.getNotes (   args  ) 

Python method signature(s):

getNotes(self)    XMLNode

Returns the content of the 'notes' subelement of this object as a tree of XML nodes.

The optional element named 'notes', present on every major SBML component type, is intended as a place for storing optional information intended to be seen by humans. An example use of the 'notes' element would be to contain formatted user comments about the model element in which the 'notes' element is enclosed. Every object derived directly or indirectly from type SBase can have a separate value for 'notes', allowing users considerable freedom when adding comments to their models. The format of 'notes' elements must be XHTML 1.0. The SBML Level 2 specification has considerable detail about how 'notes' element content must be handled; please refer to the specifications.

The 'notes' element content returned by this method will be in XML form, but libSBML does not provide an object model specifically for the content of notes. Callers will need to traverse the XML tree structure using the facilities available on XMLNode and related objects.

Returns:
the content of the 'notes' subelement of this SBML object.
See also:
getNotesString()

isSetNotes()

setNotes(const XMLNode* notes)

setNotes(const std.string& notes)

appendNotes(const XMLNode* notes)

appendNotes(const std.string& notes)

unsetNotes()

Definition at line 1650 of file libsbml.py.

def libsbml.SBase.getNotesString (   args  ) 

Python method signature(s):

getNotesString(self)    string

Returns the content of the 'notes' subelement of this object as a string.

The optional element named 'notes', present on every major SBML component type, is intended as a place for storing optional information intended to be seen by humans. An example use of the 'notes' element would be to contain formatted user comments about the model element in which the 'notes' element is enclosed. Every object derived directly or indirectly from type SBase can have a separate value for 'notes', allowing users considerable freedom when adding comments to their models. The format of 'notes' elements must be XHTML 1.0. The SBML Level 2 specification has considerable detail about how 'notes' element content must be handled; please refer to the specifications.

Returns:
the content of the 'notes' subelement of this SBML object.
See also:
getNotes()

isSetNotes()

setNotes(const XMLNode* notes)

setNotes(const std.string& notes)

appendNotes(const XMLNode* notes)

appendNotes(const std.string& notes)

unsetNotes()

Definition at line 1693 of file libsbml.py.

def libsbml.SBase.getNumCVTerms (   args  ) 

Python method signature(s):

getNumCVTerms(self)    unsigned int

Returns the number of CVTerm objects in the annotations of this SBML object.

Returns:
the number of CVTerms for this SBML object.

Definition at line 2901 of file libsbml.py.

def libsbml.SBase.getParentSBMLObject (   args  ) 

Python method signature(s):

getParentSBMLObject(self)    SBase

Returns the parent SBML object.

This method is convenient when holding an object nested inside other objects in an SBML model. It allows direct access to the <model> element containing it.

Returns:
the parent SBML object of this SBML object.

Definition at line 1855 of file libsbml.py.

def libsbml.SBase.getResourceBiologicalQualifier (   args  ) 

Python method signature(s):

getResourceBiologicalQualifier(self, string resource)    BiolQualifierType_t

Returns the BiologicalQualifier associated with this resource, or BQB_UNKNOWN if the resource does not exist.

Parameters:
resource string representing the resource; e.g., 'http://www.geneontology.org/GO:0005892'
Returns:
the BiolQualifierType_t value associated with the resource

Definition at line 2949 of file libsbml.py.

def libsbml.SBase.getResourceModelQualifier (   args  ) 

Python method signature(s):

getResourceModelQualifier(self, string resource)    ModelQualifierType_t

Returns the ModelQualifier associated with this resource, or BQM_UNKNOWN if the resource does not exist.

Parameters:
resource string representing the resource; e.g., 'http://www.geneontology.org/GO:0005892'
Returns:
the ModelQualifierType_t value associated with the resource

Definition at line 2968 of file libsbml.py.

def libsbml.SBase.getSBMLDocument (   args  ) 

Python method signature(s):

getSBMLDocument(self)    SBMLDocument
getSBMLDocument(self)    SBMLDocument

Returns the parent SBMLDocument object.

LibSBML uses the class SBMLDocument as a top-level container for storing SBML content and data associated with it (such as warnings and error messages). An SBML model in libSBML is contained inside an SBMLDocument object. SBMLDocument corresponds roughly to the class Sbml defined in the SBML Level 2 specification, but it does not have a direct correspondence in SBML Level 1. (But, it is created by libSBML no matter whether the model is Level 1 or Level 2.)

This method allows the SBMLDocument for the current object to be retrieved.

Returns:
the parent SBMLDocument object of this SBML object.

Definition at line 1827 of file libsbml.py.

def libsbml.SBase.getSBOTerm (   args  ) 

Python method signature(s):

getSBOTerm(self)    int

Returns the integer portion of the value of the 'sboTerm' attribute of this object.

In SBML Level 2 Versions 2, 3 and 4, the data type of the attribute is a string of the form SBO:NNNNNNN, where NNNNNNN is a seven digit integer number; libSBML simplifies the representation by only storing the NNNNNNN integer portion. Thus, in libSBML, the 'sboTerm' attribute on SBase has data type int, and SBO identifiers are stored simply as integers. SBO terms are a type of optional annotation, and each different class of SBML object derived from SBase imposes its own requirements about the values permitted for 'sboTerm'. Please consult the SBML Level 2 Version 4 specification for more information about the use of SBO and the 'sboTerm' attribute.

Returns:
the value of the 'sboTerm' attribute as an integer, or -1 if the value is not set.

Definition at line 1900 of file libsbml.py.

def libsbml.SBase.getSBOTermID (   args  ) 

Python method signature(s):

getSBOTermID(self)    string

Returns the string representation of the 'sboTerm' attribute of this object.

In SBML Level 2 Versions 2, 3 and 4, the data type of the attribute is a string of the form SBO:NNNNNNN, where NNNNNNN is a seven digit integer number; libSBML simplifies the representation by only storing the NNNNNNN integer portion. Thus, in libSBML, the 'sboTerm' attribute on SBase has data type int, and SBO identifiers are stored simply as integers. This function recreates the string representation from the stored value. SBO terms are a type of optional annotation, and each different class of SBML object derived from SBase imposes its own requirements about the values permitted for 'sboTerm'. Please consult the SBML Level 2 Version 4 specification for more information about the use of SBO and the 'sboTerm' attribute.

Returns:
the value of the 'sboTerm' attribute as a string of the form SBO:NNNNNNN, or an empty string if the value is not set.

Definition at line 1928 of file libsbml.py.

def libsbml.SBase.getTypeCode (   args  ) 

Python method signature(s):

getTypeCode(self)    SBMLTypeCode_t

Returns the libSBML type code for this object.

This method MAY return the typecode of this SBML object or it MAY return SBML_UNKNOWN. That is, subclasses of SBase are not required to implement this method to return a typecode. This method is meant primarily for the LibSBML C interface where class and subclass information is not readily available.

Returns:
the SBMLTypeCode_t value of this SBML object or SBML_UNKNOWN (default).
See also:
getElementName()

Reimplemented in libsbml.ListOf, libsbml.Model, libsbml.SBMLDocument, libsbml.FunctionDefinition, libsbml.ListOfFunctionDefinitions, libsbml.Unit, libsbml.ListOfUnits, libsbml.UnitDefinition, libsbml.ListOfUnitDefinitions, libsbml.CompartmentType, libsbml.ListOfCompartmentTypes, libsbml.SpeciesType, libsbml.ListOfSpeciesTypes, libsbml.Compartment, libsbml.ListOfCompartments, libsbml.Species, libsbml.ListOfSpecies, libsbml.Parameter, libsbml.ListOfParameters, libsbml.InitialAssignment, libsbml.ListOfInitialAssignments, libsbml.Rule, libsbml.ListOfRules, libsbml.Constraint, libsbml.ListOfConstraints, libsbml.Reaction, libsbml.ListOfReactions, libsbml.KineticLaw, libsbml.SpeciesReference, libsbml.ModifierSpeciesReference, libsbml.ListOfSpeciesReferences, libsbml.Event, libsbml.ListOfEvents, libsbml.EventAssignment, libsbml.ListOfEventAssignments, libsbml.Trigger, libsbml.Delay, and libsbml.StoichiometryMath.

Definition at line 3036 of file libsbml.py.

def libsbml.SBase.getVersion (   args  ) 

Python method signature(s):

getVersion(self)    unsigned int

Returns the Version within the SBML Level of the overall SBML document.

Returns:
the SBML version of this SBML object.
See also:
getLevel()

Definition at line 3019 of file libsbml.py.

def libsbml.SBase.isSetAnnotation (   args  ) 

Python method signature(s):

isSetAnnotation(self)    bool

Predicate returning true or false depending on whether this object's 'annotation' subelement exists and has content.

Whereas the SBase 'notes' subelement is a container for content to be shown directly to humans, the 'annotation' element is a container for optional software-generated content 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.

Some words of explanation about the set/unset/isSet methods: SBML Levels 1 and 2 define certain attributes on some classes of objects as optional. This requires an application to be careful about the distinction between two cases: (1) a given attribute has never been set to a value, and therefore should be assumed to have the SBML-defined default value, and (2) a given attribute has been set to a value, but the value happens to be an empty string. LibSBML supports these distinctions by providing methods to set, unset, and query the status of attributes that are optional. The methods have names of the form setAttribute(...), unsetAttribute(), and isSetAttribute(), where Attribute is the the name of the optional attribute in question.

Returns:
true if a 'annotation' subelement exists, false otherwise.
See also:
getAnnotation()

getAnnotationString()

setAnnotation(const XMLNode* annotation)

setAnnotation(const std.string& annotation)

appendAnnotation(const XMLNode* annotation)

appendAnnotation(const std.string& annotation)

unsetAnnotation()

Definition at line 2190 of file libsbml.py.

def libsbml.SBase.isSetId (   args  ) 

Python method signature(s):

isSetId(self)    bool

Predicate returning true or false depending on whether this object's 'id' attribute has been set.

Most (but not all) objects in SBML include two common attributes: 'id' and 'name'. The identifier given by an object's 'id' attribute value is used to identify the object within the SBML model definition. Other objects can refer to the component using this identifier. The data type of 'id' is always either Sid or UnitSId, depending on the object in question. Both data types are defined as follows:

  letter ::= 'a'..'z','A'..'Z'
  digit  ::= '0'..'9'
  idChar ::= letter | digit | '_'
  SId    ::= ( letter | '_' ) idChar*

The equality of SId and UnitSId type values in SBML is determined by an exact character sequence match; i.e., comparisons of these identifiers must be performed in a case-sensitive manner. This applies to all uses of SId and UnitSId.

Some words of explanation about the set/unset/isSet methods: SBML Levels 1 and 2 define certain attributes on some classes of objects as optional. This requires an application to be careful about the distinction between two cases: (1) a given attribute has never been set to a value, and therefore should be assumed to have the SBML-defined default value, and (2) a given attribute has been set to a value, but the value happens to be an empty string. LibSBML supports these distinctions by providing methods to set, unset, and query the status of attributes that are optional. The methods have names of the form setAttribute(...), unsetAttribute(), and isSetAttribute(), where Attribute is the the name of the optional attribute in question.

Returns:
true if the 'id' attribute of this SBML object has been set, false otherwise.
Note:
The fact that the value of attribute 'id' is defined on the SBase parent class object is a convenience provided by libSBML, and does not strictly follow SBML specifications. This libSBML implementation of SBase allows client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have identifiers), but beware that not all SBML object classes provide an 'id' attribute. LibSBML will allow the identifier to be set, but it will not read nor write 'id' attributes for objects that do not possess them according to the SBML specification for the Level and Version in use.
See also:
getId()

setId(const std.string& sid)

unsetId()

Definition at line 2030 of file libsbml.py.

def libsbml.SBase.isSetMetaId (   args  ) 

Python method signature(s):

isSetMetaId(self)    bool

Predicate returning true or false depending on whether this object's 'metaid' attribute has been set.

The optional attribute named 'metaid', present on every major SBML component type, is for supporting metadata annotations using RDF (Resource Description Format). The attribute value has the data type XML ID, the XML identifier type, which means each 'metaid' value must be globally unique within an SBML file. (Importantly, this uniqueness criterion applies across any attribute with type XML ID, not just the 'metaid' attribute used by SBML—something to be aware of if your application-specific XML content inside the 'annotation' subelement happens to use XML ID.) The 'metaid' value serves to identify a model component for purposes such as referencing that component from metadata placed within 'annotation' subelements.

Some words of explanation about the set/unset/isSet methods: SBML Levels 1 and 2 define certain attributes on some classes of objects as optional. This requires an application to be careful about the distinction between two cases: (1) a given attribute has never been set to a value, and therefore should be assumed to have the SBML-defined default value, and (2) a given attribute has been set to a value, but the value happens to be an empty string. LibSBML supports these distinctions by providing methods to set, unset, and query the status of attributes that are optional. The methods have names of the form setAttribute(...), unsetAttribute(), and isSetAttribute(), where Attribute is the the name of the optional attribute in question.

Returns:
true if the 'metaid' attribute of this SBML object has been set, false otherwise.
See also:
getMetaId()

setMetaId(const std.string& metaid)

Definition at line 1994 of file libsbml.py.

def libsbml.SBase.isSetName (   args  ) 

Python method signature(s):

isSetName(self)    bool

Predicate returning true or false depending on whether this object's 'name' attribute has been set.

Most (but not all) objects in SBML include two common attributes: 'id' and 'name'. In contrast to the 'id' attribute, the 'name' attribute is optional and is not intended to be used for cross-referencing purposes within a model. Its purpose instead is to provide a human-readable label for the component. The data type of 'name' is the type string defined in XML Schema. SBML imposes no restrictions as to the content of 'name' attributes beyond those restrictions defined by the string type in XML Schema.

The recommended practice for handling 'name' is as follows. If a software tool has the capability for displaying the content of 'name' attributes, it should display this content to the user as a component's label instead of the component's 'id'. If the user interface does not have this capability (e.g., because it cannot display or use special characters in symbol names), or if the 'name' attribute is missing on a given component, then the user interface should display the value of the 'id' attribute instead. (Script language interpreters are especially likely to display 'id' instead of 'name'.)

As a consequence of the above, authors of systems that automatically generate the values of 'id' attributes should be aware some systems may display the 'id''s to the user. Authors therefore may wish to take some care to have their software create 'id' values that are: (a) reasonably easy for humans to type and read; and (b) likely to be meaningful, for example by making the 'id' attribute be an abbreviated form of the name attribute value.

An additional point worth mentioning is although there are restrictions on the uniqueness of 'id' values, there are no restrictions on the uniqueness of 'name' values in a model. This allows software packages leeway in assigning component identifiers.

Some words of explanation about the set/unset/isSet methods: SBML Levels 1 and 2 define certain attributes on some classes of objects as optional. This requires an application to be careful about the distinction between two cases: (1) a given attribute has never been set to a value, and therefore should be assumed to have the SBML-defined default value, and (2) a given attribute has been set to a value, but the value happens to be an empty string. LibSBML supports these distinctions by providing methods to set, unset, and query the status of attributes that are optional. The methods have names of the form setAttribute(...), unsetAttribute(), and isSetAttribute(), where Attribute is the the name of the optional attribute in question.

Returns:
true if the 'name' attribute of this SBML object has been set, false otherwise.
Note:
The fact that the 'name' attribute is defined on the SBase parent class object is a convenience provided by libSBML, and does not strictly follow SBML specifications. This libSBML implementation of SBase allows client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have identifiers), but beware that not all SBML object classes provide an 'id' attribute. LibSBML will allow the identifier to be set, but it will not read nor write 'id' attributes for objects that do not possess them according to the SBML specification for the Level and Version in use.
See also:
getName()

setName(const std.string& name)

unsetName()

Definition at line 2084 of file libsbml.py.

def libsbml.SBase.isSetNotes (   args  ) 

Python method signature(s):

isSetNotes(self)    bool

Predicate returning true or false depending on whether this object's 'notes' subelement exists and has content.

The optional element named 'notes', present on every major SBML component type, is intended as a place for storing optional information intended to be seen by humans. An example use of the 'notes' element would be to contain formatted user comments about the model element in which the 'notes' element is enclosed. Every object derived directly or indirectly from type SBase can have a separate value for 'notes', allowing users considerable freedom when adding comments to their models. The format of 'notes' elements must be XHTML 1.0. The SBML Level 2 specification has considerable detail about how 'notes' element content must be handled; please refer to the specifications.

Some words of explanation about the set/unset/isSet methods: SBML Levels 1 and 2 define certain attributes on some classes of objects as optional. This requires an application to be careful about the distinction between two cases: (1) a given attribute has never been set to a value, and therefore should be assumed to have the SBML-defined default value, and (2) a given attribute has been set to a value, but the value happens to be an empty string. LibSBML supports these distinctions by providing methods to set, unset, and query the status of attributes that are optional. The methods have names of the form setAttribute(...), unsetAttribute(), and isSetAttribute(), where Attribute is the the name of the optional attribute in question.

Returns:
true if a 'notes' subelement exists, false otherwise.
See also:
getNotes()

getNotesString()

setNotes(const XMLNode* notes)

setNotes(const std.string& notes)

appendNotes(const XMLNode* notes)

appendNotes(const std.string& notes)

unsetNotes()

Definition at line 2151 of file libsbml.py.

def libsbml.SBase.isSetSBOTerm (   args  ) 

Python method signature(s):

isSetSBOTerm(self)    bool

Predicate returning true or false depending on whether this object's 'sboTerm' attribute has been set.

Some words of explanation about the set/unset/isSet methods: SBML Levels 1 and 2 define certain attributes on some classes of objects as optional. This requires an application to be careful about the distinction between two cases: (1) a given attribute has never been set to a value, and therefore should be assumed to have the SBML-defined default value, and (2) a given attribute has been set to a value, but the value happens to be an empty string. LibSBML supports these distinctions by providing methods to set, unset, and query the status of attributes that are optional. The methods have names of the form setAttribute(...), unsetAttribute(), and isSetAttribute(), where Attribute is the the name of the optional attribute in question.

Returns:
true if the 'sboTerm' attribute of this SBML object has been set, false otherwise.

Definition at line 2230 of file libsbml.py.

def libsbml.SBase.read (   args  ) 

Python method signature(s):

read(self, XMLInputStream stream)

Reads (initializes) this SBML object by reading from XMLInputStream.

Deprecated:
libSBML internal

Definition at line 3094 of file libsbml.py.

def libsbml.SBase.setAnnotation (   args  ) 

Python method signature(s):

setAnnotation(self, XMLNode annotation)
setAnnotation(self, string annotation)

Sets the value of the 'annotation' subelement of this SBML object to a copy of annotation given as a character string.

Whereas the SBase 'notes' subelement is a container for content to be shown directly to humans, the 'annotation' element is a container for optional software-generated content 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 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 appendAnnotation(const std.string& annotation).

Some words of explanation about the set/unset/isSet methods: SBML Levels 1 and 2 define certain attributes on some classes of objects as optional. This requires an application to be careful about the distinction between two cases: (1) a given attribute has never been set to a value, and therefore should be assumed to have the SBML-defined default value, and (2) a given attribute has been set to a value, but the value happens to be an empty string. LibSBML supports these distinctions by providing methods to set, unset, and query the status of attributes that are optional. The methods have names of the form setAttribute(...), unsetAttribute(), and isSetAttribute(), where Attribute is the the name of the optional attribute in question.

Parameters:
annotation an XML string that is to be used as the content of the 'annotation' subelement of this object
See also:
getAnnotationString()

isSetAnnotation()

setAnnotation(const XMLNode* annotation)

appendAnnotation(const XMLNode* annotation)

appendAnnotation(const std.string& annotation)

unsetAnnotation()

Reimplemented in libsbml.Model, and libsbml.SpeciesReference.

Definition at line 2395 of file libsbml.py.

def libsbml.SBase.setId (   args  ) 

Python method signature(s):

setId(self, string sid)

Sets the value of the 'id' attribute of this SBML object to a copy of id.

The string sid is copied. Note that SBML has strict requirements for the syntax of identifiers. The following is summary of the definition of the SBML identifier type SId (here expressed in an extended form of BNF notation):

  letter ::= 'a'..'z','A'..'Z'
  digit  ::= '0'..'9'
  idChar ::= letter | digit | '_'
  SId    ::= ( letter | '_' ) idChar*
The equality of SBML identifiers is determined by an exact character sequence match; i.e., comparisons must be performed in a case-sensitive manner. In addition, there are a few conditions for the uniqueness of identifiers in an SBML model. Please consult the SBML specifications for the exact formulations.

Some words of explanation about the set/unset/isSet methods: SBML Levels 1 and 2 define certain attributes on some classes of objects as optional. This requires an application to be careful about the distinction between two cases: (1) a given attribute has never been set to a value, and therefore should be assumed to have the SBML-defined default value, and (2) a given attribute has been set to a value, but the value happens to be an empty string. LibSBML supports these distinctions by providing methods to set, unset, and query the status of attributes that are optional. The methods have names of the form setAttribute(...), unsetAttribute(), and isSetAttribute(), where Attribute is the the name of the optional attribute in question.

Parameters:
sid the string to use as the identifier of this object
Note:
The fact that the value of attribute 'id' is defined on the SBase parent class object is a convenience provided by libSBML, and does not strictly follow SBML specifications. This libSBML implementation of SBase allows client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have identifiers), but beware that not all SBML object classes provide an 'id' attribute. LibSBML will allow the identifier to be set, but it will not read nor write 'id' attributes for objects that do not possess them according to the SBML specification for the Level and Version in use.
See also:
isSetId()

getId()

unsetId()

Definition at line 2280 of file libsbml.py.

def libsbml.SBase.setMetaId (   args  ) 

Python method signature(s):

setMetaId(self, string metaid)

Sets the value of the 'metaid' attribute of this object.

The string metaid is copied. The value of metaid must be an identifier conforming to the syntax defined by the XML 1.0 data type ID. Among other things, this type requires that a value is unique among all the values of type XML ID in an SBMLDocument. Although SBML only uses XML ID for the 'metaid' attribute, callers should be careful if they use XML ID's in XML portions of a model that are not defined by SBML, such as in the application-specific content of the 'annotation' subelement.

Some words of explanation about the set/unset/isSet methods: SBML Levels 1 and 2 define certain attributes on some classes of objects as optional. This requires an application to be careful about the distinction between two cases: (1) a given attribute has never been set to a value, and therefore should be assumed to have the SBML-defined default value, and (2) a given attribute has been set to a value, but the value happens to be an empty string. LibSBML supports these distinctions by providing methods to set, unset, and query the status of attributes that are optional. The methods have names of the form setAttribute(...), unsetAttribute(), and isSetAttribute(), where Attribute is the the name of the optional attribute in question.

Parameters:
metaid the identifier string to use as the value of the 'metaid' attribute
See also:
getMetaId()

isSetMetaId()

Definition at line 2249 of file libsbml.py.

def libsbml.SBase.setName (   args  ) 

Python method signature(s):

setName(self, string name)

Sets the value of the 'name' attribute of this SBML object to a copy of name.

Most (but not all) objects in SBML include two common attributes: 'id' and 'name'. In contrast to the 'id' attribute, the 'name' attribute is optional and is not intended to be used for cross-referencing purposes within a model. Its purpose instead is to provide a human-readable label for the component. The data type of 'name' is the type string defined in XML Schema. SBML imposes no restrictions as to the content of 'name' attributes beyond those restrictions defined by the string type in XML Schema.

The recommended practice for handling 'name' is as follows. If a software tool has the capability for displaying the content of 'name' attributes, it should display this content to the user as a component's label instead of the component's 'id'. If the user interface does not have this capability (e.g., because it cannot display or use special characters in symbol names), or if the 'name' attribute is missing on a given component, then the user interface should display the value of the 'id' attribute instead. (Script language interpreters are especially likely to display 'id' instead of 'name'.)

As a consequence of the above, authors of systems that automatically generate the values of 'id' attributes should be aware some systems may display the 'id''s to the user. Authors therefore may wish to take some care to have their software create 'id' values that are: (a) reasonably easy for humans to type and read; and (b) likely to be meaningful, for example by making the 'id' attribute be an abbreviated form of the name attribute value.

An additional point worth mentioning is although there are restrictions on the uniqueness of 'id' values, there are no restrictions on the uniqueness of 'name' values in a model. This allows software packages leeway in assigning component identifiers.

Some words of explanation about the set/unset/isSet methods: SBML Levels 1 and 2 define certain attributes on some classes of objects as optional. This requires an application to be careful about the distinction between two cases: (1) a given attribute has never been set to a value, and therefore should be assumed to have the SBML-defined default value, and (2) a given attribute has been set to a value, but the value happens to be an empty string. LibSBML supports these distinctions by providing methods to set, unset, and query the status of attributes that are optional. The methods have names of the form setAttribute(...), unsetAttribute(), and isSetAttribute(), where Attribute is the the name of the optional attribute in question.

Parameters:
name the new name for the object; the string will be copied
Note:
The fact that the 'name' attribute is defined on the SBase parent class object is a convenience provided by libSBML, and does not strictly follow SBML specifications. This libSBML implementation of SBase allows client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have identifiers), but beware that not all SBML object classes provide an 'id' attribute. LibSBML will allow the identifier to be set, but it will not read nor write 'id' attributes for objects that do not possess them according to the SBML specification for the Level and Version in use.
See also:
getName()

isSetName()

unsetName()

Definition at line 2329 of file libsbml.py.

def libsbml.SBase.setNamespaces (   args  ) 

Python method signature(s):

setNamespaces(self, XMLNamespaces xmlns)

Sets the namespaces relevant of this SBML object.

Parameters:
xmlns the namespaces to set

Definition at line 2631 of file libsbml.py.

def libsbml.SBase.setNotes (   args  ) 

Python method signature(s):

setNotes(self, XMLNode notes)
setNotes(self, string notes)

Sets the value of the 'notes' subelement of this SBML object to a copy of the string notes.

Any existing content of the 'notes' subelement is discarded.

The optional element named 'notes', present on every major SBML component type, is intended as a place for storing optional information intended to be seen by humans. An example use of the 'notes' element would be to contain formatted user comments about the model element in which the 'notes' element is enclosed. Every object derived directly or indirectly from type SBase can have a separate value for 'notes', allowing users considerable freedom when adding comments to their models. The format of 'notes' elements must be XHTML 1.0. The SBML Level 2 specification has considerable detail about how 'notes' element content must be handled; please refer to the specifications.

Some words of explanation about the set/unset/isSet methods: SBML Levels 1 and 2 define certain attributes on some classes of objects as optional. This requires an application to be careful about the distinction between two cases: (1) a given attribute has never been set to a value, and therefore should be assumed to have the SBML-defined default value, and (2) a given attribute has been set to a value, but the value happens to be an empty string. LibSBML supports these distinctions by providing methods to set, unset, and query the status of attributes that are optional. The methods have names of the form setAttribute(...), unsetAttribute(), and isSetAttribute(), where Attribute is the the name of the optional attribute in question.

Parameters:
notes an XML string that is to be used as the content of the 'notes' subelement of this object
See also:
getNotesString()

isSetNotes()

setNotes(const XMLNode* notes)

appendNotes(const XMLNode* notes)

appendNotes(const std.string& notes)

unsetNotes()

Definition at line 2489 of file libsbml.py.

def libsbml.SBase.setParentSBMLObject (   args  ) 

Python method signature(s):

setParentSBMLObject(self, SBase sb)

Sets the parent SBML object of this SBML object.

Parameters:
sb the SBML object to use
Deprecated:
libSBML internal

Reimplemented in libsbml.ListOf, libsbml.Model, libsbml.UnitDefinition, libsbml.Reaction, libsbml.KineticLaw, libsbml.Event, libsbml.Trigger, libsbml.Delay, and libsbml.StoichiometryMath.

Definition at line 2587 of file libsbml.py.

def libsbml.SBase.setSBMLDocument (   args  ) 

Python method signature(s):

setSBMLDocument(self, SBMLDocument d)

Sets the parent SBMLDocument of this SBML object.

Parameters:
d the SBMLDocument object to use
Deprecated:
libSBML internal

Reimplemented in libsbml.ListOf, libsbml.Model, libsbml.SBMLDocument, libsbml.UnitDefinition, libsbml.Reaction, libsbml.KineticLaw, libsbml.Event, libsbml.Trigger, libsbml.Delay, and libsbml.StoichiometryMath.

Definition at line 2571 of file libsbml.py.

def libsbml.SBase.setSBOTerm (   args  ) 

Python method signature(s):

setSBOTerm(self, int value)

Sets the value of the 'sboTerm' attribute.

In SBML Level 2 Versions 2, 3 and 4, the data type of the SBML 'sboTerm' attribute is a string of the form SBO:NNNNNNN, where NNNNNNN is a seven digit integer number; libSBML simplifies the representation by only storing the NNNNNNN integer portion. Thus, in libSBML, the 'sboTerm' attribute on SBase has data type int, and SBO identifiers are stored simply as integers. SBO terms are a type of optional annotation, and each different class of SBML object derived from SBase imposes its own requirements about the values permitted for 'sboTerm'. Please consult the SBML Level 2 Version 4 specification for more information about the use of SBO and the 'sboTerm' attribute.

Some words of explanation about the set/unset/isSet methods: SBML Levels 1 and 2 define certain attributes on some classes of objects as optional. This requires an application to be careful about the distinction between two cases: (1) a given attribute has never been set to a value, and therefore should be assumed to have the SBML-defined default value, and (2) a given attribute has been set to a value, but the value happens to be an empty string. LibSBML supports these distinctions by providing methods to set, unset, and query the status of attributes that are optional. The methods have names of the form setAttribute(...), unsetAttribute(), and isSetAttribute(), where Attribute is the the name of the optional attribute in question.

Parameters:
value the NNNNNNN integer portion of the SBO identifier

Definition at line 2603 of file libsbml.py.

def libsbml.SBase.toSBML (   args  ) 

Python method signature(s):

toSBML(self)    char

Returns a string that consists of the partial SBML describing this object. This is primarily provided for testing and debugging purposes. It may be removed in a future version of libSBML.

Returns:
the partial SBML that describes this SBML object.

Definition at line 3077 of file libsbml.py.

def libsbml.SBase.unsetAnnotation (   args  ) 

Python method signature(s):

unsetAnnotation(self)

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.

Some words of explanation about the set/unset/isSet methods: SBML Levels 1 and 2 define certain attributes on some classes of objects as optional. This requires an application to be careful about the distinction between two cases: (1) a given attribute has never been set to a value, and therefore should be assumed to have the SBML-defined default value, and (2) a given attribute has been set to a value, but the value happens to be an empty string. LibSBML supports these distinctions by providing methods to set, unset, and query the status of attributes that are optional. The methods have names of the form setAttribute(...), unsetAttribute(), and isSetAttribute(), where Attribute is the the name of the optional attribute in question.

See also:
getAnnotation()

getAnnotationString()

isSetAnnotation()

setAnnotation(const XMLNode* annotation)

setAnnotation(const std.string& annotation)

appendAnnotation(const XMLNode* annotation)

appendAnnotation(const std.string& annotation)

Definition at line 2823 of file libsbml.py.

def libsbml.SBase.unsetCVTerms (   args  ) 

Python method signature(s):

unsetCVTerms(self)

Clears the list of CVTerms of this SBML object.

Definition at line 2935 of file libsbml.py.

def libsbml.SBase.unsetId (   args  ) 

Python method signature(s):

unsetId(self)

Unsets the value of the 'id' attribute of this SBML object.

Most (but not all) objects in SBML include two common attributes: 'id' and 'name'. The identifier given by an object's 'id' attribute value is used to identify the object within the SBML model definition. Other objects can refer to the component using this identifier. The data type of 'id' is always either Sid or UnitSId, depending on the object in question. Both data types are defined as follows:

  letter ::= 'a'..'z','A'..'Z'
  digit  ::= '0'..'9'
  idChar ::= letter | digit | '_'
  SId    ::= ( letter | '_' ) idChar*

The equality of SId and UnitSId type values in SBML is determined by an exact character sequence match; i.e., comparisons of these identifiers must be performed in a case-sensitive manner. This applies to all uses of SId and UnitSId.

Some words of explanation about the set/unset/isSet methods: SBML Levels 1 and 2 define certain attributes on some classes of objects as optional. This requires an application to be careful about the distinction between two cases: (1) a given attribute has never been set to a value, and therefore should be assumed to have the SBML-defined default value, and (2) a given attribute has been set to a value, but the value happens to be an empty string. LibSBML supports these distinctions by providing methods to set, unset, and query the status of attributes that are optional. The methods have names of the form setAttribute(...), unsetAttribute(), and isSetAttribute(), where Attribute is the the name of the optional attribute in question.

Note:
The fact that the value of attribute 'id' is defined on the SBase parent class object is a convenience provided by libSBML, and does not strictly follow SBML specifications. This libSBML implementation of SBase allows client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have identifiers), but beware that not all SBML object classes provide an 'id' attribute. LibSBML will allow the identifier to be set, but it will not read nor write 'id' attributes for objects that do not possess them according to the SBML specification for the Level and Version in use.
See also:
setId(const std.string& sid)

getId()

isSetId()

Definition at line 2675 of file libsbml.py.

def libsbml.SBase.unsetMetaId (   args  ) 

Python method signature(s):

unsetMetaId(self)

Unsets the value of the 'metaid' attribute of this SBML object.

The optional attribute named 'metaid', present on every major SBML component type, is for supporting metadata annotations using RDF (Resource Description Format). The attribute value has the data type XML ID, the XML identifier type, which means each 'metaid' value must be globally unique within an SBML file. (Importantly, this uniqueness criterion applies across any attribute with type XML ID, not just the 'metaid' attribute used by SBML—something to be aware of if your application-specific XML content inside the 'annotation' subelement happens to use XML ID.) The 'metaid' value serves to identify a model component for purposes such as referencing that component from metadata placed within 'annotation' subelements.

Some words of explanation about the set/unset/isSet methods: SBML Levels 1 and 2 define certain attributes on some classes of objects as optional. This requires an application to be careful about the distinction between two cases: (1) a given attribute has never been set to a value, and therefore should be assumed to have the SBML-defined default value, and (2) a given attribute has been set to a value, but the value happens to be an empty string. LibSBML supports these distinctions by providing methods to set, unset, and query the status of attributes that are optional. The methods have names of the form setAttribute(...), unsetAttribute(), and isSetAttribute(), where Attribute is the the name of the optional attribute in question.

Definition at line 2646 of file libsbml.py.

def libsbml.SBase.unsetName (   args  ) 

Python method signature(s):

unsetName(self)

Unsets the value of the 'name' attribute of this SBML object.

Most (but not all) objects in SBML include two common attributes: 'id' and 'name'. In contrast to the 'id' attribute, the 'name' attribute is optional and is not intended to be used for cross-referencing purposes within a model. Its purpose instead is to provide a human-readable label for the component. The data type of 'name' is the type string defined in XML Schema. SBML imposes no restrictions as to the content of 'name' attributes beyond those restrictions defined by the string type in XML Schema.

The recommended practice for handling 'name' is as follows. If a software tool has the capability for displaying the content of 'name' attributes, it should display this content to the user as a component's label instead of the component's 'id'. If the user interface does not have this capability (e.g., because it cannot display or use special characters in symbol names), or if the 'name' attribute is missing on a given component, then the user interface should display the value of the 'id' attribute instead. (Script language interpreters are especially likely to display 'id' instead of 'name'.)

As a consequence of the above, authors of systems that automatically generate the values of 'id' attributes should be aware some systems may display the 'id''s to the user. Authors therefore may wish to take some care to have their software create 'id' values that are: (a) reasonably easy for humans to type and read; and (b) likely to be meaningful, for example by making the 'id' attribute be an abbreviated form of the name attribute value.

An additional point worth mentioning is although there are restrictions on the uniqueness of 'id' values, there are no restrictions on the uniqueness of 'name' values in a model. This allows software packages leeway in assigning component identifiers.

Some words of explanation about the set/unset/isSet methods: SBML Levels 1 and 2 define certain attributes on some classes of objects as optional. This requires an application to be careful about the distinction between two cases: (1) a given attribute has never been set to a value, and therefore should be assumed to have the SBML-defined default value, and (2) a given attribute has been set to a value, but the value happens to be an empty string. LibSBML supports these distinctions by providing methods to set, unset, and query the status of attributes that are optional. The methods have names of the form setAttribute(...), unsetAttribute(), and isSetAttribute(), where Attribute is the the name of the optional attribute in question.

Note:
The fact that the 'name' attribute is defined on the SBase parent class object is a convenience provided by libSBML, and does not strictly follow SBML specifications. This libSBML implementation of SBase allows client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have identifiers), but beware that not all SBML object classes provide an 'id' attribute. LibSBML will allow the identifier to be set, but it will not read nor write 'id' attributes for objects that do not possess them according to the SBML specification for the Level and Version in use.
See also:
isSetName()

setName(const std.string& name)

getName()

Definition at line 2725 of file libsbml.py.

def libsbml.SBase.unsetNotes (   args  ) 

Python method signature(s):

unsetNotes(self)

Unsets the value of the 'notes' subelement of this SBML object.

The optional element named 'notes', present on every major SBML component type, is intended as a place for storing optional information intended to be seen by humans. An example use of the 'notes' element would be to contain formatted user comments about the model element in which the 'notes' element is enclosed. Every object derived directly or indirectly from type SBase can have a separate value for 'notes', allowing users considerable freedom when adding comments to their models. The format of 'notes' elements must be XHTML 1.0. The SBML Level 2 specification has considerable detail about how 'notes' element content must be handled; please refer to the specifications.

Some words of explanation about the set/unset/isSet methods: SBML Levels 1 and 2 define certain attributes on some classes of objects as optional. This requires an application to be careful about the distinction between two cases: (1) a given attribute has never been set to a value, and therefore should be assumed to have the SBML-defined default value, and (2) a given attribute has been set to a value, but the value happens to be an empty string. LibSBML supports these distinctions by providing methods to set, unset, and query the status of attributes that are optional. The methods have names of the form setAttribute(...), unsetAttribute(), and isSetAttribute(), where Attribute is the the name of the optional attribute in question.

See also:
getNotesString()

isSetNotes()

setNotes(const XMLNode* notes)

setNotes(const std.string& notes)

appendNotes(const XMLNode* notes)

appendNotes(const std.string& notes)

Definition at line 2788 of file libsbml.py.

def libsbml.SBase.unsetSBOTerm (   args  ) 

Python method signature(s):

unsetSBOTerm(self)

Unsets the value of the 'sboTerm' attribute of this SBML object.

Some words of explanation about the set/unset/isSet methods: SBML Levels 1 and 2 define certain attributes on some classes of objects as optional. This requires an application to be careful about the distinction between two cases: (1) a given attribute has never been set to a value, and therefore should be assumed to have the SBML-defined default value, and (2) a given attribute has been set to a value, but the value happens to be an empty string. LibSBML supports these distinctions by providing methods to set, unset, and query the status of attributes that are optional. The methods have names of the form setAttribute(...), unsetAttribute(), and isSetAttribute(), where Attribute is the the name of the optional attribute in question.

Definition at line 2859 of file libsbml.py.

def libsbml.SBase.write (   args  ) 

Python method signature(s):

write(self, XMLOutputStream stream)

Writes (serializes) this SBML object by writing it to XMLOutputStream.

Deprecated:
libSBML internal

Definition at line 3108 of file libsbml.py.


Member Data Documentation




HTML documentation generated on Mon Jun 15 21:07:01 2009 using Doxygen 1.5.8.