libSBML Python API  5.11.0
libsbml.ExternalModelDefinition Class Reference
Inheritance diagram for libsbml.ExternalModelDefinition:
[legend]

Detailed Description

comp A reference to an externally-defined model.

The ExternalModelDefinition class was introduced by the SBML Level 3 Hierarchical Model Composition package (“comp”) to define references to Model objects defined in other files.

ExternalModelDefinition objects are model definitions—in and of themselves, they are definitions of models but not uses of those models. The class provides a way to declare and identify them so that Model objects in the present SBML document can use them in Submodel objects.

ExternalModelDefinition contains two required attributes ('source' and 'id') and three optional attributes ('modelRef', 'md5' and 'name').

The 'id' attribute serves to provide a handle for the external model reference so that Submodel objects can refer to it. Crucially, it is not the identifier of the model being referenced; rather, it is an identifier for this ExternalModelDefinition object within the current SBML document. The 'id' attribute takes a required value of type SId, and must be unique across all Model and ExternalModelDefinition objects present in the document.

ExternalModelDefinition also has an optional 'name' attribute, of type 'string'. The 'name' attribute may be used to provide a human-readable description of the ExternalModelDefintion object.

The required attribute 'source' is used to locate the SBML document containing an external model definition. The value of this attribute must be of type anyURI. Since URIs may be either URLs, URNs, or relative or absolute file locations, this offers flexibility in referencing SBML documents. In all cases, the 'source' attribute value must refer specifically to an SBML Level 3 Version 1 document; prior Levels/Versions of SBML are not supported by this package. The entire file at the given location is referenced. The 'source' attribute must have a value for every ExternalModelDefinition instance.

ExternalModelDefinition's optional attribute 'modelRef', of type SIdRef, is used to identify a Model or ExternalModelDefinition object within the SBML document located at 'source'. The object referenced may be the main model in the document, or it may be a model definition contained in the SBML document's ListOfModelDefinitions or ListOfExternalModelDefinitions lists. Loops are not allowed: it must be possible to follow a chain of ExternalModelDefinition objects to its end in a Model object.

In core SBML, the 'id' on Model is an optional attribute, and therefore, it is possible that the Model object in a given SBML document does not have an identifier. In that case, there is no value to give to the 'modelRef' attribute in ExternalModelDefinition. If 'modelRef' does not have a value, then the main model (i.e., the <model> element within the <sbml> element) in the referenced file is interpreted as being the model referenced by this ExternalModelDefinition instance.

Finally, the optional 'md5' attribute takes a string value. If set, it must be an MD5 checksum value computed over the document referenced by 'source'. This checksum can serve as a data integrity check over the contents of the 'source'. Applications may use this to verify that the contents have not changed since the time that the ExternalModelDefinition reference was constructed.

Public Member Functions

def __init__ (self, args)
 comp A reference to an externally-defined model. More...
 
def clone (self)
 Creates and returns a deep copy of this ExternalModelDefinition object. More...
 
def getElementName (self)
 Returns the XML element name of this SBML object. More...
 
def getId (self)
 Returns the value of the 'id' attribute of this ExternalModelDefinition. More...
 
def getMd5 (self)
 Returns the value of the 'md5' attribute of this ExternalModelDefinition. More...
 
def getModelRef (self)
 Returns the value of the 'modelRef' attribute of this ExternalModelDefinition. More...
 
def getName (self)
 Returns the value of the 'name' attribute of this ExternalModelDefinition. More...
 
def getReferencedModel (self)
 
def getSource (self)
 Returns the value of the 'source' attribute of this ExternalModelDefinition. More...
 
def getTypeCode (self)
 Returns the libSBML type code of this object instance. More...
 
def hasRequiredAttributes (self)
 Returns true if the 'modelRef' and 'id' attributes are set, and false if not. More...
 
def isSetId (self)
 Predicate returning True or False depending on whether this object's 'id' attribute has been set. More...
 
def isSetMd5 (self)
 Predicate returning True or False depending on whether this ExternalModelDefinition's 'md5' attribute has been set. More...
 
def isSetModelRef (self)
 Predicate returning True or False depending on whether this ExternalModelDefinition's 'modelRef' attribute has been set. More...
 
def isSetName (self)
 Predicate returning True or False depending on whether this object's 'name' attribute has been set. More...
 
def isSetSource (self)
 Predicate returning True or False depending on whether this ExternalModelDefinition's 'source' attribute has been set. More...
 
def setId (self, id)
 Sets the value of the 'id' attribute of this ExternalModelDefinition. More...
 
def setMd5 (self, md5)
 Sets the value of the 'md5' attribute of this ExternalModelDefinition. More...
 
def setModelRef (self, id)
 Sets the value of the 'modelRef' attribute of this ExternalModelDefinition. More...
 
def setName (self, name)
 Sets the value of the 'name' attribute of this ExternalModelDefinition. More...
 
def setSource (self, source)
 Sets the value of the 'source' attribute of this ExternalModelDefinition. More...
 
def unsetId (self)
 Unsets the value of the 'id' attribute of this ExternalModelDefinition. More...
 
def unsetMd5 (self)
 Unsets the value of the 'md5' attribute of this ExternalModelDefinition. More...
 
def unsetModelRef (self)
 Unsets the value of the 'modelRef' attribute of this ExternalModelDefinition. More...
 
def unsetName (self)
 Unsets the value of the 'name' attribute of this ExternalModelDefinition. More...
 
def unsetSource (self)
 Unsets the value of the 'source' attribute of this ExternalModelDefinition. More...
 

Member Function Documentation

def libsbml.ExternalModelDefinition.clone (   self)

Creates and returns a deep copy of this ExternalModelDefinition object.

clone()   ExternalModelDefinition
Returns
a (deep) copy of this ExternalModelDefinition object
def libsbml.ExternalModelDefinition.getElementName (   self)

Returns the XML element name of this SBML object.

getElementName()   string
Returns
the name of this element, as a text string.
def libsbml.ExternalModelDefinition.getId (   self)

Returns the value of the 'id' attribute of this ExternalModelDefinition.

getId()   string
Returns
the name of this ExternalModelDefinition.
def libsbml.ExternalModelDefinition.getMd5 (   self)

Returns the value of the 'md5' attribute of this ExternalModelDefinition.

getMd5()   string
Returns
the value of the 'md5' attribute of this ExternalModelDefinition.
def libsbml.ExternalModelDefinition.getModelRef (   self)

Returns the value of the 'modelRef' attribute of this ExternalModelDefinition.

getModelRef()   string
Returns
the value of the 'modelRef' attribute of this ExternalModelDefinition.
def libsbml.ExternalModelDefinition.getName (   self)

Returns the value of the 'name' attribute of this ExternalModelDefinition.

getName()   string
Returns
the name of this ExternalModelDefinition.
def libsbml.ExternalModelDefinition.getReferencedModel (   self)
getReferencedModel()   Model
def libsbml.ExternalModelDefinition.getSource (   self)

Returns the value of the 'source' attribute of this ExternalModelDefinition.

getSource()   string
Returns
the value of the 'source' attribute of this ExternalModelDefinition.
def libsbml.ExternalModelDefinition.getTypeCode (   self)

Returns the libSBML type code of this object instance.

getTypeCode()   int
LibSBML attaches an identifying code to every kind of SBML object. These are integer constants known as SBML type codes. The names of all the codes begin with the characters SBML_. In the Python language interface for libSBML, the type codes are defined as static integer constants in the interface class libsbml. Note that different Level 3 package plug-ins may use overlapping type codes; to identify the package to which a given object belongs, call the getPackageName() method on the object.
Returns
the SBML type code for this object: SBML_COMP_EXTERNALMODELDEFINITION
Warning
The specific integer values of the possible type codes may be reused by different Level 3 package plug-ins. Thus, to identifiy the correct code, it is necessary to invoke both getTypeCode() and getPackageName().
See also
getElementName()
getPackageName()
def libsbml.ExternalModelDefinition.hasRequiredAttributes (   self)

Returns true if the 'modelRef' and 'id' attributes are set, and false if not.

hasRequiredAttributes()   bool

This method does not check to see if the referred-to model actually exists.

Returns
boolean: True if the attributes are correctly set; False if not.
def libsbml.ExternalModelDefinition.isSetId (   self)

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

isSetId()   bool
Some words of explanation about the set/unset/isSet methods: The SBML specifications define certain attributes on some classes of objects as being optional. This requires an application to be careful about the distinction between two cases when reading a model: (1) a given attribute has never been set to a value, and therefore should be assumed to have the SBML-defined default value if one exists, and (2) a given attribute has been set to a value, but the value happens to be an empty string. The situation can be ambiguous when reading a model from a file or data stream and then examining the data objects that libSBML constructs as a result. 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 object has been set, False otherwise.
def libsbml.ExternalModelDefinition.isSetMd5 (   self)

Predicate returning True or False depending on whether this ExternalModelDefinition's 'md5' attribute has been set.

isSetMd5()   bool
Returns
True if this ExternalModelDefinition's 'md5' attribute has been set, otherwise False is returned.
def libsbml.ExternalModelDefinition.isSetModelRef (   self)

Predicate returning True or False depending on whether this ExternalModelDefinition's 'modelRef' attribute has been set.

isSetModelRef()   bool
Returns
True if this ExternalModelDefinition's 'modelRef' attribute has been set, otherwise False is returned.
def libsbml.ExternalModelDefinition.isSetName (   self)

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

isSetName()   bool
Some words of explanation about the set/unset/isSet methods: The SBML specifications define certain attributes on some classes of objects as being optional. This requires an application to be careful about the distinction between two cases when reading a model: (1) a given attribute has never been set to a value, and therefore should be assumed to have the SBML-defined default value if one exists, and (2) a given attribute has been set to a value, but the value happens to be an empty string. The situation can be ambiguous when reading a model from a file or data stream and then examining the data objects that libSBML constructs as a result. 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 object has been set, False otherwise.
def libsbml.ExternalModelDefinition.isSetSource (   self)

Predicate returning True or False depending on whether this ExternalModelDefinition's 'source' attribute has been set.

isSetSource()   bool
Returns
True if this ExternalModelDefinition's 'source' attribute has been set, otherwise False is returned.
def libsbml.ExternalModelDefinition.setId (   self,
  id 
)

Sets the value of the 'id' attribute of this ExternalModelDefinition.

setId(string id)   int

This method fails if the id is not a valid syntax for an SId.

Parameters
idthe identifier to use
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
def libsbml.ExternalModelDefinition.setMd5 (   self,
  md5 
)

Sets the value of the 'md5' attribute of this ExternalModelDefinition.

setMd5(string md5)   int
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
def libsbml.ExternalModelDefinition.setModelRef (   self,
  id 
)

Sets the value of the 'modelRef' attribute of this ExternalModelDefinition.

setModelRef(string id)   int

Fails if the id is not a valid syntax for an SIdRef.

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
def libsbml.ExternalModelDefinition.setName (   self,
  name 
)

Sets the value of the 'name' attribute of this ExternalModelDefinition.

setName(string name)   int

The string in name is copied.

Parameters
namethe new name for the ExternalModelDefinition
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
def libsbml.ExternalModelDefinition.setSource (   self,
  source 
)

Sets the value of the 'source' attribute of this ExternalModelDefinition.

setSource(string source)   int
Parameters
sourcethe value to use for the 'source' attribute.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
def libsbml.ExternalModelDefinition.unsetId (   self)

Unsets the value of the 'id' attribute of this ExternalModelDefinition.

unsetId()   int
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
def libsbml.ExternalModelDefinition.unsetMd5 (   self)

Unsets the value of the 'md5' attribute of this ExternalModelDefinition.

unsetMd5()   int
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
def libsbml.ExternalModelDefinition.unsetModelRef (   self)

Unsets the value of the 'modelRef' attribute of this ExternalModelDefinition.

unsetModelRef()   int
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
def libsbml.ExternalModelDefinition.unsetName (   self)

Unsets the value of the 'name' attribute of this ExternalModelDefinition.

unsetName()   int
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
def libsbml.ExternalModelDefinition.unsetSource (   self)

Unsets the value of the 'source' attribute of this ExternalModelDefinition.

unsetSource()   int
Returns
integer value indicating success/failure of the function. The possible values returned by this function are: