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

J-Logic:查询JSON的逻辑

J-Logic: a Logic for Querying JSON

Jan Hidders, Jan Paredaens, Jan Van den Bussche

摘要:

我们提出了一个逻辑框架,基于数据库,研究查询JSON数据的基础。我们称之为J-Logic的方法的主要特点是强调路径。路径是键序列,用于访问嵌套JSON对象的树结构。J-Logic还提供了一种从路径或子路径生成新密钥的方法,即“packing”。具有递归的J-Logic在计算上是完整的,但许多查询可以在没有递归的情况下表达,例如深度相等。我们给出了一个必要条件,查询是可表达的,没有递归。我们的大多数结果都集中在JSON对象作为从键到值的部分函数的确定性本质上。然而,由J-逻辑程序定义的谓词可能不能正确地描述对象。尽管如此,我们表明,在J-Logic中的每个对象到对象的转换可以只使用中间结果中的对象来定义。此外,我们证明了它是可判定的是否一个积极的,非递归的J-逻辑程序总是返回一个对象时,给定的对象作为输入。关于包装,我们表明,包装是不必要的,如果输出不需要新的密钥。最后,我们展示了查询包含的可判定性,积极的,非递归的J-逻辑程序。

英文摘要:

We propose a logical framework, based on Datalog, to study the foundations of querying JSON data. The main feature of our approach, which we call J-Logic, is the emphasis on paths. Paths are sequences of keys and are used to access the tree structure of nested JSON objects. J-Logic also features ``packing'' as a means to generate a new key from a path or subpath. J-Logic with recursion is computationally complete, but many queries can be expressed without recursion, such as deep equality. We give a necessary condition for queries to be expressible without recursion. Most of our results focus on the deterministic nature of JSON objects as partial functions from keys to values. Predicates defined by J-Logic programs may not properly describe objects, however. Nevertheless we show that every object-to-object transformation in J-Logic can be defined using only objects in intermediate results. Moreover we show that it is decidable whether a positive, nonrecursive J-Logic program always returns an object when given objects as inputs. Regarding packing, we show that packing is unnecessary if the output does not require new keys. Finally, we show the decidability of query containment for positive, nonrecursive J-Logic programs.

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

↑