libSBML C API
5.18.0
|
Most components in SBML are derived from a single abstract base type, SBase_t. 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_t 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_t 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_t 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_t 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_t 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_t 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_t: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_t has data type int
, and SBO_t identifiers are stored simply as integers. (For convenience, SBase_t offers methods for returning both the integer form and a text-string form of the SBO_t identifier.) SBO_t terms are a type of optional annotation, and each different class of SBML object derived from SBase_t 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_t, there is no public constructor because SBase_t is an abstract class. The constructors reside in the subclasses derived from SBase_t.
SBML Level 2 Versions 2, 3 and 4, and Level 3, 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.
Public Member Functions | |
int | SBase_addCVTerm (SBase_t *sb, CVTerm_t *term) |
Adds a copy of the given CVTerm_t to this SBML structure. More... | |
int | SBase_addCVTermNewBag (SBase_t *sb, CVTerm_t *term) |
Adds a copy of the given CVTerm_t to this SBML structure creating a new bBag element with the same identifier. More... | |
int | SBase_appendAnnotation (SBase_t *sb, XMLNode_t *annotation) |
Appends the annotation for the given SBML structure. More... | |
int | SBase_appendAnnotationString (SBase_t *sb, const char *annotation) |
Appends the annotation for the given SBML structure. More... | |
int | SBase_appendNotes (SBase_t *sb, XMLNode_t *notes) |
Appends the notes for the given SBML structure. More... | |
int | SBase_appendNotesString (SBase_t *sb, const char *notes) |
Appends the notes for the given SBML structure. More... | |
List_t * | SBase_getAllElements (SBase_t *sb) |
Returns a List_t structure of all child SBase_t structures, including those nested to an arbitrary depth. More... | |
List_t * | SBase_getAllElementsFromPlugins (SBase_t *sb) |
Returns a List_t of all child SBase_t structures contained in SBML package plug-ins. More... | |
const SBase_t * | SBase_getAncestorOfType (SBase_t *sb, int type, const char *pkgName) |
Returns the ancestor SBase_t structure of the given SBase_t structure that corresponds to the given type. More... | |
XMLNode_t * | SBase_getAnnotation (SBase_t *sb) |
Returns the annotation from given SBML structure. More... | |
char * | SBase_getAnnotationString (SBase_t *sb) |
Returns the annotation string from given SBML structure. More... | |
unsigned int | SBase_getColumn (const SBase_t *sb) |
Returns the column number on which the given structure first appears in the XML representation of the SBML document, or 0 if the object was created, not read from a file. More... | |
CVTerm_t * | SBase_getCVTerm (SBase_t *sb, unsigned int n) |
Returns the nth CVTerm_t in the list of CVTerm_t's of this SBML structure. More... | |
List_t * | SBase_getCVTerms (SBase_t *sb) |
Returns a list of CVTerm_t structures in the annotations of this SBML structure. More... | |
SBase_t * | SBase_getElementByMetaId (SBase_t *sb, const char *metaid) |
Returns the first child element it can find with a specific "metaid" attribute value, or NULL if no such structure is found. More... | |
SBase_t * | SBase_getElementBySId (SBase_t *sb, const char *id) |
Returns the first child element found that has the given id in the model-wide SId namespace, or NULL if no such structure is found. More... | |
SBase_t * | SBase_getElementFromPluginsByMetaId (SBase_t *sb, const char *metaid) |
Returns the first child element it can find with the given metaid from all plug-ins associated with this element, or NULL if no such structure is found. More... | |
SBase_t * | SBase_getElementFromPluginsBySId (SBase_t *sb, const char *id) |
Returns the first child element found that has the given id in the model-wide SId namespace from all plug-ins associated with this element, or NULL if no such structure is found. More... | |
const char * | SBase_getElementName (const SBase_t *sb) |
Returns the XML element name of the given structure. More... | |
const char * | SBase_getIdAttribute (SBase_t *sb) |
Returns the value of the "id" attribute of the given SBase_t structure. More... | |
unsigned int | SBase_getLevel (const SBase_t *sb) |
Returns the SBML Level of the overall SBML document. More... | |
unsigned int | SBase_getLine (const SBase_t *sb) |
Returns the line number on which the given structure first appears in the XML representation of the SBML document, or 0 if the object was created, not read from a file. More... | |
const char * | SBase_getMetaId (SBase_t *sb) |
Returns the value of the "metaid" attribute of the given SBase_t structure. More... | |
const Model_t * | SBase_getModel (const SBase_t *sb) |
Returns the Model_t structure in which the given instance is located. More... | |
ModelHistory_t * | SBase_getModelHistory (SBase_t *sb) |
Returns the ModelHistory_t of the given SBase_t structure. More... | |
const char * | SBase_getName (SBase_t *sb) |
Returns the value of the "name" attribute of the given SBase_t structure. More... | |
XMLNode_t * | SBase_getNotes (SBase_t *sb) |
Returns the notes from given SBML structure. More... | |
char * | SBase_getNotesString (SBase_t *sb) |
Returns the notes string from given SBML structure. More... | |
unsigned int | SBase_getNumCVTerms (SBase_t *sb) |
Returns the number of CVTerm_t structures in the annotations of this SBML structure. More... | |
int | SBase_getNumPlugins (SBase_t *sb) |
Returns the number of plug-in structures (extenstion interfaces) for SBML Level 3 package extensions known. More... | |
char * | SBase_getPackageName (const SBaseExtensionPoint_t *sb) |
Returns the package name for the given SBase_t structure. More... | |
const SBase_t * | SBase_getParentSBMLObject (SBase_t *sb) |
Returns the parent SBase_t structure of the given SBase_t structure. More... | |
SBasePlugin_t * | SBase_getPlugin (SBase_t *sb, const char *package) |
Returns a plug-in structure (extension interface) for an SBML Level 3 package extension with the given package name or URI. More... | |
BiolQualifierType_t | SBase_getResourceBiologicalQualifier (SBase_t *sb, const char *resource) |
Returns the Biological Qualifier associated with this resource, BQB_UNKNOWN if the resource does not exist. More... | |
ModelQualifierType_t | SBase_getResourceModelQualifier (SBase_t *sb, const char *resource) |
Returns the Model_t Qualifier associated with this resource, BQM_UNKNOWN if the resource does not exist. More... | |
const SBMLDocument_t * | SBase_getSBMLDocument (SBase_t *sb) |
Returns the parent SBMLDocument_t structure of the given SBase_t structure. More... | |
int | SBase_getSBOTerm (const SBase_t *sb) |
Returns the integer portion of the value of the "sboTerm" attribute of the given SBase_t structure. More... | |
char * | SBase_getSBOTermAsURL (const SBase_t *sb) |
Returns the identifiers.org URL representation of the "sboTerm" attribute of this structure. More... | |
char * | SBase_getSBOTermID (const SBase_t *sb) |
Returns the string representation of the "sboTerm" attribute of this structure. More... | |
int | SBase_getTypeCode (const SBase_t *sb) |
Returns the libSBML type code for this structure. More... | |
void * | SBase_getUserData (const SBase_t *sb) |
Returns the user data that has been previously set by setUserData(). More... | |
unsigned int | SBase_getVersion (const SBase_t *sb) |
Returns the Version within the SBML Level of the overall SBML document. More... | |
int | SBase_hasValidLevelVersionNamespaceCombination (SBase_t *sb) |
Predicate returning 1 (true) or 0 (false) depending on whether the structure's level/version and namespace values correspond to a valid SBML specification. More... | |
int | SBase_isSetAnnotation (const SBase_t *sb) |
Predicate returning 1 (true) or 0 (false) depending on whether the given structure's "annotation" subelement is set. More... | |
int | SBase_isSetIdAttribute (const SBase_t *sb) |
Predicate returning 1 (true) or 0 (false) depending on whether the given structure's "id" attribute is set. More... | |
int | SBase_isSetMetaId (const SBase_t *sb) |
Predicate returning 1 (true) or 0 (false) depending on whether the given structure's "metaid" attribute is set. More... | |
int | SBase_isSetModelHistory (SBase_t *sb) |
Predicate for testing whether the ModelHistory_t of a given SBase_t structure is assigned. More... | |
int | SBase_isSetName (const SBase_t *sb) |
Predicate returning 1 (true) or 0 (false) depending on whether the given structure's "name" attribute is set. More... | |
int | SBase_isSetNotes (const SBase_t *sb) |
Predicate returning 1 (true) or 0 (false) depending on whether the given structure's "notes" subelement is set. More... | |
int | SBase_isSetSBOTerm (const SBase_t *sb) |
Predicate returning 1 (true) or 0 (false) depending on whether the given structure's "sboTerm" attribute is set. More... | |
int | SBase_isSetUserData (const SBase_t *sb) |
Predicate returning 1 (true) or 0 (false) depending on whether the structure's user data object has been set. More... | |
int | SBase_removeTopLevelAnnotationElement (SBase_t *sb, const char *name) |
Removes the top-level element within the "annotation" subelement of this SBML structure with the given name. More... | |
int | SBase_removeTopLevelAnnotationElementWithURI (SBase_t *sb, const char *name, const char *uri) |
Removes the top-level element within the "annotation" subelement of this SBML structure with the given name and URI. More... | |
void | SBase_renameMetaIdRefs (SBase_t *sb, const char *oldid, const char *newid) |
Renames all the meta-identifier attributes on this element. More... | |
void | SBase_renameSIdRefs (SBase_t *sb, const char *oldid, const char *newid) |
Renames all the SIdRef attributes on this element, including any found in MathML content (if such exists). More... | |
void | SBase_renameUnitSIdRefs (SBase_t *sb, const char *oldid, const char *newid) |
Renames all the UnitSIdRef attributes on this element. More... | |
int | SBase_replaceTopLevelAnnotationElement (SBase_t *sb, XMLNode_t *annotation) |
Replaces the given top-level element within the "annotation" subelement of this SBML structure and with the annotation element supplied. More... | |
int | SBase_replaceTopLevelAnnotationElementString (SBase_t *sb, const char *annotation) |
Replaces the given top-level element within the "annotation" subelement of this SBML structure and with the annotation element supplied. More... | |
int | SBase_setAnnotation (SBase_t *sb, XMLNode_t *annotation) |
Sets the annotation for the given SBML structure. More... | |
int | SBase_setAnnotationString (SBase_t *sb, const char *annotation) |
Sets the annotation for the given SBML structure. More... | |
int | SBase_setIdAttribute (SBase_t *sb, const char *id) |
Sets the value of the "id" attribute of the given structure. More... | |
int | SBase_setMetaId (SBase_t *sb, const char *metaid) |
Sets the value of the "metaid" attribute of the given structure. More... | |
int | SBase_setModelHistory (SBase_t *sb, ModelHistory_t *history) |
Set the ModelHistory_t of the given SBase_t structure. More... | |
int | SBase_setName (SBase_t *sb, const char *name) |
Sets the value of the "name" attribute of the given structure. More... | |
int | SBase_setNamespaces (SBase_t *sb, XMLNamespaces_t *xmlns) |
Sets the namespaces relevant of this SBML structure. More... | |
int | SBase_setNotes (SBase_t *sb, XMLNode_t *notes) |
Sets the notes for the given SBML structure. More... | |
int | SBase_setNotesString (SBase_t *sb, const char *notes) |
Sets the notes for the given SBML structure. More... | |
int | SBase_setNotesStringAddMarkup (SBase_t *sb, const char *notes) |
Sets the notes for the given SBML structure. More... | |
int | SBase_setSBOTerm (SBase_t *sb, int value) |
Sets the value of the "sboTerm" attribute. More... | |
int | SBase_setSBOTermID (SBase_t *sb, const char *sboid) |
Sets the value of the "sboTerm" attribute by string. More... | |
int | SBase_setUserData (SBase_t *sb, void *userData) |
Sets the user data of this node. More... | |
int | SBase_unsetAnnotation (SBase_t *sb) |
Unsets the "annotation" subelement of the given structure. More... | |
int | SBase_unsetCVTerms (SBase_t *sb) |
Clears the list of CVTerm_t's of this SBML structure. More... | |
int | SBase_unsetIdAttribute (SBase_t *sb) |
Unsets the "id" attribute of the given structure. More... | |
int | SBase_unsetMetaId (SBase_t *sb) |
Unsets the "metaid" attribute of the given structure. More... | |
int | SBase_unsetModelHistory (SBase_t *sb) |
Unsets the ModelHistory_t of the given SBase_t structure. More... | |
int | SBase_unsetName (SBase_t *sb) |
Unsets the "name" attribute of the given structure. More... | |
int | SBase_unsetNotes (SBase_t *sb) |
Unsets the "notes" subelement of the given structure. More... | |
int | SBase_unsetSBOTerm (SBase_t *sb) |
Unsets the "sboTerm" attribute of the given structure. More... | |
int | SBase_unsetUserData (SBase_t *sb) |
Unsets the user data of this node. More... | |
Adds a copy of the given CVTerm_t to this SBML structure.
Adds a copy of the given CVTerm_t to this SBML structure creating a new bBag element with the same identifier.
Appends the annotation for the given SBML structure.
sb | the given SBML structure. |
annotation | the XMLNode_t structure representing the annotation. |
int SBase_appendAnnotationString | ( | SBase_t * | sb, |
const char * | annotation | ||
) |
Appends the annotation for the given SBML structure.
sb | the given SBML structure. |
annotation | the string representing the annotation. |
Appends the notes for the given SBML structure.
sb | the given SBML structure. |
notes | the XMLNode_t structure representing the notes. |
int SBase_appendNotesString | ( | SBase_t * | sb, |
const char * | notes | ||
) |
Appends the notes for the given SBML structure.
sb | the given SBML structure. |
notes | the string representing the notes. |
Returns a List_t of all child SBase_t structures contained in SBML package plug-ins.
This method walks down the list of all SBML Level 3 packages used by this structure and returns all child structures defined by those packages.
sb | the SBase_t structure in question. |
Returns the ancestor SBase_t structure of the given SBase_t structure that corresponds to the given type.
This function allows any structure to determine its exact location/function within a model. For example a StoichiometryMath_t structure has ancestors of type SpeciesReference_t, ListOf_t(Products/Reactants), Reaction_t, ListOfReactions_t and Model_t; any of which can be accessed via this function.
sb | the SBase_t structure. |
type | the typecode (int) of the structure to be returned. |
pkgName | the name of the package that defines the type . |
Returns the annotation from given SBML structure.
sb | the given SBML structure. |
char * SBase_getAnnotationString | ( | SBase_t * | sb | ) |
Returns the annotation string from given SBML structure.
The string is owned by the caller and should be freed (with free()) when no longer needed.
sb | the given SBML structure. |
unsigned int SBase_getColumn | ( | const SBase_t * | sb | ) |
Returns the column number on which the given structure first appears in the XML representation of the SBML document, or 0
if the object was created, not read from a file.
sb | the SBase_t structure. |
0
if no such value.Returns a list of CVTerm_t structures in the annotations of this SBML structure.
sb | the structure to getCVTerms from. |
Returns the first child element it can find with a specific "metaid" attribute value, or NULL
if no such structure is found.
ID
, the XML identifier type, which means each "metaid" value must be globally unique within an SBML file. The latter point is important, because the uniqueness criterion applies across any attribute with type ID
anywhere in the file, 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 the XML ID
type. Although SBML itself specifies the use of XML ID
only for the "metaid" attribute, SBML-compatible applications 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. Finally, note that LibSBML does not provide an explicit XML ID
data type; it uses ordinary character strings, which is easier for applications to support.sb | the SBase_t structure in question. |
metaid | string representing the "metaid" attribute value of the structure to find. |
Returns the first child element found that has the given id
in the model-wide SId
namespace, or NULL
if no such structure is found.
sb | the SBase_t structure in question. |
id | string representing the "id" attribute value of the structure to find. |
Returns the first child element it can find with the given metaid
from all plug-ins associated with this element, or NULL
if no such structure is found.
sb | the SBase_t structure in question. |
metaid | string representing the metaid of structures to find. |
metaid
. Returns the first child element found that has the given id
in the model-wide SId namespace from all plug-ins associated with this element, or NULL
if no such structure is found.
sb | the SBase_t structure in question. |
id | string representing the id of structures to find. |
id
. const char * SBase_getElementName | ( | const SBase_t * | sb | ) |
Returns the XML element name of the given structure.
This is overridden by subclasses to return a string appropriate to the SBML component. For example, Model_t defines it as returning "model", CompartmentType_t defines it as returning "compartmentType", etc.
sb | the SBase_t structure. |
const char * SBase_getIdAttribute | ( | SBase_t * | sb | ) |
unsigned int SBase_getLevel | ( | const SBase_t * | sb | ) |
Returns the SBML Level of the overall SBML document.
sb | the SBase_t structure to query. |
unsigned int SBase_getLine | ( | const SBase_t * | sb | ) |
Returns the line number on which the given structure first appears in the XML representation of the SBML document, or 0
if the object was created, not read from a file.
sb | the SBase_t structure. |
0
if no such value.const char * SBase_getMetaId | ( | SBase_t * | sb | ) |
Returns the value of the "metaid" attribute of the given SBase_t structure.
sb | the SBase_t structure. |
sb
ModelHistory_t * SBase_getModelHistory | ( | SBase_t * | sb | ) |
Returns the ModelHistory_t of the given SBase_t structure.
sb | the SBase_t structure. |
const char * SBase_getName | ( | SBase_t * | sb | ) |
Returns the notes from given SBML structure.
sb | the given SBML structure. |
char * SBase_getNotesString | ( | SBase_t * | sb | ) |
Returns the notes string from given SBML structure.
The string is owned by the caller and should be freed (with free()) when no longer needed.
sb | the given SBML structure. |
unsigned int SBase_getNumCVTerms | ( | SBase_t * | sb | ) |
Returns the number of CVTerm_t structures in the annotations of this SBML structure.
sb | the structure to getCVTerms from. |
int SBase_getNumPlugins | ( | SBase_t * | sb | ) |
Returns the number of plug-in structures (extenstion interfaces) for SBML Level 3 package extensions known.
sb | the SBase_t structure to query. |
char * SBase_getPackageName | ( | const SBaseExtensionPoint_t * | sb | ) |
SBasePlugin_t * SBase_getPlugin | ( | SBase_t * | sb, |
const char * | package | ||
) |
Returns a plug-in structure (extension interface) for an SBML Level 3 package extension with the given package name or URI.
The returned plug-in will be the appropriate type of plugin requested: calling SBase_getPlugin(model, "fbc") will return an FbcModelPlugin_t; calling SBase_getPlugin(parameter, "comp") will return CompSBasePlugin_t, etc.
If no such plugin exists, NULL is returned.
sb | the SBase_t structure. |
package | the name or URI of the package. |
BiolQualifierType_t SBase_getResourceBiologicalQualifier | ( | SBase_t * | sb, |
const char * | resource | ||
) |
Returns the Biological Qualifier associated with this resource, BQB_UNKNOWN if the resource does not exist.
sb | the structure to query. |
resource | string representing the resource; e.g., "http://www.geneontology.org/#GO:0005892" . |
ModelQualifierType_t SBase_getResourceModelQualifier | ( | SBase_t * | sb, |
const char * | resource | ||
) |
Returns the Model_t Qualifier associated with this resource, BQM_UNKNOWN if the resource does not exist.
sb | the structure to query. |
resource | string representing the resource; e.g., "http://www.geneontology.org/#GO:0005892" . |
const SBMLDocument_t * SBase_getSBMLDocument | ( | SBase_t * | sb | ) |
Returns the parent SBMLDocument_t structure of the given SBase_t structure.
sb | the SBase_t structure. |
int SBase_getSBOTerm | ( | const SBase_t * | sb | ) |
Returns the integer portion of the value of the "sboTerm" attribute of the given SBase_t structure.
int
, and SBO_t identifiers are stored simply as integers. sb | the SBase_t structure. |
-1
if the value is not set. char * SBase_getSBOTermAsURL | ( | const SBase_t * | sb | ) |
Returns the identifiers.org URL representation of the "sboTerm" attribute of this structure.
http://identifiers.org/biomodels.sbo/SBO_t:NNNNNNN
, or NULL
if the value is not set. char * SBase_getSBOTermID | ( | const SBase_t * | sb | ) |
Returns the string representation of the "sboTerm" attribute of this structure.
int
, and SBO_t identifiers are stored simply as integers. NULL
if the value is not set. int SBase_getTypeCode | ( | const SBase_t * | sb | ) |
Returns the libSBML type code for this structure.
This method MAY return the typecode of this SBML structure or it MAY return SBML_UNKNOWN. That is, subclasses of SBase_t 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.
sb | the SBase_t structure. |
void * SBase_getUserData | ( | const SBase_t * | sb | ) |
Returns the user data that has been previously set by setUserData().
sb | the SBase_t structure in question. |
unsigned int SBase_getVersion | ( | const SBase_t * | sb | ) |
Returns the Version within the SBML Level of the overall SBML document.
sb | the SBase_t structure to query. |
int SBase_hasValidLevelVersionNamespaceCombination | ( | SBase_t * | sb | ) |
Predicate returning 1
(true) or 0
(false) depending on whether the structure's level/version and namespace values correspond to a valid SBML specification.
The valid combinations of SBML Level, Version and Namespace as of this release of libSBML are the following:
sb | the SBase_t structure. |
1
(true) if the level, version and namespace values of this SBML structure correspond to a valid set of values, 0
(false) otherwise. int SBase_isSetAnnotation | ( | const SBase_t * | sb | ) |
Predicate returning 1
(true) or 0
(false) depending on whether the given structure's "annotation" subelement is set.
sb | the SBase_t structure to query. |
1
(true) if the "annotation" subelement of this SBML structure is set, 0
(false) otherwise. int SBase_isSetIdAttribute | ( | const SBase_t * | sb | ) |
Predicate returning 1
(true) or 0
(false) depending on whether the given structure's "id" attribute is set.
sb | the SBase_t structure to query |
1
(true) if the "id" attribute of this SBML structure is set, 0
(false) otherwise. int SBase_isSetMetaId | ( | const SBase_t * | sb | ) |
Predicate returning 1
(true) or 0
(false) depending on whether the given structure's "metaid" attribute is set.
sb | the SBase_t structure to query. |
1
(true) if the "metaid" attribute of this SBML structure is set, 0
(false) otherwise. int SBase_isSetModelHistory | ( | SBase_t * | sb | ) |
Predicate for testing whether the ModelHistory_t of a given SBase_t structure is assigned.
sb | the SBase_t structure. |
1
(true) if the ModelHistory_t of this SBase_t structure is set, 0
(false) otherwise. int SBase_isSetName | ( | const SBase_t * | sb | ) |
Predicate returning 1
(true) or 0
(false) depending on whether the given structure's "name" attribute is set.
sb | the SBase_t structure to query |
1
(true) if the "name" attribute of this SBML structure is set, 0
(false) otherwise. int SBase_isSetNotes | ( | const SBase_t * | sb | ) |
Predicate returning 1
(true) or 0
(false) depending on whether the given structure's "notes" subelement is set.
sb | the SBase_t structure to query. |
1
(true) if the "notes" subelement of this SBML structure is set, 0
(false) otherwise. int SBase_isSetSBOTerm | ( | const SBase_t * | sb | ) |
Predicate returning 1
(true) or 0
(false) depending on whether the given structure's "sboTerm" attribute is set.
sb | the SBase_t structure to query. |
1
(true) if the "sboTerm" attribute of this SBML structure is set, 0
(false) otherwise. int SBase_isSetUserData | ( | const SBase_t * | sb | ) |
Predicate returning 1
(true) or 0
(false) depending on whether the structure's user data object has been set.
sb | defines the node of which the user data should be queried. |
1
(true) if the user data object of this SBML structure has been set, 0
(false) otherwise. int SBase_removeTopLevelAnnotationElement | ( | SBase_t * | sb, |
const char * | name | ||
) |
Removes the top-level element within the "annotation" subelement of this SBML structure with the given name.
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.
Calling this method allows a particular annotation element to be removed whilst the remaining annotations remain intact.
sb | SBase_t structure containing the annotation to be altered. |
name | a string representing the name of the top level annotation element that is to be removed. |
int SBase_removeTopLevelAnnotationElementWithURI | ( | SBase_t * | sb, |
const char * | name, | ||
const char * | uri | ||
) |
Removes the top-level element within the "annotation" subelement of this SBML structure with the given name and URI.
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.
Calling this method allows a particular annotation element to be removed whilst the remaining annotations remain intact.
sb | SBase_t structure containing the annotation to be altered. |
name | a string representing the name of the top level annotation element that is to be removed. |
uri | a string that is used to check both the name and URI of the top level element to be removed. |
void SBase_renameMetaIdRefs | ( | SBase_t * | sb, |
const char * | oldid, | ||
const char * | newid | ||
) |
Renames all the meta-identifier attributes on this element.
ID
; the SBML object attribute itself is typically named metaid
. All attributes that hold values referring to values of type ID
are of the XML data type IDREF
. They are also sometimes informally referred to as "metaid refs", in analogy to the SBML-defined type SIdRef
.This method works by looking at all meta-identifier attribute values, comparing the identifiers to the value of oldid
. If any matches are found, the matching identifiers are replaced with newid
. The method does not descend into child elements.
sb | the SBase_t structure in question. |
oldid | the old identifier. |
newid | the new identifier. |
void SBase_renameSIdRefs | ( | SBase_t * | sb, |
const char * | oldid, | ||
const char * | newid | ||
) |
Renames all the SIdRef
attributes on this element, including any found in MathML content (if such exists).
In SBML, object identifiers are of a data type called SId
. In SBML Level 3, an explicit data type called SIdRef
was introduced for attribute values that refer to SId
values; in previous Levels of SBML, this data type did not exist and attributes were simply described to as "referring to an identifier", but the effective data type was the same as SIdRef
in Level 3. These and other methods of libSBML refer to the type SIdRef
for all Levels of SBML, even if the corresponding SBML specification did not explicitly name the data type.
This method works by looking at all attributes and (if appropriate) mathematical formulas, comparing the identifiers to the value of oldid
. If any matches are found, the matching identifiers are replaced with newid
. The method does not descend into child elements.
sb | the SBase_t structure in question. |
oldid | the old identifier. |
newid | the new identifier. |
void SBase_renameUnitSIdRefs | ( | SBase_t * | sb, |
const char * | oldid, | ||
const char * | newid | ||
) |
Renames all the UnitSIdRef
attributes on this element.
UnitSId
. In SBML Level 3, an explicit data type called UnitSIdRef
was introduced for attribute values that refer to UnitSId
values; in previous Levels of SBML, this data type did not exist and attributes were simply described to as "referring to a unit identifier", but the effective data type was the same as UnitSIdRef
in Level 3. These and other methods of libSBML refer to the type UnitSIdRef
for all Levels of SBML, even if the corresponding SBML specification did not explicitly name the data type.This method works by looking at all unit identifier attribute values (including, if appropriate, inside mathematical formulas), comparing the unit identifiers to the value of oldid
. If any matches are found, the matching identifiers are replaced with newid
. The method does not descend into child elements.
sb | the SBase_t structure in question. |
oldid | the old identifier. |
newid | the new identifier. |
Replaces the given top-level element within the "annotation" subelement of this SBML structure and with the annotation element supplied.
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.
This method determines the name of the element to be replaced from the annotation argument. Functionally it is equivalent to calling SBase_removeTopLevelAnnotationElement(sb, name); SBase_appendAnnotation(sb, annotation_with_name);
with the exception that the placement of the annotation element remains the same.
sb | SBase_t structure containing the annotation to be altered. |
annotation | XMLNode_t representing the replacement top level annotation. |
int SBase_replaceTopLevelAnnotationElementString | ( | SBase_t * | sb, |
const char * | annotation | ||
) |
Replaces the given top-level element within the "annotation" subelement of this SBML structure and with the annotation element supplied.
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.
This method determines the name of the element to be replaced from the annotation argument. Functionally it is equivalent to calling SBase_removeTopLevelAnnotationElement(sb, name); SBase_appendAnnotation(sb, annotation_with_name);
with the exception that the placement of the annotation element remains the same.
sb | SBase_t structure containing the annotation to be altered. |
annotation | string representing the replacement top level annotation. |
Sets the annotation for the given SBML structure.
sb | the given SBML structure. |
annotation | the XMLNode_t structure representing the annotation. |
int SBase_setAnnotationString | ( | SBase_t * | sb, |
const char * | annotation | ||
) |
Sets the annotation for the given SBML structure.
sb | the given SBML structure. |
annotation | the string representing the annotation. |
int SBase_setIdAttribute | ( | SBase_t * | sb, |
const char * | id | ||
) |
Sets the value of the "id" attribute of the given structure.
The string id
is copied. The value of metaid
must be an identifier conforming to the syntax defined by SBML.
sb | the SBase_t structure |
id | the identifier string to use as the value of the "metaid" attribute |
int SBase_setMetaId | ( | SBase_t * | sb, |
const char * | metaid | ||
) |
Sets the value of the "metaid" attribute of the given structure.
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_t. 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.
sb | the SBase_t structure. |
metaid | the identifier string to use as the value of the "metaid" attribute. |
int SBase_setModelHistory | ( | SBase_t * | sb, |
ModelHistory_t * | history | ||
) |
Set the ModelHistory_t of the given SBase_t structure.
sb | the SBase_t structure. |
history | the ModelHistory_t structure. |
int SBase_setName | ( | SBase_t * | sb, |
const char * | name | ||
) |
Sets the value of the "name" attribute of the given structure.
The string name
is copied.
sb | the SBase_t structure |
name | the string to use as the value of the "name" attribute |
int SBase_setNamespaces | ( | SBase_t * | sb, |
XMLNamespaces_t * | xmlns | ||
) |
Sets the namespaces relevant of this SBML structure.
sb | the SBase_t structure. |
xmlns | the namespaces to set. |
Sets the notes for the given SBML structure.
sb | the given SBML structure. |
notes | the XMLNode_t structure representing the notes. |
int SBase_setNotesString | ( | SBase_t * | sb, |
const char * | notes | ||
) |
Sets the notes for the given SBML structure.
sb | the given SBML structure. |
notes | the string representing the notes. |
int SBase_setNotesStringAddMarkup | ( | SBase_t * | sb, |
const char * | notes | ||
) |
Sets the notes for the given SBML structure.
sb | the given SBML structure. |
notes | the string representing the notes. |
int SBase_setSBOTerm | ( | SBase_t * | sb, |
int | value | ||
) |
Sets the value of the "sboTerm" attribute.
int
, and SBO_t identifiers are stored simply as integers. int SBase_setSBOTermID | ( | SBase_t * | sb, |
const char * | sboid | ||
) |
Sets the value of the "sboTerm" attribute by string.
int
, and SBO_t identifiers are stored simply as integers. int SBase_setUserData | ( | SBase_t * | sb, |
void * | userData | ||
) |
Sets the user data of this node.
This can be used by the application developer to attach custom information to the node. In case of a deep copy this attribute will passed as it is. The attribute will be never interpreted by this class.
sb | defines the node of which the user data should be set. |
userData | specifies the new user data. |
int SBase_unsetAnnotation | ( | SBase_t * | sb | ) |
Unsets the "annotation" subelement of the given structure.
sb | the SBase_t structure. |
int SBase_unsetCVTerms | ( | SBase_t * | sb | ) |
Clears the list of CVTerm_t's of this SBML structure.
sb | the structure to clear CVTerm_t's from. |
int SBase_unsetIdAttribute | ( | SBase_t * | sb | ) |
Unsets the "id" attribute of the given structure.
sb | the SBase_t structure |
int SBase_unsetMetaId | ( | SBase_t * | sb | ) |
Unsets the "metaid" attribute of the given structure.
sb | the SBase_t structure. |
int SBase_unsetModelHistory | ( | SBase_t * | sb | ) |
Unsets the ModelHistory_t of the given SBase_t structure.
sb | the SBase_t structure. |
int SBase_unsetName | ( | SBase_t * | sb | ) |
Unsets the "name" attribute of the given structure.
sb | the SBase_t structure |
int SBase_unsetNotes | ( | SBase_t * | sb | ) |
Unsets the "notes" subelement of the given structure.
sb | the SBase_t structure. |
int SBase_unsetSBOTerm | ( | SBase_t * | sb | ) |
Unsets the "sboTerm" attribute of the given structure.
sb | the SBase_t structure. |
int SBase_unsetUserData | ( | SBase_t * | sb | ) |
Unsets the user data of this node.
sb | defines the node of which the user data should be unset. |