# DTAG: A Methodology for Aggregating Digital Twins Using the WOTDT Ontology
## 4 DTw Aggregation Methodology
### Mappings Aggregation
#### 4.3.2 Resource Aggregation  
Data resources represent all data information stored in the DTw [8]. The goal of this activity is to aggregate the data resources from the DTws involved in the aggregation to obtain the DTwA data resources. This activity involves the DTwA user performing the aggregation between the data resources of the DTws and obtaining the DTwA data resources. Moreover, this activity also involves domain experts to provide support in the data resources aggregation process. These data resources are divided into non-semantic and semantic data resources; therefore, an activity has to be performed for each of them. Non-Semantic Data Resource Referenciation  
The goal of the non-semantic data resources referenciation activity is to reference all the non-semantic data resources of the DTws involved in the aggregation within the DTwA instantiation using WoTDT ontology. These data should be referenced so that the  
Figure 17: Workflow proposed for the SHACL shape model aggregation activity. Figure 18: SHACL shape model aggregation instantiation result. mapping models and the service in charge of the materialisation can be found with the aim of performing the materialisation process to obtain the semantic data. This activity involves the DTwA user and the domain experts selecting which of the non-semantic data resources from the table developed in Section 4.1 can be useful for the resultant DTwA. Once the non-semantic data sources are selected, these are referenced in the instantiation of the DTwA data resources using WoTDT ontology. Therefore, the output of this activity will be the instantiation of the references to the non-semantic data resources that are of interest for the resultant DTwA. Furthermore, in case new non-semantic data resources are needed for the DTwA, the DTwA user should reference them in the DTwA data resources instantiation. In Figure 19, a reference to non-semantic data resources from the DTw pilot in Munich is referenced in the instantiation of the DTwA. Semantic Resource Aggregation  
In case the DTws involved in the aggregation process contain semantic data resources, a process different frpm the one described in Section \"Non-Semantic Data Resources Referenciation\" shall be conducted. The semantic data resources of this dimension are represented by the knowledge graph (KG), which (i) follows the ontology model conceptualisation, (ii) is obtained from the materialisation process using the mapping models, and (iii) is validated with the shapes models. The goal of applying the aggregation method to the semantic data resources is to obtain a single knowledge graph that contains all the information of the DTws involved for the correct performance of the new DTwA. The activity involves the DTwA user and the domain experts first selecting the KGs from the DTws involved in the aggregation that can be useful for the DTwA and then performing the aggregation process between them, to be able to have links between both KGs in a single KG. After selecting and aggregating the KGs, they should be referenced in the DTwA instantiation using the WoTDT ontology. This includes both KGs of the DTws involved in the aggregation and the KG derived from the aggregation activity. Therefore, the output of this activity is to acquire a KG for the DTwA obtained from the aggregation of the KGs of the DTws involved in the aggregation and referenced during the instantiation of the DTwA. To perform the aggregation of the KGs of different DTw, there are two scenarios. The first scenario consists of applying instance matching, where in the literature, approaches such as the use of neural networks [55; 56], genetic algorithms [51], or hybrid approaches [57]. Once the instance matching process has been performed, in contrast to earlier aggregation activities, a validation step can be performed to verify whether the aggregated KG is correct using the aggregated SHACL shapes models from the shapes model aggregation activity. In case the resultant KG is not valid, the instance matching process has to be performed again.