# DTAG: A Methodology for Aggregating Digital Twins Using the WOTDT Ontology
## 4 DTw Aggregation Methodology
### Mappings Aggregation  
Mapping models allow us to represent the relationships between the data model in heterogeneous sources and an RDF version that follows the schema of an ontology; i.e., they define the rules on how to translate from non-RDF data into RDF [49]. The goal of the mappings aggregation activity is to perform an aggregation between two mapping models to obtain a single mapping model that follows the ontology obtained from the ontology aggregation activity and also contains all the transformation rules to materialise non-semantic data into semantic data (e.g., RDF). This activity involves the DTwA user performing the aggregation process and the domain experts providing information about the mapping rules that follow the ontology domain. The output of this activity is a mapping model resulting from the aggregation of the mapping models of the DTws involved in the aggregation process and its reference in the instantiation of the DTwA using WoTDT ontology. Sometimes, in contrast to previous aggregations, this aggregation may not be necessary. This is because instead of aggregating the mapping models for the subsequent materialisation of the knowledge graph of the DTw, the aggregation of the knowledge graphs belonging to the DTws involved in the aggregation process is done directly. In this way, the knowledge graphs will be aggregated, obtaining the DTwA knowledge graph (scenario 2 of Section \"Semantic Resources Aggregation\"), and in the case of extension, it will be enough for the domain experts and the DTwA user to create new mapping models containing the rules for the materialisation of the new information to be incorporated into the DTwA knowledge graph. Regardless of this case, in this section, the aggregation of the mapping activity will be performed. As mapping models are ontology-based, the same three scenarios explained earlier in the ontology model aggregation are of interest. In the first two scenarios, the mappings models do not have to be aligned/processed to make the aggregation because the ontologies are linked, and no alignment process has been performed in the ontology aggregation step. The difference is that instead of obtaining the data from a single data source, the mappings obtain it from two data sources, one from each DTw involved in the aggregation. Therefore, DTws mappings have to be referenced by DTwA instantiation using WoTDT ontology. Meanwhile, in the third scenario, a merging of these mapping models and an extension has to be performed, creating new rules in order to satisfy the newly created links between the ontologies obtained from the alignment process. In Figure 15, the workflow of this activity is presented depending on the particular aggregation scenario. Figure 14: DTwA ontology model reference instantiation result. In order to perform the merging process, when dealing with mapping models, there is no literature on how two mapping models should be merged. Therefore, a possible solution could be the use of the instance matching method since mapping models are mostly written in RDF language. Instance matching is the problem of identifying pairs of entities (equivalently, instances) that refer to the same underlying entity [50]. For this purpose, numerous approaches have been proposed in the literature [50; 51; 52]. Furthermore, in the OAEI organisation mentioned above, there are challenges (OAEI Instance and schema matching 2023: [[https://oaei.ontologymatching.org/2023/](https://oaei.ontologymatching.org/2023/)]([https://oaei.ontologymatching.org/2023/](https://oaei.ontologymatching.org/2023/)), accessed on 18 May 2024) where instance matching tools are tested every year, proposing datasets for experimentation. Once the instance matching process is performed, the DTwA user has to extend the mapping models with new rules to satisfy the new conceptualisation obtained from the ontology aggregation process.