Abstract
We study the usage of negation in JSON Schema data modeling. Negation is a logical operator rarely present in type systems and schema description languages, since it complicates decision problems: many software tools, but also formal frameworks for working with JSON Schema, do not fully support negation. This motivates us to study whether negation is actually used in practice, for which aims, and whether it could—in principle—be replaced by simpler operators. We have collected a large corpus of 80k open source JSON Schema documents from GitHub. We perform a systematic analysis, quantify usage patterns of negation, and also qualitatively analyze schemas. We show that negation is indeed used, albeit infrequently, following a stable set of patterns.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
SchemaStore, at https://www.schemastore.org/json/, last accessed 21-Apr-2021.
References
JSON Schema Test Suite (2021). https://github.com/json-schema-org/JSON-Schema-Test-Suite. version of commit hash #09fd353
Attouche, L., et al.: A tool for JSON schema witness generation. In: Proceedings of EDBT 2021, pp. 694–697 (2021)
Baazizi, M.A., Colazzo, D., Ghelli, G., Sartiani, C.: Schemas and types for JSON data: from theory to practice. In: Proceedings of SIGMOD 2019, pp. 2060–2063 (2019)
Baazizi, M.A., Colazzo, D., Ghelli, G., Sartiani, C., Scherzinger, S.: Not elimination and witness generation for JSON schema. In: Proceedings of BDA 2020 (2020)
Baazizi, M.A., Colazzo, D., Ghelli, G., Sartiani, C., Scherzinger, S.: An empirical study on the “usage of not” in real-world JSON schema documents (long version). CoRR (2021). https://arxiv.org/abs/2107.08677
Bex, G.J., Neven, F., den Bussche, J.V.: DTDs versus XML schema: a practical study. In: Proceedings of WebDB 2004 (2004)
Bourhis, P., Reutter, J.L., Suárez, F., Vrgoc, D.: JSON: data model, query languages and schema specification. In: Proceedings of PODS 2017, pp. 123–135 (2017)
Choi, B.: What are real DTDs like? In: Proceedings of WebDB 2002, pp. 43–48 (2002)
Friesen, J.: Extracting JSON values with JsonPath. In: Java XML and JSON: Document Processing for Java SE, pp. 299–322. Apress (2019)
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: Grossmann, G., Ram, S. (eds.) ER 2020. LNCS, vol. 12584, pp. 220–230. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-65847-2_20
Habib, A., Shinnar, A., Hirzel, M., Pradel, M.: Finding data compatibility bugs with JSON subschema checking. In: Proceedings of ISSTA 2021, pp. 620–632 (2021)
Laender, A.H., Moro, M.M., Nascimento, C., Martins, P.: An X-ray on web-available XML schemas. SIGMOD Rec. 38(1), 37–42 (2009)
Maiwald, B., Riedle, B., Scherzinger, S.: What are real JSON schemas like? In: Guizzardi, G., Gailly, F., Suzana Pitangueira Maciel, R. (eds.) ER 2019. LNCS, vol. 11787, pp. 95–105. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-34146-6_9
Martens, W., Neven, F., Schwentick, T., Bex, G.J.: Expressiveness and complexity of XML schema. ACM Trans. Database Syst. 31(3), 770–813 (2006)
MongoDB Inc.: MongoDB Manual: $jsonSchema (Version 4.4) (2021). https://docs.mongodb.com/manual/reference/operator/query/jsonSchema/
json-schema org: JSON Schema (2021). https://json-schema.org
Pezoa, F., Reutter, J.L., Suarez, F., Ugarte, M., Vrgoč, D.: Foundations of JSON schema. In: Proceedings of WWW 2016, pp. 263–273 (2016)
StackOverflow: JSON Schema - valid if object does *not* contain a particular property. https://stackoverflow.com/questions/30515253/json-schema-valid-if-object-does-not-contain-a-particular-property
Acknowledgments
This contribution was partly funded by Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) grant #385808805. The schemas were retrieved using Google BigQuery, supported by Google Cloud. We thank Thomas Pilz (OTH Regensburg) for his help in making the research artifacts available. We thank Michael Fruth (University of Passau) for feedback on an earlier draft.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2021 Springer Nature Switzerland AG
About this paper
Cite this paper
Baazizi, MA., Colazzo, D., Ghelli, G., Sartiani, C., Scherzinger, S. (2021). An Empirical Study on the “Usage of Not” in Real-World JSON Schema Documents. In: Ghose, A., Horkoff, J., Silva Souza, V.E., Parsons, J., Evermann, J. (eds) Conceptual Modeling. ER 2021. Lecture Notes in Computer Science(), vol 13011. Springer, Cham. https://doi.org/10.1007/978-3-030-89022-3_9
Download citation
DOI: https://doi.org/10.1007/978-3-030-89022-3_9
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-89021-6
Online ISBN: 978-3-030-89022-3
eBook Packages: Computer ScienceComputer Science (R0)