SBase.cpp File Reference

Detailed Description

Implementation of SBase, the base object of all SBML objects.

Author:
Ben Bornstein
Include dependency graph for SBase.cpp:

Functions

int SBase_addCVTerm (SBase_t *sb, CVTerm_t *term)
 Adds a copy of the given CVTerm to this SBML object.
int SBase_addCVTermNewBag (SBase_t *sb, CVTerm_t *term)
 Adds a copy of the given CVTerm to this SBML object creating a new bBag element with the same identifier.
int SBase_appendAnnotation (SBase_t *sb, XMLNode_t *annotation)
 Appends the annotation for the given SBML object.
int SBase_appendAnnotationString (SBase_t *sb, char *annotation)
 Appends the annotation for the given SBML object.
int SBase_appendNotes (SBase_t *sb, XMLNode_t *notes)
 Appends the notes for the given SBML object.
int SBase_appendNotesString (SBase_t *sb, char *notes)
 Appends the notes for the given SBML object.
List_t * SBase_getAllElements (SBase_t *sb)
List_t * SBase_getAllElementsFromPlugins (SBase_t *sb)
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.
XMLNode_t * SBase_getAnnotation (SBase_t *sb)
 Returns the annotation from given SBML object.
char * SBase_getAnnotationString (SBase_t *sb)
 Returns the annotation string from given SBML object.
unsigned int SBase_getColumn (const SBase_t *sb)
 Returns the column number on which the given object first appears in the XML representation of the SBML document.
CVTerm_t * SBase_getCVTerm (SBase_t *sb, unsigned int n)
 Returns the nth CVTerm in the list of CVTerms of this SBML object.
List_t * SBase_getCVTerms (SBase_t *sb)
 Returns a list of CVTerm objects in the annotations of this SBML object.
SBase_t * SBase_getElementByMetaId (SBase_t *sb, const char *metaid)
SBase_t * SBase_getElementBySId (SBase_t *sb, const char *id)
SBase_t * SBase_getElementFromPluginsByMetaId (SBase_t *sb, const char *metaid)
SBase_t * SBase_getElementFromPluginsBySId (SBase_t *sb, const char *id)
const char * SBase_getElementName (const SBase_t *sb)
 Returns the XML element name of the given structure.
unsigned int SBase_getLevel (const SBase_t *sb)
 Returns the SBML Level of the overall SBML document.
unsigned int SBase_getLine (const SBase_t *sb)
 Returns the line number on which the given object first appears in the XML representation of the SBML document.
const char * SBase_getMetaId (SBase_t *sb)
 Returns the value of the "metaid" attribute of the given SBase_t structure.
const Model_t * SBase_getModel (const SBase_t *sb)
 Returns the Model_t structure in which the given instance is located.
ModelHistory_t * SBase_getModelHistory (SBase_t *sb)
 Returns the ModelHistory of the given SBase_t structure.
XMLNode_t * SBase_getNotes (SBase_t *sb)
 Returns the notes from given SBML object.
char * SBase_getNotesString (SBase_t *sb)
 Returns the notes string from given SBML object.
unsigned int SBase_getNumCVTerms (SBase_t *sb)
 Returns the number of CVTerm objects in the annotations of this SBML object.
int SBase_getNumPlugins (SBase_t *sb)
const SBase_t * SBase_getParentSBMLObject (SBase_t *sb)
 Returns the parent SBase_t structure of the given SBase_t structure.
SBasePlugin_t * SBase_getPlugin (SBase_t *sb, const char *package)
BiolQualifierType_t SBase_getResourceBiologicalQualifier (SBase_t *sb, const char *resource)
 Returns the BiologicalQualifier associated with this resource, BQB_UNKNOWN if the resource does not exist.
ModelQualifierType_t SBase_getResourceModelQualifier (SBase_t *sb, const char *resource)
 Returns the ModelQualifier associated with this resource, BQM_UNKNOWN if the resource does not exist.
const SBMLDocument_t * SBase_getSBMLDocument (SBase_t *sb)
 Returns the value of the "id" attribute of the given 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.
char * SBase_getSBOTermID (const SBase_t *sb)
 Returns the string representation of the "sboTerm" attribute of this object.
int SBase_getTypeCode (const SBase_t *sb)
 Returns the libSBML type code for this object.
void * SBase_getUserData (SBase_t *sb)
 Returns the user data that has been previously set by setUserData().
unsigned int SBase_getVersion (const SBase_t *sb)
 Returns the Version within the SBML Level of the overall SBML document.
int SBase_hasValidLevelVersionNamespaceCombination (SBase_t *sb)
 Predicate returning nonzero true or false depending on whether the object's level/version and namespace values correspond to a valid SBML specification.
int SBase_isSetAnnotation (const SBase_t *sb)
 Predicate returning nonzero true or false depending on whether the given structure's "annotation" subelement is set.
int SBase_isSetMetaId (const SBase_t *sb)
 Predicate returning nonzero true or false depending on whether the given structure's "metaid" attribute is set.
int SBase_isSetModelHistory (SBase_t *sb)
 Predicate for testing whether the ModelHistory of a given SBase_t structure is assigned.
int SBase_isSetNotes (const SBase_t *sb)
 Predicate returning nonzero true or false depending on whether the given structure's "id" attribute is set.
int SBase_isSetSBOTerm (const SBase_t *sb)
 Predicate returning nonzero true or false depending on whether the given structure's "sboTerm" attribute is set.
void SBase_renameMetaIdRefs (SBase_t *sb, const char *oldid, const char *newid)
void SBase_renameSIdRefs (SBase_t *sb, const char *oldid, const char *newid)
void SBase_renameUnitSIdRefs (SBase_t *sb, const char *oldid, const char *newid)
int SBase_setAnnotation (SBase_t *sb, XMLNode_t *annotation)
 Sets the annotation for the given SBML object.
int SBase_setAnnotationString (SBase_t *sb, char *annotation)
 Sets the annotation for the given SBML object.
int SBase_setMetaId (SBase_t *sb, const char *metaid)
 Sets the value of the "metaid" attribute of the given object.
int SBase_setModelHistory (SBase_t *sb, ModelHistory_t *history)
 Set the ModelHistory of the given SBase_t structure.
int SBase_setNamespaces (SBase_t *sb, XMLNamespaces_t *xmlns)
 Sets the namespaces relevant of this SBML object.
int SBase_setNotes (SBase_t *sb, XMLNode_t *notes)
 Sets the notes for the given SBML object.
int SBase_setNotesString (SBase_t *sb, char *notes)
 Sets the notes for the given SBML object.
int SBase_setSBOTerm (SBase_t *sb, int value)
 Sets the value of the "id" attribute of this SBML object.
int SBase_setSBOTermID (SBase_t *sb, const char *sboid)
int SBase_setUserData (SBase_t *sb, void *userData)
 Sets the user data of this node.
int SBase_unsetAnnotation (SBase_t *sb)
 Unsets the "annotation" subelement of the given object.
int SBase_unsetCVTerms (SBase_t *sb)
 Clears the list of CVTerms of this SBML object.
int SBase_unsetId (SBase_t *sb)
int SBase_unsetMetaId (SBase_t *sb)
 Unsets the "metaid" attribute of the given object.
int SBase_unsetModelHistory (SBase_t *sb)
 Unsets the ModelHistory of the given SBase_t structure.
int SBase_unsetNotes (SBase_t *sb)
 Unsets the "name" attribute of the given object.
int SBase_unsetSBOTerm (SBase_t *sb)
 Unsets the "sboTerm" attribute of the given object.

Function Documentation

int SBase_addCVTerm ( SBase_t *  sb,
CVTerm_t *  term 
)

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

Parameters:
sbthe object to add the CVTerm to
termthe CVTerm_t to assign
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_OPERATION_FAILED
  • LIBSBML_UNEXPECTED_ATTRIBUTE
  • LIBSBML_INVALID_OBJECT
Note:
The annotation constructed from a CVTerm uses the metaid of the object to identify it. Adding a CVTerm to an object where the 'metaId' attribute has not been set will fail with the return value LIBSBML_UNEXPECTED_ATTRIBUTE.
int SBase_addCVTermNewBag ( SBase_t *  sb,
CVTerm_t *  term 
)

Adds a copy of the given CVTerm to this SBML object creating a new bBag element with the same identifier.

Parameters:
sbthe object to add the CVTerm to
termthe CVTerm_t to assign
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_OPERATION_FAILED
  • LIBSBML_UNEXPECTED_ATTRIBUTE
  • LIBSBML_INVALID_OBJECT
Note:
The annotation constructed from a CVTerm uses the metaid of the object to identify it. Adding a CVTerm to an object where the 'metaId' attribute has not been set will fail with the return value LIBSBML_UNEXPECTED_ATTRIBUTE.
int SBase_appendAnnotation ( SBase_t *  sb,
XMLNode_t *  annotation 
)

Appends the annotation for the given SBML object.

Parameters:
sbthe given SBML object.
annotationthe XMLNode_t structure respresenting the annotation.
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_OPERATION_FAILED
int SBase_appendAnnotationString ( SBase_t *  sb,
char *  annotation 
)

Appends the annotation for the given SBML object.

Parameters:
sbthe given SBML object.
annotationthe string (const char*) respresenting the annotation.
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_OPERATION_FAILED
int SBase_appendNotes ( SBase_t *  sb,
XMLNode_t *  notes 
)

Appends the notes for the given SBML object.

Parameters:
sbthe given SBML object.
notesthe XMLNode_t structure respresenting the notes.
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_OBJECT
  • LIBSBML_OPERATION_FAILED
int SBase_appendNotesString ( SBase_t *  sb,
char *  notes 
)

Appends the notes for the given SBML object.

Parameters:
sbthe given SBML object.
notesthe string (const char*) respresenting the notes.
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_OBJECT
  • LIBSBML_OPERATION_FAILED
List_t* SBase_getAllElements ( SBase_t *  sb)
List_t* SBase_getAllElementsFromPlugins ( SBase_t *  sb)
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.

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

Parameters:
sbthe SBase_t structure
typethe typecode (int) of the structure to be returned
Returns:
the ancestor SBase_t structure of this SBML object with the corresponding typecode (int), NULL if there is no ancestor of this type.
XMLNode_t* SBase_getAnnotation ( SBase_t *  sb)

Returns the annotation from given SBML object.

Parameters:
sbthe given SBML object.
Returns:
the XMLNode_t structure representing the annotation from this object.
char* SBase_getAnnotationString ( SBase_t *  sb)

Returns the annotation string from given SBML object.

The string is owned by the caller and should be freed (with free()) when no longer needed.

Parameters:
sbthe given SBML object.
Returns:
the string (char*) representing the annotation from this object.
unsigned int SBase_getColumn ( const SBase_t *  sb)

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

Parameters:
sbthe SBase_t structure
Returns:
the column number of this SBML object.
See also:
getLine().
CVTerm_t* SBase_getCVTerm ( SBase_t *  sb,
unsigned int  n 
)

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

Parameters:
sbthe object to getCVTerms from
nunsigned int the index of the CVTerm to retrieve
Returns:
the nth CVTerm in the list of CVTerms for this SBML object.
List_t* SBase_getCVTerms ( SBase_t *  sb)

Returns a list of CVTerm objects in the annotations of this SBML object.

Parameters:
sbthe object to getCVTerms from
Returns:
the list of CVTerms for this SBML object.
SBase_t* SBase_getElementByMetaId ( SBase_t *  sb,
const char *  metaid 
)
SBase_t* SBase_getElementBySId ( SBase_t *  sb,
const char *  id 
)
SBase_t* SBase_getElementFromPluginsByMetaId ( SBase_t *  sb,
const char *  metaid 
)
SBase_t* SBase_getElementFromPluginsBySId ( SBase_t *  sb,
const char *  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 defines it as returning "model", CompartmentType defines it as returning "compartmentType", etc.

Parameters:
sbthe SBase_t structure
unsigned int SBase_getLevel ( const SBase_t *  sb)

Returns the SBML Level of the overall SBML document.

Parameters:
sbthe SBase_t structure to query
Returns:
the SBML level of the given object.
See also:
getVersion()
unsigned int SBase_getLine ( const SBase_t *  sb)

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

Parameters:
sbthe SBase_t structure
Returns:
the line number of the given structure
See also:
getColumn().
const char* SBase_getMetaId ( SBase_t *  sb)

Returns the value of the "metaid" attribute of the given SBase_t structure.

Parameters:
sbthe SBase_t structure
Returns:
the value of the "metaid" attribute of sb
const Model_t* SBase_getModel ( const SBase_t *  sb)

Returns the Model_t structure in which the given instance is located.

Parameters:
sbthe SBase_t structure
Returns:
the parent Model_t strucdture of the given object.
ModelHistory_t* SBase_getModelHistory ( SBase_t *  sb)

Returns the ModelHistory of the given SBase_t structure.

Returns:
the ModelHistory of the given SBase_t structure.
Parameters:
mthe SBase_t structure
XMLNode_t* SBase_getNotes ( SBase_t *  sb)

Returns the notes from given SBML object.

Parameters:
sbthe given SBML object.
Returns:
the XMLNode_t structure representing the notes from this object.
char* SBase_getNotesString ( SBase_t *  sb)

Returns the notes string from given SBML object.

The string is owned by the caller and should be freed (with free()) when no longer needed.

Parameters:
sbthe given SBML object.
Returns:
the string (char*) representing the notes from this object.
unsigned int SBase_getNumCVTerms ( SBase_t *  sb)

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

Parameters:
sbthe object to getCVTerms from
Returns:
the number of CVTerms for this SBML object.
int SBase_getNumPlugins ( SBase_t *  sb)
const SBase_t* SBase_getParentSBMLObject ( SBase_t *  sb)

Returns the parent SBase_t structure of the given SBase_t structure.

Parameters:
sbthe SBase_t structure
Returns:
the parent SBase of this SBML object.
SBasePlugin_t* SBase_getPlugin ( SBase_t *  sb,
const char *  package 
)
BiolQualifierType_t SBase_getResourceBiologicalQualifier ( SBase_t *  sb,
const char *  resource 
)

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

Parameters:
sbthe object to query
resourcestring representing the resource; e.g., "http://www.geneontology.org/#GO:0005892"
Returns:
the BiolQualifierType_t associated with the resource
ModelQualifierType_t SBase_getResourceModelQualifier ( SBase_t *  sb,
const char *  resource 
)

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

Parameters:
sbthe object to query
resourcestring representing the resource; e.g., "http://www.geneontology.org/#GO:0005892"
Returns:
the ModelQualifierType_t associated with the resource
const SBMLDocument_t* SBase_getSBMLDocument ( SBase_t *  sb)

Returns the value of the "id" attribute of the given SBase_t structure.

Parameters:
sbthe SBase_t structure
Returns:
the value of the "id" attribute of sb Returns the value of the "name" attribute of the given SBase_t structure.
Parameters:
sbthe SBase_t structure
Returns:
the value of the "name" attribute of sb Returns the parent SBMLDocument_t structure of the given SBase_t structure.
Parameters:
sbthe SBase_t structure
Returns:
the parent SBMLDocument of this SBML object.
int SBase_getSBOTerm ( const SBase_t *  sb)

Returns the integer portion of the value of the "sboTerm" attribute of the given SBase_t structure.

In SBML Level 2 Versions 2 and 3, 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_t 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_t 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.

Parameters:
sbthe SBase_t structure
Returns:
the value of the "sboTerm" attribute as an integer, or -1 if the value is not set.
char* SBase_getSBOTermID ( const SBase_t *  sb)

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 NULL if the value is not set.
int SBase_getTypeCode ( const SBase_t *  sb)

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.

Note:
In libSBML 5, the type of return value has been changed from typecode (int) to int. The return value is one of enum values defined for each package. For example, return values will be one of typecode (int) if this object is defined in SBML core package, return values will be one of SBMLLayoutTypeCode_t if this object is defined in Layout extension (i.e. similar enum types are defined in each pacakge extension for each SBase subclass) The value of each typecode can be duplicated between those of different packages. Thus, to distinguish the typecodes of different packages, not only the return value of getTypeCode() but also that of getPackageName() must be checked.
Parameters:
sbthe SBase_t structure
Returns:
the typecode (int value) of this SBML object or SBML_UNKNOWN (default).
See also:
getElementName()
getPackageName()
void* SBase_getUserData ( SBase_t *  sb)

Returns the user data that has been previously set by setUserData().

Parameters:
nodedefines the node of interest.
Returns:
the user data of this node. NULL if no user data has been.
See also:
SBase_setUserData
unsigned int SBase_getVersion ( const SBase_t *  sb)

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

Parameters:
sbthe SBase_t structure to query
Returns:
the SBML version of the given object.
See also:
getLevel()

Predicate returning nonzero true or false depending on whether the object'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:

  • Level 1 Version 2 "http://www.sbml.org/sbml/level1"
  • Level 2 Version 1 "http://www.sbml.org/sbml/level2"
  • Level 2 Version 2 "http://www.sbml.org/sbml/level2/version2"
  • Level 2 Version 3 "http://www.sbml.org/sbml/level2/version3"
  • Level 2 Version 4 "http://www.sbml.org/sbml/level2/version4"
Parameters:
sbthe SBase_t structure
Returns:
nonzero (true) if the level, version and namespace values of this SBML object correspond to a valid set of values, zero (false) otherwise.
int SBase_isSetAnnotation ( const SBase_t *  sb)

Predicate returning nonzero true or false depending on whether the given structure's "annotation" subelement is set.

Parameters:
sbthe SBase_t structure to query
Returns:
nonzero (for true) if the "annotation" subelement of this SBML object is set, zero (for false) otherwise.
int SBase_isSetMetaId ( const SBase_t *  sb)

Predicate returning nonzero true or false depending on whether the given structure's "metaid" attribute is set.

Parameters:
sbthe SBase_t structure to query
Returns:
nonzero (for true) if the "metaid" attribute of this SBML object is set, zero (for false) otherwise.
int SBase_isSetModelHistory ( SBase_t *  sb)

Predicate for testing whether the ModelHistory of a given SBase_t structure is assigned.

Parameters:
mthe SBase_t structure
Returns:
nonzero if the ModelHistory of this SBase_t structure is set, zero (0) otherwise.
int SBase_isSetNotes ( const SBase_t *  sb)

Predicate returning nonzero true or false depending on whether the given structure's "id" attribute is set.

Parameters:
sbthe SBase_t structure to query
Returns:
nonzero (for true) if the "id" attribute of this SBML object is set, zero (for false) otherwise. Predicate returning nonzero true or false depending on whether the given structure's "name" attribute is set.
Parameters:
sbthe SBase_t structure to query
Returns:
nonzero (for true) if the "name" attribute of this SBML object is set, zero (for false) otherwise. Predicate returning nonzero true or false depending on whether the given structure's "notes" subelement is set.
Parameters:
sbthe SBase_t structure to query
Returns:
nonzero (for true) if the "notes" subelement of this SBML object is set, zero (for false) otherwise.
int SBase_isSetSBOTerm ( const SBase_t *  sb)

Predicate returning nonzero true or false depending on whether the given structure's "sboTerm" attribute is set.

Parameters:
sbthe SBase_t structure to query
Returns:
nonzero (for true) if the "sboTerm" attribute of this SBML object is set, zero (for false) otherwise.
void SBase_renameMetaIdRefs ( SBase_t *  sb,
const char *  oldid,
const char *  newid 
)
void SBase_renameSIdRefs ( SBase_t *  sb,
const char *  oldid,
const char *  newid 
)
void SBase_renameUnitSIdRefs ( SBase_t *  sb,
const char *  oldid,
const char *  newid 
)
int SBase_setAnnotation ( SBase_t *  sb,
XMLNode_t *  annotation 
)

Sets the annotation for the given SBML object.

Parameters:
sbthe given SBML object.
annotationthe XMLNode_t structure respresenting the annotation.
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
int SBase_setAnnotationString ( SBase_t *  sb,
char *  annotation 
)

Sets the annotation for the given SBML object.

Parameters:
sbthe given SBML object.
annotationthe string (const char*) respresenting the annotation.
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_OPERATION_FAILED
int SBase_setMetaId ( SBase_t *  sb,
const char *  metaid 
)

Sets the value of the "metaid" attribute of the given 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.

Parameters:
sbthe SBase_t structure
metaidthe identifier string to use as the value of the "metaid" attribute
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_ATTRIBUTE_VALUE
  • LIBSBML_UNEXPECTED_ATTRIBUTE
Note:
Using this function with the metaid set to NULL is equivalent to unsetting the "metaid" attribute.
int SBase_setModelHistory ( SBase_t *  sb,
ModelHistory_t *  history 
)

Set the ModelHistory of the given SBase_t structure.

Parameters:
mthe SBase_t structure
historythe ModelHistory_t structure
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_OBJECT
int SBase_setNamespaces ( SBase_t *  sb,
XMLNamespaces_t *  xmlns 
)

Sets the namespaces relevant of this SBML object.

Parameters:
sbthe SBase_t structure
xmlnsthe namespaces to set
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
int SBase_setNotes ( SBase_t *  sb,
XMLNode_t *  notes 
)

Sets the notes for the given SBML object.

Parameters:
sbthe given SBML object.
notesthe XMLNode_t structure respresenting the notes.
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_OBJECT
int SBase_setNotesString ( SBase_t *  sb,
char *  notes 
)

Sets the notes for the given SBML object.

Parameters:
sbthe given SBML object.
notesthe string (const char*) respresenting the notes.
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_OBJECT
  • LIBSBML_OPERATION_FAILED
int SBase_setSBOTerm ( SBase_t *  sb,
int  value 
)

Sets the value of the "id" attribute of this SBML object.

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.

Parameters:
sbthe SBase_t structure
sidthe string to use as the identifier of this object
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
Note:
Using this function with an id of NULL is equivalent to unsetting the "id" attribute. Sets the value of the "name" attribute of this SBML object.

The string in name is copied.

Parameters:
sbthe SBase_t structure
namethe new name for the object
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
Note:
Using this function with the name set to NULL is equivalent to unsetting the "name" attribute. 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_t 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_t 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.

Parameters:
sbthe SBase_t structure
valuethe NNNNNNN integer portion of the SBO identifier
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_ATTRIBUTE_VALUE
  • LIBSBML_UNEXPECTED_ATTRIBUTE
int SBase_setSBOTermID ( SBase_t *  sb,
const char *  sboid 
)
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.

Parameters:
nodedefines the node of which the user data should be set.
userDataspecifies the new user data.
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_OPERATION_FAILED
  • LIBSBML_INVALID_OBJECT
int SBase_unsetAnnotation ( SBase_t *  sb)

Unsets the "annotation" subelement of the given object.

Parameters:
sbthe SBase_t structure
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
int SBase_unsetCVTerms ( SBase_t *  sb)

Clears the list of CVTerms of this SBML object.

Parameters:
sbthe object to clear CVTerms from
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_OPERATION_FAILED
int SBase_unsetId ( SBase_t *  sb)
int SBase_unsetMetaId ( SBase_t *  sb)

Unsets the "metaid" attribute of the given object.

Parameters:
sbthe SBase_t structure
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_OPERATION_FAILED
int SBase_unsetModelHistory ( SBase_t *  sb)

Unsets the ModelHistory of the given SBase_t structure.

Parameters:
mthe SBase_t structure
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_OPERATION_FAILED
int SBase_unsetNotes ( SBase_t *  sb)

Unsets the "name" attribute of the given object.

Parameters:
sbthe SBase_t structure
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
Parameters:
sbthe SBase_t structure
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
int SBase_unsetSBOTerm ( SBase_t *  sb)

Unsets the "sboTerm" attribute of the given object.

Parameters:
sbthe SBase_t structure
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_UNEXPECTED_ATTRIBUTE
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines