HackerPapers

arXiv:2211.08891cs.FL

Validating Streaming JSON Documents with Learned VPAs

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

HN submission. Found in a submission link or body. Submitters do not count as commenters in the main ranking; a submission is not an endorsement.

Abstract

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.

arXiv comments
46 pages, 10 figures, published at TACAS 2023
Journal reference
Tools and Algorithms for the Construction and Analysis of Systems (TACAS) 2023, pp. 271-289
DOI
doi:10.1007/978-3-031-30823-9_14
Subjects
cs.FLFormal Languages and Automata Theory

On Hacker News

No comments linking this paper were found in the collected sources. Found in 2 HN submissions from Mar 2023 to Mar 2023. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments0 threads

No comments linking this paper were found in the collected sources. Open submission discussions.

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.