# JSON Schemas with Semantic Annotations Supporting Data Translation
## 6 Translating JSON to XML and XML to JSON
### Translating XML to JSON
These translators include not only the XML to XML but also the JSON to XML and the custom XML to JSON translators. Next, 60 tests were made with one JSON schema and one XML schema, selected from the 11 JSON schemas and 11 XML schemas. As expected, the tool verified the compatibility in all tests and generated the translators in 28 of them. It is important to note that performance evaluations have not been not conducted. However, it is expected to have reasonable performance due to the following reasons: (1) Translation scripts are generated during systems set-up, before the first message exchange between two systems. This is the most expensive operation and is realized by the TAG-Tool. A performance evaluation of the TAG-Tool is out of the scope of this paper. Based on our observations on matching annotated schemas, the matching time is strongly dominated by the size and complexity of the reference ontology and not by the inserted annotations concepts. A major problem in OWL reasoning is the poor scalability with regard to the A-Box. However, following the approach proposed in this paper, no instance data of documents need to be represented on the ontology level. (2) Once the scripts are generated, all later interactions are based on the generated scripts. These scripts have no references to the ontology and can typically produce their result in a single traversal of the documents. Therefore, it is expected good scalability. The used JSON schemas, XML schemas, JSON messages, and XML messages as well as the generated XSLTs, are available online at [[http://gres.uninova.pt/tag/validation/json/](http://gres.uninova.pt/tag/validation/json/)]([http://gres.uninova.pt/tag/validation/json/](http://gres.uninova.pt/tag/validation/json/)) accessed on 14 September 2021. Figure 5: Extended TAG-Tool flowchart. ## 9 Conclusions

In this paper, we proposed a method for the semantic annotation of JSON Schemas based on our previous work on the annotation of XML Schemas [5]. The approach aims to support the automatic generation of message translators as well as to detect the semantic compatibility between consumers and providers based on the annotations. We also introduced algorithms for the automatic translation of annotated JSON Schemas to annotated XML Schemas and of XML instance documents to JSON instance documents and vice-versa. The algorithms were implemented in the TAG-Tool developed for the Arrowhead Framework, which now supports the seamless interoperation of consumers and providers, no matter if they expect messages in XML or JSON format. Our experiments showed that, in all expected cases, a successful communication between a large set of heterogeneous XML and JSON-based consumer and provider pairs was made possible via the generated translators. As future work, we intend to support additional data formats and the semi-automatic annotation of Schemas. Other data formats will be considered, such as RDF (Resource Description Framework), JSON-LD (JSON for Linking Data), and CSV (Comma-Separated Values), increasing systems interoperability. Machine learning techniques will be considered to support the semi-automatic annotation of schemas, speeding up the annotation task that currently must be performed manually. Conceptualization, G.A., F.M., R.C.-R., J.K. and P.M.; funding acquisition, P.M.; investigation, G.A., F.M., R.C.-R. and J.K.; methodology, G.A., F.M. and R.C.-R.; software, G.A. and F.M. ; supervision, F.M. and P.M.; validation, G.A. and F.M. ; writing--original draft, G.A., F.M., R.C.-R. and J.K.; writing--review and editing, G.A., F.M., J.K. and P.M. All authors have read and agreed to the published version of the manuscript. This research was partially funded by EU ECSEL Joint Undertaking (JU) under grant agreement n\({}^{\circ}\) 826452 (project Arrowhead Tools). The authors declare no conflicts of interest. ## References

* [PERSON] et al. (2021) [PERSON]; [PERSON]; [PERSON] System of Systems Lifecycle Management--A New Concept Based on Process Engineering Methodologies. _Appl. Sci._**2021**, _11_, 3386.