Skip to main content

Abstract

JSON Schema is an expressive schema language for describing JSON documents which combines structural assertions with Boolean operators, including negation, and is able to express recursion. In typical situations, JSON Schema is used to validate JSON documents to ensure safety of operations processing these JSONdata. In many other situations, it is important to generate JSONdocuments starting from a JSON Schema schema as it allows for testing applications and for assessing interesting properties like scalability of processing engines. While existing work [6, 8] addressed the witness generation problem, by discarding the \(\mathtt {\small uniqueItems}\) operator, our goal lifts this restriction and addresses the problem of generating multiple instances from a given schema. Since the witness generation problem, which is equivalent to checking the satisfiability in JSON Schema, is known to be EXPTIME-complete even when \(\mathtt {\small uniqueItems}\) is absent [10], our solution adopts an optimistic approach which trades completeness for soundness and efficiency. From a practical point of view, our approach is very satisfactory since, on most real-life scenarios, it is very efficient and highly precise, as testified by our experiments.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

Notes

  1. 1.

    The source code is available at https://gitlab.lip6.fr/attouche/jschemadatagenerator.

References

  1. Json everything. https://github.com/gregsdennis/json-everything

  2. Json faker. https://github.com/json-schema-faker/json-schema-faker

  3. Json generator. https://github.com/jimblackler/jsongenerator

  4. Json schema test suite (2020). https://github.com/json-schema-org/JSON-Schema-Test-Suite/blob/master/tests/draft6/additionalProperties.json

  5. Json schema validator (2022). Accessed 19 Sept 2022

    Google Scholar 

  6. Attouche, L., et al.: A tool for json schema witness generation (2021)

    Google Scholar 

  7. Attouche, L., Baazizi, M.A., Colazzo, D.: Overview and perspectives for optimistic JSON schema witness generarion. In: 23èmes Journées Bases de Données Avancées, BDA (2023)

    Google Scholar 

  8. Attouche, L., Baazizi, M.A., Colazzo, D., Ghelli, G., Sartiani, C., Scherzinger, S.: Witness generation for JSON schema. Proc. VLDB Endow. 15(13), 4002–4014 (2022)

    Google Scholar 

  9. Baazizi, M.A., Colazzo, D., Ghelli, G., Sartiani, C., Scherzinger, S.: Negation-closure for JSON schema. Theor. Comput. Sci. 955, 113823 (2023)

    Google Scholar 

  10. Bourhis, P., Reutter, J.L., Suárez, F., Vrgoc, D.: JSON: data model, query languages and schema specification. In: Sallinger, E., Van den Bussche, J., Geerts, F. (eds.) PODS, pp. 123–135. ACM (2017)

    Google Scholar 

  11. Habib, A., Shinnar, A., Hirzel, M., Pradel, M.: Finding data compatibility bugs with JSON subschema checking. In: ISSTA 2021: 30th ACM SIGSOFT International Symposium on Software Testing and Analysis, Virtual Event, Denmark, 11–17 July 2021, pp. 620–632 (2021)

    Google Scholar 

  12. Hall, P.: On representatives of subsets. J. London Math. Soc. 26–30 (1935)

    Google Scholar 

  13. Møller, A.: dk.brics.automaton – Finite-State Automata and Regular Expressions for Java (2021). https://www.brics.dk/automaton/. Accessed 19 Sept 2022

  14. Wright, A., Andrews, H., Hutton, B.: JSON schema validation: a vocabulary for structural validation of json - draft-handrews-json-schema-validation-02. Technical report, Internet Engineering Task Force (2019)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Lyes Attouche .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2024 The Author(s), under exclusive license to Springer-Verlag GmbH, DE, part of Springer Nature

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Attouche, L., Baazizi, MA., Colazzo, D. (2024). Optimistic Data Generation for JSON Schema. In: Hameurlain, A., Tjoa, A.M., Akbarinia, R., Bonifati, A. (eds) Transactions on Large-Scale Data- and Knowledge-Centered Systems LVI. Lecture Notes in Computer Science(), vol 14790. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-662-69603-3_5

Download citation

  • DOI: https://doi.org/10.1007/978-3-662-69603-3_5

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-662-69602-6

  • Online ISBN: 978-3-662-69603-3

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics