# Towards Agent Organizations Interoperability: A Model Driven Engineering Approach
## 5 Integration Method Application
### First Iteration  
The representation of AGR and STEAM as Ecore/OCL metamodels is shown in Figure 6. Below, on the left side, we have the AGR metamodel; on the right side, the STEAM metamodel (both restricted to the structural dimension). Above, mediating the alignment of the metamodels, we see the conceptual pattern of Section 4.2. In the alignment, the _organizational structure_ of AGR and the _organization hierarchy_ of STEAM are identified as similar specifications. The concepts of _group_ (AGR) and _subteam_ (STEAM) are declared similar concepts, both identified with the general concept of _group definition_. The same happens with the concepts of _role_ (AGR) and _role_ (STEAM), both identified with the general concept of _role definition_. Intuitively, when we take into account only the terms used, these basic correspondences between AGR and STEAM are reasonable. However, when we look more closely to the specific relationships among the concepts, it is possible to see that there is a stronger coupling between _subteam_ and _role_ in STEAM than the one that exists between the correspondent concepts of _group_ and _role_ in AGR. In STEAM, the notion of _role_ is abstract, being materialized both in the specification of activities for groups of agents as a whole and in the specification of activities for individual agents (_individual role_). This notion is represented in the metamodel as an abstract class STEAM::**Role** with two  
Figure 6: Alignment between AGR and STEAM. concrete subtypes STEAM::SubTeam and STEAM::IndividualRole. As a consequence, every instance of STEAM::SubTeam besides corresponding to a _group definition_ is also a kind of _role definition_. This coupling between the concepts of _group_ and _role definitions_ is absent in AGR and is not foreseen in the structural pattern of Section 4.2. To easy the merging of these different views regarding the nature of the concepts, one possibility is to interpret the generalization relation between STEAM::SubTeam and STEAM::Role as a composition relationship, similar to the application of the \"replace inheritance with delegation\" refactoring, as proposed in [50]. When this is done we posit a derived reference from STEAM::SubTeam to STEAM::Role named subRoleDef. This derived reference when used in the place of the original generalization decouples the concepts of _group definition_ and _role definition_ while permitting to represent the same information in a slightly different way. In Figure 6 there are two other derived references: roleDef and subGroup; both extracted from the original reference role between STEAM::SubTeam and STEAM::Role. The rationale for these is to make explicit that, in reality, not only _role definitions_ but also _group definitions_ can be associated with a _subteam_ via the reference role. Once these derived references become explicit, we can do a more fine grained matching between the STEAM metamodel and the corresponding abstract concepts of _group_ and _role definition_. Ending the comparison between the metamodels, we note that in AGR the _group definitions_ cannot be decomposed into _sub groups_ and there is the concept of _role relation_ materialized as _role constraints_ (_dependencies_ and _correspondences_). In STEAM, there is no explicit _role relations_ and no explicit _role cardinality_. In the case of _individual role_ there is an implicit cardinality of _min=1_ and _max=1_. Finally, concluding the iteration, we merge the metamodels taking into account the correspondences identified. The resultant integrated metamodel \(MM_{\#1}^{int}\) is shown in Figure 7, where we retain the terminology of the abstract structural pattern of Section 4.2. See online version for colors. The elements added to the structural pattern from the specific metamodels are depicted in blue. The elements marked in red in the STEAM metamodel (Figure 6) are not included in the integrated metamodel, being replaced by derived references aforementioned.