comp
Implementation of the SBaseRef construct from the 'comp' package.
The SBaseRef class was introduced by the SBML Level 3 Hierarchical Model Composition package ('comp') as the principle way by which submodel elements may be referenced. The SBaseRef class is usually found as a subclass of a Port, Deletion, ReplacedElement, or ReplacedBy class, but may appear as an child of one of the above classes if the parent object references a Submodel.
An SBaseRef object must reference an element using exactly one of the optional attributes of the class. Subclasses of SBaseRef may define additional optional attributes that are legal ways to reference an element.
SBaseRef objects may reference elements that do not live in the Model parent of the SBaseRef object. However, the SBaseRef class itself does not provide a method of determining which Model or Submodel is being referenced. The subclasses of SBaseRef provide methods for this instead.
Once the Model to which the SBaseRef object is referencing has been established, there are four optional attributes defined in the SBaseRef class that are each methods of referencing an element:
- "portRef" (type PortSIdRef): As its name implies, this attribute is used to refer to a port identifier, in the case when the reference being constructed with the SBaseRef is intended to refer to a port on a submodel. The namespace of the PortSIdRef value is the set of identifiers of type PortSId defined in the submodel, not the parent model.
- "idRef" (type SIdRef): As its name implies, this attribute is used to refer to a regular identifier (i.e., the value of an "id" attribute on some other object), in the case when the reference being constructed with the SBaseRef is intended to refer to an object that does not have a port identifier. The namespace of the SIdRef value is the set of identifiers of type SId defined in the submodel, not the parent model.
- "unitRef" (type UnitSIdRef): This attribute is used to refer to the identifier of a UnitDefinition object. The namespace of the UnitSIdRef value is the set of unit identifiers defined in the submodel, not the parent model. (Note that even though this attribute is of type UnitSIdRef, the reserved unit identifiers that are defined by SBML Level 3 (see Section 3.1.10 of the core specification) are *not* permitted as values of "unitRef". Reserved unit identifiers may not be replaced or deleted.)
- "metaIdRef" (type IDREF): This attribute is used to refer to a "metaid" attribute value on some other object, in the case when the reference being constructed with the SBaseRef is intended to refer to an object that does not have a port identifier. The namespace of the "metaIdRef" value is the entire document in which the referenced model resides, but must refer to a subelement of the referenced model. Since meta identifiers are optional attributes of SBase, all SBML objects have the potential to have a meta identifier value.
An SBaseRef object may have up to one subcomponent named "sBaseRef", of type SBaseRef. This permits recursive structures to be constructed so that objects inside submodels can be referenced.
The form of such recursive references must be as follows. The highest-level SBaseRef object of such a chain (which will necessarily be an object of class Port, Deletion, ReplacedElement or ReplacedBy, because they are the only classes derived from the class SBaseRef) must refer to a Submodel object in the containing model. All child SBaseRef objects in the chain must refer to components inside the Model instance to which the Submodel refers.