JSON Schema is an important, evolving standard schema language for families of JSON documents. It is based on a complex combination of structural and Boolean assertions, and features negation and recursion. The static analysis of JSON Schema documents comprises practically relevant problems, including schema satisfiability, inclusion, and equivalence. These three problems can be reduced to witness generation: given a schema, generate an element of the schema, if it exists, and report failure otherwise. Schema satisfiability, inclusion, and equivalence have been shown to be decidable, by reduction to reachability in alternating tree automata. However, no witness generation algorithm has yet been formally described. We contribute a first, direct algorithm for JSON Schema witness generation. We study its effectiveness and efficiency, in experiments over several schema collections, including thousands of real-world schemas. Our focus is on the completeness of the language, where we only exclude the uniqueItems operator, and on the ability of the algorithm to run in a reasonable time on a large set of real-world examples, despite the exponential complexity of the underlying problem.
翻译:Jsson Schema是Jsson文件家庭的一个重要、不断演变的标准形式语言,它基于结构与布林说法的复杂组合,以及否定和重复的特点。对Jsson Schema文件的静态分析包括实际相关的问题,包括Schema可讽刺性、包容性和等同性。这三个问题可以归为证据的产生:一个假设,如果存在这种假设,则产生一个构成模式的要素,否则报告失败。Schema可描述性、包容性和等同性已被证明是可变的,因为交替的树自动模型的可达到性有所减少。然而,尚未正式描述证人生成算法。我们为Jsson Schema证人的生成提供了第一种直接的算法。我们研究其效力和效率,在几个系统收集的实验中,包括数千个真实世界的模型。我们的重点是语言的完整性,我们只是将独特的微粒操作者排除在外,以及算法能否在合理的时间里运行大量真实世界的例子,尽管根本问题十分复杂。