Enumeration, Tagged Unions, Tuples, and Collections: A Novel Approach to Extracting JSON Schema - Banhara, Natália; Schreiner, Geomar A.; Feitosa, Samuel da Silva; Duarte, Denio (Anais do Simpósio Brasileiro de Banco de Dados (SBBD); 2024: Anais do XXXIX Simpósio Brasileiro de Bancos de DadosDO - 10.5753/sbbd.2024.240239, 2024)
Recently, JSON became a trendy data format for representing datasets. Its success is due to embodying structure and data in the same representation. Moreover, it has a loose structure, i.e., the structure (aka schema) is not rigid. While the absence of a rigid schema brings several advantages, it is impossible to exploit some benefits of knowing the schema in advance, such as query and storage optimization and improving data curation. In this paper, we propose JFUSE, a tool to deal with the problem of discovering a schema from JSON collections. Besides inferring basic types (e.g., atomic types, arrays, and objects), JFUSE also discovers enumeration, tagged unions, metadata as data, objects as collections, and arrays as tuples. We propose a metamodel that can be easily transformed into any schema language (e.g., JSON Schema). Our experiments show that the proposed approach infers concise and correct schemas from (huge) JSON collections.