libSBML C API  5.18.0
ExternalModelDefinition_t Class Reference

Detailed Description

comp A reference to an externally-defined model.

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.

Public Member Functions

ExternalModelDefinition_tExternalModelDefinition_clone (ExternalModelDefinition_t *emd)
 Returns a copy of the given ExternalModelDefinition_t structure. More...
 
ExternalModelDefinition_tExternalModelDefinition_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. More...
 
void ExternalModelDefinition_free (ExternalModelDefinition_t *emd)
 Frees the given ExternalModelDefinition_t structure. More...
 
char * ExternalModelDefinition_getId (ExternalModelDefinition_t *emd)
 Takes an ExternalModelDefinition_t structure and returns its identifier. More...
 
char * ExternalModelDefinition_getModelRef (ExternalModelDefinition_t *emd)
 Takes a ExternalModelDefinition_t structure and returns its modelRef. More...
 
char * ExternalModelDefinition_getName (ExternalModelDefinition_t *emd)
 Takes a ExternalModelDefinition_t structure and returns its name. More...
 
char * ExternalModelDefinition_getSource (ExternalModelDefinition_t *emd)
 Takes a ExternalModelDefinition_t structure and returns its source. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
int ExternalModelDefinition_setId (ExternalModelDefinition_t *emd, const char *sid)
 Assigns the identifier of an ExternalModelDefinition_t structure. More...
 
int ExternalModelDefinition_setModelRef (ExternalModelDefinition_t *emd, const char *modelRef)
 Sets the modelRef of the given ExternalModelDefinition_t to a copy of modelRef. More...
 
int ExternalModelDefinition_setName (ExternalModelDefinition_t *emd, const char *name)
 Sets the name of the given ExternalModelDefinition_t to a copy of name. More...
 
int ExternalModelDefinition_setSource (ExternalModelDefinition_t *emd, const char *source)
 Sets the source of the given ExternalModelDefinition_t to a copy of source. More...
 
int ExternalModelDefinition_unsetId (ExternalModelDefinition_t *emd)
 Unsets the "id" attribute of the given ExternalModelDefinition_t structure. More...
 
int ExternalModelDefinition_unsetModelRef (ExternalModelDefinition_t *emd)
 Unsets the "modelRef" attribute of the given ExternalModelDefinition_t structure. More...
 
int ExternalModelDefinition_unsetName (ExternalModelDefinition_t *emd)
 Unsets the "name" attribute of the given ExternalModelDefinition_t structure. More...
 
int ExternalModelDefinition_unsetSource (ExternalModelDefinition_t *emd)
 Unsets the "source" attribute of the given ExternalModelDefinition_t structure. More...
 

Member Function Documentation

ExternalModelDefinition_t * ExternalModelDefinition_clone ( ExternalModelDefinition_t emd)

Returns a copy of the given ExternalModelDefinition_t structure.

Parameters
emdthe ExternalModelDefinition_t structure to copy.
Returns
a (deep) copy of the ExternalModelDefinition_t.
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.

Parameters
levelan unsigned int, the SBML Level to assign to this ExternalModelDefinition_t.
versionan unsigned int, the SBML Version to assign to this ExternalModelDefinition_t.
pkgVersionan unsigned int, the SBML 'comp' package Version to assign to this ExternalModelDefinition_t.
Returns
a pointer to the newly created ExternalModelDefinition_t structure.
void ExternalModelDefinition_free ( ExternalModelDefinition_t emd)

Frees the given ExternalModelDefinition_t structure.

Parameters
emdthe ExternalModelDefinition_t structure to free.
char * ExternalModelDefinition_getId ( ExternalModelDefinition_t emd)

Takes an ExternalModelDefinition_t structure and returns its identifier.

Parameters
emdthe ExternalModelDefinition_t structure whose identifier is sought.
Returns
the identifier of the given ExternalModelDefinition_t, as a pointer to a string.
char * ExternalModelDefinition_getModelRef ( ExternalModelDefinition_t emd)

Takes a ExternalModelDefinition_t structure and returns its modelRef.

Parameters
emdthe ExternalModelDefinition_t whose modelRef is sought.
Returns
the modelRef of the given ExternalModelDefinition_t, as a pointer to a string.
char * ExternalModelDefinition_getName ( ExternalModelDefinition_t emd)

Takes a ExternalModelDefinition_t structure and returns its name.

Parameters
emdthe ExternalModelDefinition_t whose name is sought.
Returns
the name of the given ExternalModelDefinition_t, as a pointer to a string.
char * ExternalModelDefinition_getSource ( ExternalModelDefinition_t emd)

Takes a ExternalModelDefinition_t structure and returns its source.

Parameters
emdthe ExternalModelDefinition_t whose source is sought.
Returns
the source of the given ExternalModelDefinition_t, as a pointer to a string.
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.

Note
The required attributes for a ExternalModelDefinition_t structure are:
  • id
  • source
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.

Parameters
emdthe ExternalModelDefinition_t structure to query.
Returns
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.

Parameters
emdthe ExternalModelDefinition_t structure to query.
Returns
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.

Parameters
emdthe ExternalModelDefinition_t structure to query.
Returns
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.

Parameters
emdthe ExternalModelDefinition_t structure to query.
Returns
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.

Parameters
emdthe ExternalModelDefinition_t structure to set.
sidthe string to use as the 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:
Note
Using this function with an 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.

Parameters
emdthe ExternalModelDefinition_t structure to set.
modelRefthe modelRef to assign to the given ExternalModelDefinition_t's "modelRef" 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:
Note
Using this function with the name set to NULL is equivalent to unsetting the "modelRef" attribute.
int ExternalModelDefinition_setName ( ExternalModelDefinition_t emd,
const char *  name 
)

Sets the name of the given ExternalModelDefinition_t to a copy of name.

Parameters
emdthe ExternalModelDefinition_t structure to set.
namethe name to assign to the given ExternalModelDefinition_t's "name" 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:
Note
Using this function with the name set to NULL is equivalent to unsetting the "name" attribute.
int ExternalModelDefinition_setSource ( ExternalModelDefinition_t emd,
const char *  source 
)

Sets the source of the given ExternalModelDefinition_t to a copy of source.

Parameters
emdthe ExternalModelDefinition_t structure to set.
sourcethe source to assign to the given ExternalModelDefinition_t's "source" 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:
Note
Using this function with the name set to NULL is equivalent to unsetting the "source" attribute.
int ExternalModelDefinition_unsetId ( ExternalModelDefinition_t emd)

Unsets the "id" attribute of the given ExternalModelDefinition_t structure.

Parameters
emdthe ExternalModelDefinition_t structure to unset.
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:
int ExternalModelDefinition_unsetModelRef ( ExternalModelDefinition_t emd)

Unsets the "modelRef" attribute of the given ExternalModelDefinition_t structure.

Parameters
emdthe ExternalModelDefinition_t structure to unset.
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:
int ExternalModelDefinition_unsetName ( ExternalModelDefinition_t emd)

Unsets the "name" attribute of the given ExternalModelDefinition_t structure.

Parameters
emdthe ExternalModelDefinition_t structure to unset.
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:
int ExternalModelDefinition_unsetSource ( ExternalModelDefinition_t emd)

Unsets the "source" attribute of the given ExternalModelDefinition_t structure.

Parameters
emdthe ExternalModelDefinition_t structure to unset.
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: