{'fraction_non_alphanumeric': 0.023255813953488372, 'fraction_numerical': 0.0, 'mean_word_length': 5.036199095022624, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
An MDE Approach to Generate Schemas for Object-document Mappers

Most NoSQL systems are schemaless. This lack of schema offers a greater flexibility than relational systems. However, this comes at the cost of losing benefits such as the static checking that assure that stored data conforms to the database schema. Instead, developers must be in charge of this task that is time-consuming and error-prone. Object-NoSQL mappers are emerging to alleviate this task and facilitate the development of NoSQL applications. These mappers allow the definition of schemas, which are used to assure that data are correctly manipulated. In this article, we present an MDE approach that automatically generates schemas and other artefacts for mappers. As proof of concept, we have considered Mongoose, which is a widely used mapper for MongoDB, but the solution is mapper-independent. Firstly, the schemas are inferred from stored data by using an approach defined in a previous work. Then, NoSQL schema models are input to a two-step model transformation chain that generates schemas, validators and updating procedures, among other Mongoose artefacts. An intermediate metamodel has been defined to ease the implementation of the transformations. This work shows how MDE techniques can be applied in the emerging “NoSQL Data Engineering” field.