libSBML C API
5.18.0
|
The ExternalModelDefinition_t class was introduced by the SBML Level 3 Hierarchical Model_t Composition (“comp”) package to define references to Model_t objects defined in other files.
ExternalModelDefinition_t 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_t objects in the present SBML document can use them in Submodel_t objects.
ExternalModelDefinition_t 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_t objects can refer to it. Crucially, it is not the identifier of the model being referenced; rather, it is an identifier for this ExternalModelDefinition_t object within the current SBML document. The "id" attribute takes a required value of type SId, and must be unique across all Model_t and ExternalModelDefinition_t objects present in the document.
ExternalModelDefinition_t 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 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_t instance.
It should be noted that even though there is currently only a Hierarchical Model Composition package for SBML Level 3 Version 1, it may be used in SBML Level 3 Version 2, as long as nothing new from that package is used. This allows the ExternalModelDefinition_t to reference any SBML Level 3 document, so long as only constructs from Version 1 are used.
ExternalModelDefinition_t's optional attribute "modelRef", of type SIdRef, is used to identify a Model_t or ExternalModelDefinition_t 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_t or ListOfExternalModelDefinitions_t lists. Loops are not allowed: it must be possible to follow a chain of ExternalModelDefinition_t objects to its end in a Model_t object.
In core SBML, the "id" on Model_t is an optional attribute, and therefore, it is possible that the Model_t 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_t. 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_t 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_t reference was constructed.
ExternalModelDefinition_t * ExternalModelDefinition_clone | ( | ExternalModelDefinition_t * | emd | ) |
Returns a copy of the given ExternalModelDefinition_t structure.
emd | the ExternalModelDefinition_t structure to copy. |
ExternalModelDefinition_t * ExternalModelDefinition_create | ( | unsigned int | level, |
unsigned int | version, | ||
unsigned int | pkgVersion | ||
) |
Creates a new ExternalModelDefinition_t structure using the given SBML level
and version
, and the pkgVersion
package version.
level | an unsigned int, the SBML Level to assign to this ExternalModelDefinition_t. |
version | an unsigned int, the SBML Version to assign to this ExternalModelDefinition_t. |
pkgVersion | an unsigned int, the SBML 'comp' package Version to assign to this ExternalModelDefinition_t. |
void ExternalModelDefinition_free | ( | ExternalModelDefinition_t * | emd | ) |
Frees the given ExternalModelDefinition_t structure.
emd | the ExternalModelDefinition_t structure to free. |
char * ExternalModelDefinition_getId | ( | ExternalModelDefinition_t * | emd | ) |
Takes an ExternalModelDefinition_t structure and returns its identifier.
emd | the ExternalModelDefinition_t structure whose identifier is sought. |
char * ExternalModelDefinition_getModelRef | ( | ExternalModelDefinition_t * | emd | ) |
Takes a ExternalModelDefinition_t structure and returns its modelRef.
emd | the ExternalModelDefinition_t whose modelRef is sought. |
char * ExternalModelDefinition_getName | ( | ExternalModelDefinition_t * | emd | ) |
Takes a ExternalModelDefinition_t structure and returns its name.
emd | the ExternalModelDefinition_t whose name is sought. |
char * ExternalModelDefinition_getSource | ( | ExternalModelDefinition_t * | emd | ) |
Takes a ExternalModelDefinition_t structure and returns its source.
emd | the ExternalModelDefinition_t whose source is sought. |
int ExternalModelDefinition_hasRequiredAttributes | ( | ExternalModelDefinition_t * | emd | ) |
Predicate returning 1
(true) or 0
(false) depending on whether all the required attributes for the given ExternalModelDefinition_t structure have been set.
int ExternalModelDefinition_isSetId | ( | ExternalModelDefinition_t * | emd | ) |
Predicate returning 1
(true) or 0
(false) depending on whether the given ExternalModelDefinition_t structure's identifier is set.
emd | the ExternalModelDefinition_t structure to query. |
1
(true) if the "id" attribute of the given ExternalModelDefinition_t structure is set, 0
(false) otherwise. int ExternalModelDefinition_isSetModelRef | ( | ExternalModelDefinition_t * | emd | ) |
Predicate returning 1
(true) or 0
(false) depending on whether the given ExternalModelDefinition_t structure's modelRef is set.
emd | the ExternalModelDefinition_t structure to query. |
1
(true) if the "modelRef" attribute of the given ExternalModelDefinition_t structure is set, 0
(false) otherwise. int ExternalModelDefinition_isSetName | ( | ExternalModelDefinition_t * | emd | ) |
Predicate returning 1
(true) or 0
(false) depending on whether the given ExternalModelDefinition_t structure's name is set.
emd | the ExternalModelDefinition_t structure to query. |
1
(true) if the "name" attribute of the given ExternalModelDefinition_t structure is set, 0
(false) otherwise. int ExternalModelDefinition_isSetSource | ( | ExternalModelDefinition_t * | emd | ) |
Predicate returning 1
(true) or 0
(false) depending on whether the given ExternalModelDefinition_t structure's source is set.
emd | the ExternalModelDefinition_t structure to query. |
1
(true) if the "source" attribute of the given ExternalModelDefinition_t structure is set, 0
(false) otherwise. int ExternalModelDefinition_setId | ( | ExternalModelDefinition_t * | emd, |
const char * | sid | ||
) |
Assigns the identifier of an ExternalModelDefinition_t structure.
This makes a copy of the string passed in the parameter sid
.
emd | the ExternalModelDefinition_t structure to set. |
sid | the string to use as the identifier. |
sid
of NULL is equivalent to unsetting the "id" attribute. int ExternalModelDefinition_setModelRef | ( | ExternalModelDefinition_t * | emd, |
const char * | modelRef | ||
) |
Sets the modelRef of the given ExternalModelDefinition_t to a copy of modelRef
.
emd | the ExternalModelDefinition_t structure to set. |
modelRef | the modelRef to assign to the given ExternalModelDefinition_t's "modelRef" attribute. |
int ExternalModelDefinition_setName | ( | ExternalModelDefinition_t * | emd, |
const char * | name | ||
) |
Sets the name of the given ExternalModelDefinition_t to a copy of name
.
emd | the ExternalModelDefinition_t structure to set. |
name | the name to assign to the given ExternalModelDefinition_t's "name" attribute. |
int ExternalModelDefinition_setSource | ( | ExternalModelDefinition_t * | emd, |
const char * | source | ||
) |
Sets the source of the given ExternalModelDefinition_t to a copy of source
.
emd | the ExternalModelDefinition_t structure to set. |
source | the source to assign to the given ExternalModelDefinition_t's "source" attribute. |
int ExternalModelDefinition_unsetId | ( | ExternalModelDefinition_t * | emd | ) |
Unsets the "id" attribute of the given ExternalModelDefinition_t structure.
emd | the ExternalModelDefinition_t structure to unset. |
int ExternalModelDefinition_unsetModelRef | ( | ExternalModelDefinition_t * | emd | ) |
Unsets the "modelRef" attribute of the given ExternalModelDefinition_t structure.
emd | the ExternalModelDefinition_t structure to unset. |
int ExternalModelDefinition_unsetName | ( | ExternalModelDefinition_t * | emd | ) |
Unsets the "name" attribute of the given ExternalModelDefinition_t structure.
emd | the ExternalModelDefinition_t structure to unset. |
int ExternalModelDefinition_unsetSource | ( | ExternalModelDefinition_t * | emd | ) |
Unsets the "source" attribute of the given ExternalModelDefinition_t structure.
emd | the ExternalModelDefinition_t structure to unset. |