# JSON Schemas with Semantic Annotations Supporting Data Translation
## 3 Arrowhead Framework and TAG-Tool  
Arrowhead Framework [2] is a SOA framework addressing IoT (Internet of Things)-based automation. It was created in the Arrowhead project [45] and continued being developed under other European projects as Productive4.0 project [46] and Arrowhead-Tools project [47] (ongoing project). Arrowhead framework supports the interaction between application services, supported by a set of core services included in the framework. These core services allow the Arrowhead Framework to support the exchange of information between application services. It helps a consumer find a provider that provides a particular service that the consumer needs. The main Core Services, also presented in Figure 1, are as follows:  
* **Service Registry (SR)**, which allows a provider to register a certain service that becomes available in a framework;
* **Service Discovery (SD)**, which allows a consumer to find the available service instance(s);
* **Orchestration (ORC)**, which allows a consumer to find which service instance(s) it shall consume; and
* **Authorization (AUT)**, which permits the provider to verify that the consumer is allowed to consume the required service. A method in which a consumer and a provider can communicate through the Arrowhead framework can be described in the following six steps. A provider starts communicating with the Service Registry to register a service **(1)**. This communication makes that service available in the Arrowhead framework and informs Arrowhead that this provider provides that service. When a consumer needs a service, it communicates with Service Discovery **(2)**, asking if there are providers that offer that service. If it receives a positive response, the consumer can communicate with the orchestration **(3)**. Next, the orchestration analyzes all providers that offer the service and selects which one is better to offer the desired service to this specific consumer. The consumer already has all of the information that allows it to interact directly with the provider. Therefore, the consumer sends a direct request message to the provider's address **(4)** asking for the service. When the provider  
Figure 1: Arrowhead framework core services and application services. receives the request from the consumer, it may send a message to the authorization asking if it can communicate with the consumer **(5)**. If yes, the provider answers the consumer request, sending a direct message to the consumer with the information related to the requested service **(6)**. All of this communication works properly if the consumer and the provider can understand each other. However, if they do not understand each other, then the direct exchange of information between them is impossible. In such cases, the orchestration would have to consider which systems manage to understand each other, or else, the consumer would have to ask the arrowhead framework for new providers until it finds one with which it could communicate. The introduction of a translator in the communication between the provider and the consumer (Figure 2) may enable the interaction between heterogeneous systems, allowing them to understand each other. However, this solution presents a problem. It is necessary to provide translators between all consumer/provider pairs. This should not be accomplished in a tedious, cost-intensive, and error-prone manual task. To deal with this problem, an approach that supports the automatic generation of translators, based on their annotated metadata and a reference ontology, was proposed in [4; 5]. This approach is presented in Figure 3. The algorithm analyzes the metadata from the consumer and the provider, semantically annotated with a reference ontology and--if possible--returns an automatically generated translator. A tool was developed (available online at [[http://pres.uninova.pt/tag/](http://pres.uninova.pt/tag/)]([http://pres.uninova.pt/tag/](http://pres.uninova.pt/tag/)) accessed on 14 September 2021, based on this approach.