arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2503.11288cs.DBcs.PL
收藏

消除 Modern JSON Schema 验证中的注解依赖

Elimination of annotation dependencies in validation for Modern JSON Schema

Lyes Attouche, Mohamed-Amine Baazizi, Dario Colazzo, Giorgio Ghelli, Stefan Klessinger, Carlo Sartiani, Stefanie Scherzinger

AI总结:

针对 Modern JSON Schema 的注解依赖阻碍可满足性理论与算法扩展的问题,本文研究向 Classical JSON Schema 的重写,证明维度指数增长下界,并给出实践表现良好的消除算法。

摘要:

JSON Schema 是一种用于定义 JSON 值结构的逻辑语言。JSON Schema 的语法基于嵌套的 schema 对象。在直到 Draft-07 的所有 JSON Schema 版本中(这些版本统称为 Classical JSON Schema),schema 的语义完全由其所验证的 JSON 值集合来描述。这种语义曾是深入理论研究以及开发用于判定 schema 可满足性与等价性的工具的基础。遗憾的是,Classical JSON Schema 在表达对象 schema 扩展方面存在严重局限,这促使 Draft 2019-09 引入了两项破坏性特性:annotation dependency(注解依赖)和 dynamic references(动态引用)。这些新特性破坏了此前建立的语义理论,而且用于判定 Classical JSON Schema 可满足性的算法不易扩展。一种可能的解决方案是将用 Modern JSON Schema 编写的 schema 重写为等价的 Classical JSON Schema schema。本文证明,消除 annotation dependent keywords(注解依赖关键字)通常无法避免 schema 维度的指数级增长。我们提出了一种用于消除这些关键字的算法;尽管存在上述理论下界,但正如我们通过大量实验所验证的,该算法在实践中表现相当出色。

英文摘要:

JSON Schema is a logical language used to define the structure of JSON values. JSON Schema syntax is based on nested schema objects. In all versions of JSON Schema until Draft-07, collectively known as Classical JSON Schema, the semantics of a schema was entirely described by the set of JSON values that it validates. This semantics was the basis for a thorough theoretical study and for the development of tools to decide satisfiability and equivalence of schemas. Unfortunately, Classical JSON Schema suffered a severe limitation in its ability to express extensions of object schemas, which caused the introduction, with Draft 2019-09, of two disruptive features: annotation dependency and dynamic references. These new features undermine the previously developed semantic theory, and the algorithms used to decide satisfiability for Classical JSON Schema are not easy to extend. One possible solution is rewriting a schema written in Modern JSON Schema into an equivalent schema in Classical JSON Schema. In this paper we prove that the elimination of annotation dependent keywords cannot, in general, avoid an exponential increase of the schema dimension. We provide an algorithm to eliminate these keywords that, despite the theoretical lower bound, behaves quite well in practice, as we verify with an extensive set of experiments.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑