libSBML Python API
5.11.0
|
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... | |
def libsbml.ExternalModelDefinition.clone | ( | self | ) |
Creates and returns a deep copy of this ExternalModelDefinition object.
clone() ExternalModelDefinition
def libsbml.ExternalModelDefinition.getElementName | ( | self | ) |
Returns the XML element name of this SBML object.
getElementName() string
def libsbml.ExternalModelDefinition.getId | ( | self | ) |
Returns the value of the 'id' attribute of this ExternalModelDefinition.
getId() string
def libsbml.ExternalModelDefinition.getMd5 | ( | self | ) |
Returns the value of the 'md5' attribute of this ExternalModelDefinition.
getMd5() string
def libsbml.ExternalModelDefinition.getModelRef | ( | self | ) |
Returns the value of the 'modelRef' attribute of this ExternalModelDefinition.
getModelRef() string
def libsbml.ExternalModelDefinition.getName | ( | self | ) |
Returns the value of the 'name' attribute of this ExternalModelDefinition.
getName() string
def libsbml.ExternalModelDefinition.getReferencedModel | ( | self | ) |
getReferencedModel() Model
def libsbml.ExternalModelDefinition.getSource | ( | self | ) |
Returns the value of the 'source' attribute of this ExternalModelDefinition.
getSource() string
def libsbml.ExternalModelDefinition.getTypeCode | ( | self | ) |
Returns the libSBML type code of this object instance.
getTypeCode() int
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.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.
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 set
Attribute(...)
,
unset
Attribute()
, and
isSet
Attribute()
, where Attribute is the the name of the optional
attribute in question.
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
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
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 set
Attribute(...)
,
unset
Attribute()
, and
isSet
Attribute()
, where Attribute is the the name of the optional
attribute in question.
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
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.
id | the identifier to use |
def libsbml.ExternalModelDefinition.setMd5 | ( | self, | |
md5 | |||
) |
Sets the value of the 'md5' attribute of this ExternalModelDefinition.
setMd5(string md5) int
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.
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.
name | the new name for the ExternalModelDefinition |
def libsbml.ExternalModelDefinition.setSource | ( | self, | |
source | |||
) |
Sets the value of the 'source' attribute of this ExternalModelDefinition.
setSource(string source) int
source | the value to use for the 'source' attribute. |
def libsbml.ExternalModelDefinition.unsetId | ( | self | ) |
Unsets the value of the 'id' attribute of this ExternalModelDefinition.
unsetId() int
def libsbml.ExternalModelDefinition.unsetMd5 | ( | self | ) |
Unsets the value of the 'md5' attribute of this ExternalModelDefinition.
unsetMd5() int
def libsbml.ExternalModelDefinition.unsetModelRef | ( | self | ) |
Unsets the value of the 'modelRef' attribute of this ExternalModelDefinition.
unsetModelRef() int
def libsbml.ExternalModelDefinition.unsetName | ( | self | ) |
Unsets the value of the 'name' attribute of this ExternalModelDefinition.
unsetName() int
def libsbml.ExternalModelDefinition.unsetSource | ( | self | ) |
Unsets the value of the 'source' attribute of this ExternalModelDefinition.
unsetSource() int