Negation-Closure for JSON Schema
2022, Cornell University - arXiv
https://doi.org/10.48550/ARXIV.2202.13434Abstract
JSON Schema is an evolving standard for describing families of JSON documents. It is a logical language, based on a set of assertions that describe features of the JSON value under analysis and on logical or structural combinators for these assertions, including a negation operator. Most logical languages with negation enjoy negation closure, that is, for every operator they have a negation dual that expresses its negation. We show that this is not the case for JSON Schema, we study how that changed with the latest versions of the Draft, and we discuss how the language may be enriched accordingly. In the process, we define an algebraic reformulation of JSON Schema, which we successfully employed in a prototype system for generating schema witnesses.
Key takeaways
AI
AI
- JSON Schema lacks negation-closure, complicating logical manipulations and reasoning.
- The authors propose a negation-closed extension of JSON Schema with a not-elimination algorithm.
- A repository of over 91K JSON Schema documents reveals dominance of Draft-06 usage.
- Negation can often be pushed through structural operators, with specific exceptions identified.
- The paper presents an algebraic reformulation of JSON Schema to facilitate schema manipulation tools.
References (15)
- Attouche, L., Baazizi, M.A., Colazzo, D., Falleni, F., Ghelli, G., Landi, C., Sartiani, C., Scherzinger, S.: A Tool for JSON Schema Witness Generation. In: Proceedings of the 24th International Conference on Extending Database Technology, EDBT 2021. pp. 694-697 (2021). https://doi.org/10.5441/002/edbt.2021.86
- Baazizi, M.A., Colazzo, D., Ghelli, G., Sartiani, C., Scherzinger, S.: A JSON Schema Corpus (2021). https://doi.org/10.5281/zenodo.5141199
- Baazizi, M.A., Colazzo, D., Ghelli, G., Sartiani, C., Scherzinger, S.: An Empiri- cal Study on the "Usage of Not" in Real-World JSON Schema Documents (Long Version). CoRR abs/2107.08677 (2021), https://arxiv.org/abs/2107.08677
- Baudart, G., Hirzel, M., Kate, K., Ram, P., Shinnar, A.: Lale: Consistent auto- mated machine learning. In: KDD Workshop on Automation in Machine Learning (2020), https://arxiv.org/abs/2007.01977
- Bazizi, M.A., Colazzo, D., Ghelli, G., Sartiani, C., Scherzinger, S.: An Empirical Study on the "Usage of Not" in Real-World JSON Schema Documents. In: Proc. ER (2021)
- Bourhis, P., Reutter, J.L., Suárez, F., Vrgoc, D.: JSON: Data model, Query lan- guages and Schema specification. In: 36th ACM SIGMOD-SIGACT-SIGAI Sym- posium on Principles of Database Systems (PODS). pp. 123-135 (2017)
- Fruth, M., Baazizi, M.A., Colazzo, D., Ghelli, G., Sartiani, C., Scherzinger, S.: Challenges in Checking JSON Schema Containment over Evolving Real-World Schemas. In: Advances in Conceptual Modeling -ER 2020 Workshops CMAI, CMLS, CMOMM4FAIR, CoMoNoS, EmpER. pp. 220-230 (2020)
- Habib, A., Shinnar, A., Hirzel, M., Pradel, M.: Finding data com- patibility bugs with JSON subschema checking. In: Cadar, C., Zhang, X. (eds.) ISSTA '21: 30th ACM SIGSOFT International Symposium on Software Testing and Analysis, Virtual Event, Denmark, July 11-17, 2021. pp. 620-632. ACM (2021). https://doi.org/10.1145/3460319.3464796, https://doi.org/10.1145/3460319.3464796
- Kozen, D.: Results on the propositional mu-calculus. Theor. Comput. Sci. 27, 333-354 (1983). https://doi.org/10.1016/0304-3975(82)90125-6, https://doi.org/10.1016/0304-3975(82)90125-6
- Maiwald, B., Riedle, B., Scherzinger, S.: What Are Real JSON Schemas Like? In: Advances in Conceptual Modeling -ER 2019 Workshops FAIR, MREBA, EmpER, MoBiD, OntoCom, and ER Doctoral Symposium Papers. pp. 95-105 (2019)
- Møller, A.: dk.brics.automaton -Finite-State Automata and Regular Expressions for Java (2017), http://www.brics.dk/automaton/, version 1.12-1
- MongoDB, Inc.: MongoDB Manual: $jsonSchema (Version 4.4) (2021), https://docs.mongodb.com/manual/reference/operator/query/jsonSchema/
- json-schema org: JSON Schema (2021), available at https://json-schema.org
- Pezoa, F., Reutter, J.L., Suarez, F., Ugarte, M., Vrgoč, D.: Foundations of JSON Schema. In: Proceedings of the 25th International Conference on World Wide Web (WWW). pp. 263-273 (2016)
- Wright, A., Luff, G., Andrews, H.: JSON Schema Validation: A Vo- cabulary for Structural Validation of JSON -draft-wright-json-schema- validation-01. Tech. rep., Internet Engineering Task Force (Apr 2017),