arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2405.17681cs.PL
收藏

合成 JSON Schema 转换器

Synthesizing JSON Schema Transformers

Jack Stanek, Daniel Killough

AI总结:

本文提出一种基于自顶向下、类型导向的程序合成方法,利用重写规则自动生成程序,将符合输入 JSON Schema 的数据安全转换为符合目标 Schema 的数据,从而高效修改结构化 JSON 数据处理代码。

摘要:

JSON(JavaScript Object Notation)是一种数据编码方式,允许结构化数据以标准化且直接的方式在不同系统间使用。JSON 格式数据的模式可以使用 JSON Schema 标准来构建,该标准描述了 JSON 格式数据的数据类型、结构和含义。JSON 通常用于存储和传输信息,例如程序配置、Web API 请求和响应,或远程过程调用;或数据记录,如医疗保健信息或其他结构化文档。由于 JSON 是一种纯文本格式,且可能具有高度复杂的定义,因此当其存储或传输模式被修改时,更改处理结构化 JSON 数据的代码可能是一个艰巨的过程。我们的工作描述了一种程序合成方法,用于生成一个程序,该程序接受符合给定输入 JSON Schema 的数据,并自动将其转换为符合最终目标 JSON Schema 的数据。我们使用自顶向下、类型导向的方法,通过一组重写规则来搜索程序,这些规则限制了修改模式的方式,以防止意外的数据丢失或损坏。一旦找到满足条件的重写序列,我们就将重写序列的中间表示传递给代码生成后端,由其合成一个执行数据转换的程序。该系统允许用户在其接口处以安全的方式快速高效地修改或增强现有系统。

英文摘要:

JSON (JavaScript Object Notation) is a data encoding that allows structured data to be used in a standardized and straightforward manner across systems. Schemas for JSON-formatted data can be constructed using the JSON Schema standard, which describes the data types, structure, and meaning of JSON-formatted data. JSON is commonly used for storing and transmitting information such as program configurations, web API requests and responses, or remote procedure calls; or data records, such as healthcare information or other structured documents. Since JSON is a plaintext format with potentially highly complex definitions, it can be an arduous process to change code which handles structured JSON data when its storage or transmission schemas are modified. Our work describes a program synthesis method to generate a program that accepts data conforming to a given input JSON Schema and automatically converts it to conform to a resulting, target JSON Schema. We use a top-down, type-directed approach to search for programs using a set of rewrite rules which constrain the ways in which a schema can be modified without unintended data loss or corruption. Once a satisfying sequence of rewrites has been found, we pass an intermediate representation of the rewrite sequence to a code generation backend, which synthesizes a program which executes the data transformation. This system allows users to quickly and efficiently modify or augment their existing systems in safe ways at their interfaces.

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

↑