ReplacedBy¶
The element of a submodel which takes the place of the element carrying it.
A replaced by turns a replacement around: the element which carries it disappears and the element of the submodel it names stays, so that every reference to the element of the containing model points into the submodel afterwards. It is how a model declares a placeholder which one of its parts fills in.
An element carries at most one replaced by, and it names the element which replaces it the same four ways a deletion does, by port, identifier, unit identifier or meta id, with a nested reference for an element which sits deeper.
The report shows the replacement in the inspector of the element, links the submodel and the element inside it, and shows the replacement as an element of its own.
Attributes¶
| attribute | type | required | meaning | specification |
|---|---|---|---|---|
| submodelRef | SIdRef |
required | the submodel which holds the replacing element | comp 3.6.4 |
| portRef | PortSIdRef |
optional | the port of the submodel whose element takes the place of this element | comp 3.7.1 |
| idRef | SIdRef |
optional | the element which replaces this element, by its identifier | comp 3.7.1 |
| unitRef | UnitSIdRef |
optional | the unit definition which replaces this unit definition | comp 3.7.1 |
| metaIdRef | IDREF |
optional | the element which replaces this element, by its meta id | comp 3.7.1 |
| sBaseRef | SBaseRef |
optional | the reference which reaches into a submodel of the named submodel | comp 3.7.2 |
Every element of a model also carries the common attributes of SBase.
submodelRef
The reference names a submodel of the model which carries the replacement. It is required, and the other references are resolved in the model that submodel instantiates.
1010308(error): The value of a 'comp:submodelRef' attribute on <replacedElement> and <replacedBy> objects must always conform to the syntax of the SBML data type SId.1021104(error): The value of a 'comp:submodelRef' attribute on a <replacedBy> object must be the identifier of a <submodel> present in the <replacedBy> object's parent Model.
portRef
The replacement names a port of the model the submodel instantiates, and the element behind that port is the one which stays.
1020701(error): The value of a 'comp:portRef' attribute on an <sBaseRef> object must be the identifier of a <port> object in the <model> referenced by that <sBaseRef>.1020706(error): The value of a 'comp:portRef' attribute on an SBaseRef object must always conform to the syntax of the SBML data type SId.1021101(error): A <replacedBy> object must point to another object; that is, a <replacedBy> object must always have a value for one of the attributes 'comp:portRef', 'comp:idRef', 'comp:unitRef' or 'comp:metaIdRef'.1021102(error): A <replacedBy> object can only point to one other object; that is, a given <replacedBy> object can only have a value for one of the attributes 'comp:portRef', 'comp:idRef', 'comp:unitRef', or 'comp:metaIdRef'.
idRef
The identifier is resolved in the model the named submodel instantiates.
1020702(error): The value of a 'comp:idRef' attribute on an <sBaseRef> object must be the identifier of an object contained in (that is, within the SId namespace of) the <model> referenced by that <sBaseRef>. This includes objects with 'id' attributes defined in packages other than SBML Level 3 Core or the Hierarchical Model Composition package.1020707(error): The value of a 'comp:idRef' attribute on an SBaseRef object must always conform to the syntax of the SBML data type SId.1021101(error): A <replacedBy> object must point to another object; that is, a <replacedBy> object must always have a value for one of the attributes 'comp:portRef', 'comp:idRef', 'comp:unitRef' or 'comp:metaIdRef'.1021102(error): A <replacedBy> object can only point to one other object; that is, a given <replacedBy> object can only have a value for one of the attributes 'comp:portRef', 'comp:idRef', 'comp:unitRef', or 'comp:metaIdRef'.
unitRef
Unit identifiers live in a namespace of their own. The units which SBML reserves cannot replace anything.
1020703(error): The value of a 'comp:unitRef' attribute on an <sBaseRef> object must be the identifier of a <unitDefinition< object contained in the <model> referenced by that <sBaseRef>.1020708(error): The value of a 'comp:unitRef' attribute on an SBaseRef object must always conform to the syntax of the SBML data type SId.1021101(error): A <replacedBy> object must point to another object; that is, a <replacedBy> object must always have a value for one of the attributes 'comp:portRef', 'comp:idRef', 'comp:unitRef' or 'comp:metaIdRef'.1021102(error): A <replacedBy> object can only point to one other object; that is, a given <replacedBy> object can only have a value for one of the attributes 'comp:portRef', 'comp:idRef', 'comp:unitRef', or 'comp:metaIdRef'.
metaIdRef
This is the way to name a replacing element which carries no identifier of its own.
1020704(error): The value of a 'comp:metaIdRef' attribute on an <sBaseRef> object must be the value of a 'comp:metaid' attribute on an element contained in the <model> referenced by that <sBaseRef>.1020709(error): The value of a 'comp:metaIdRef' attribute on an SBaseRef object must always conform to the syntax of the XML data type ID.1021101(error): A <replacedBy> object must point to another object; that is, a <replacedBy> object must always have a value for one of the attributes 'comp:portRef', 'comp:idRef', 'comp:unitRef' or 'comp:metaIdRef'.1021102(error): A <replacedBy> object can only point to one other object; that is, a given <replacedBy> object can only have a value for one of the attributes 'comp:portRef', 'comp:idRef', 'comp:unitRef', or 'comp:metaIdRef'.
sBaseRef
A replacement which names a submodel of the instantiated model carries a nested reference which names the element inside it, so that an element of a sub-submodel takes the place of this element.
1020705(error): If an <sBaseRef> object contains an <sBaseRef> child, the parent <sBaseRef> must point to a <submodel> object, or a <port> that itself points to a <submodel> object.1020710(error): Apart from the general notes and annotation subobjects permitted on all SBML objects, an SBaseRef object may only contain a single <sBaseRef> child.1020711(warning): The 'sbaseRef' spelling of an SBaseRef child of an SBaseRef object is considered deprecated, and 'sBaseRef' should be used instead.
Validation rules¶
1010501(warning): If one element replaces another, whether it is the target of a <replacedBy> element, or whether it has a child <replacedElement>, the units of the replaced element, multiplied by the units of any applicable conversion factor, should equal the units of the replacement element.1020710(error): Apart from the general notes and annotation subobjects permitted on all SBML objects, an SBaseRef object may only contain a single <sBaseRef> child.1020714(error): Any one SBML object may only be referenced in one of the following ways: referenced by a single <port> object; referenced by a single <deletion> object; referenced by a single <replacedElement>; be the parent of a single <replacedBy> child; be referenced by one or more <replacedBy> objects; or be referenced by one or more <replacedElement> objects all using the 'deletion' attribute. Essentially, once an object has been referenced in one of these ways it cannot be referenced again.1021103(error): A <replacedBy> object must have a value for the required attribute 'comp:submodelRef', and a value for one, and only one, of the following attributes: 'comp:portRef', 'comp:idRef', 'comp:unitRef' or 'comp:metaIdRef'. No other attributes from the HierarchicalModel Composition namespace are permitted on a <replacedBy> object.1021201(error): If one element replaces another, whether it is the target of a <replacedBy> element, or whether it has a child <replacedElement>, the SBML class of the replacement element must match the SBML class of the replaced element, with two exceptions: an element of a derived class may replace an object of its base class (for base classes other than SBase), and any SBML class with mathematical meaning may replace a <parameter>. A base class may not replace a derived class, however, nor may a <parameter> replace some other SBML element with mathematical meaning.1021202(error): If one element replaces another, whether it is the target of a <replacedBy> element, or whether it has a child <replacedElement>, if the replaced element has the 'id' attribute set, the replacement !element must also have the 'id' attribute set.1021203(error): If one element replaces another, whether it is the target of a <replacedBy> element, or whether it has a child <replacedElement>, if the replaced element has the 'metaid' attribute set, the replacement element must also have the 'metaid' attribute set.1021204(error): If one element replaces another, whether it is the target of a <replacedBy> element, or whether it has a child <replacedElement>, if the replaced element has an identifier attribute from some other SBML package set, the replacement element must also have that same identifier attribute set.
Related elements¶
- Submodel: the instantiation of another model inside this model
- ReplacedElement: an element of a submodel which the element carrying it takes the place of
- Hierarchical Model Composition (comp): the package which builds a model out of other models
Specification¶
SBML Level 3 Package: Hierarchical Model Composition, Version 1 Release 3, Section 3.6.4 (Smith et al. 2015, J Integr Bioinform 12(2):268).