arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2211.08891cs.FL
收藏

用学习型可见下推自动机验证流式 JSON 文档

Validating Streaming JSON Documents with Learned VPAs

Véronique Bruyère, Guillermo A. Perez, Gaëtan Staquet

AI总结:

本文提出一种基于学习可见下推自动机的流式算法,用于按 JSON 模式验证文档,并证明其存在性及高效性,实验对比显示优于经典方法。

摘要:

我们提出了一种新的流式算法,用于根据 JSON 模式给出的约束集验证 JSON 文档。在 JSON 文档可能持有的各种值中,对象是键值对的无序集合,而数组是有序的值集合。我们证明了对于任何 JSON 模式,总是存在一个可见下推自动机(VPA)接受与该模式相同的 JSON 文档集合。基于这一结果,我们的方法依赖于为所提供的模式学习一个 VPA。由于学习到的 VPA 假定对象中的键值对具有固定顺序,我们将它的转移抽象成一种特殊类型的图,并提出一种高效的流式算法,利用该 VPA 及其图来判断一个 JSON 文档对于该模式是否有效。我们在大量随机 JSON 文档上评估了我们算法的实现,并将其与经典验证算法进行了比较。

英文摘要:

We present a new streaming algorithm to validate JSON documents against a set of constraints given as a JSON schema. Among the possible values a JSON document can hold, objects are unordered collections of key-value pairs while arrays are ordered collections of values. We prove that there always exists a visibly pushdown automaton (VPA) that accepts the same set of JSON documents as a JSON schema. Leveraging this result, our approach relies on learning a VPA for the provided schema. As the learned VPA assumes a fixed order on the key-value pairs of the objects, we abstract its transitions in a special kind of graph, and propose an efficient streaming algorithm using the VPA and its graph to decide whether a JSON document is valid for the schema. We evaluate the implementation of our algorithm on a number of random JSON documents, and compare it to the classical validation algorithm.

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

↑