Graph databases are emerging as the leading data management technology for storing large knowledge graphs; significant efforts are ongoing to produce new standards (such as the Graph Query Language, GQL), as well as enrich them with properties, types, schemas, and keys. In this article, we introduce PG-Triggers, a complete proposal for adding triggers to Property Graphs, along the direction marked by the SQL3 Standard. We define the syntax and semantics of PG-Triggers and then illustrate how they can be implemented on top of Neo4j, one of the most popular graph databases. In particular, we introduce a syntax-directed translation from PG-Triggers into Neo4j, which makes use of the so-called {\it APOC triggers}; APOC is a community-contributed library for augmenting the Cypher query language supported by Neo4j. We also cover Memgraph, and show that our approach applies to this system in a similar way. We illustrate the use of PG-Triggers through a life science application inspired by the COVID-19 pandemic. The main objective of this article is to introduce an active database standard for graph databases as a first-class citizen at a time when reactive graph management is in its infancy, so as to minimize the conversion efforts towards a full-fledged standard proposal.
翻译:图数据库正成为存储大规模知识图谱的领先数据管理技术;目前业界正致力于制定新标准(如图查询语言GQL),并为其丰富属性、类型、模式与键值。本文提出PG-Triggers,这是一个沿袭SQL3标准方向的完整触发器方案,旨在为属性图添加触发器功能。我们定义了PG-Triggers的语法与语义,并阐述如何将其实现于最流行的图数据库之一Neo4j之上。具体而言,我们引入了一种从PG-Triggers到Neo4j的语法导向翻译方法,该方法利用了所谓的APIC触发器——APIC是社区贡献的库,用于扩展Neo4j支持的Cypher查询语言。我们还涵盖了Memgraph,并证明该方法同样适用于该系统。通过一个受COVID-19疫情启发的生命科学应用案例,我们展示了PG-Triggers的使用。本文的主要目标是在响应式图管理尚处萌芽阶段之际,将基于图数据库的主动数据库标准作为核心要素引入,从而最大限度降低向成熟标准方案迁移的努力。