Table of Contents
Fetching ...

PG-Triggers: Triggers for Property Graphs

Stefano Ceri, Anna Bernasconi, Alessia Gagliardi, Davide Martinenghi, Luigi Bellomarini, Davide Magnanimi

TL;DR

This work introduces PG-Triggers, a formal trigger model for Property Graphs that adapts SQL3 trigger concepts to graphs, complete with syntax, semantics, and mappings to Neo4j via APOC and to Memgraph. It provides a concrete running example based on a CoV2K–inspired COVID-19 knowledge base to illustrate reactive graph management, including events such as mutations, lineages, and ICU dynamics. The authors argue that adding reactive behavior to graph databases is both natural and valuable, while highlighting current limitations in existing implementations and the need for standardization to achieve a robust, interoperable mechanism. They also discuss practical translation strategies, latency and cascading concerns, and outline directions for evolving toward a standard that would unify trigger semantics across graph databases.

Abstract

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.

PG-Triggers: Triggers for Property Graphs

TL;DR

This work introduces PG-Triggers, a formal trigger model for Property Graphs that adapts SQL3 trigger concepts to graphs, complete with syntax, semantics, and mappings to Neo4j via APOC and to Memgraph. It provides a concrete running example based on a CoV2K–inspired COVID-19 knowledge base to illustrate reactive graph management, including events such as mutations, lineages, and ICU dynamics. The authors argue that adding reactive behavior to graph databases is both natural and valuable, while highlighting current limitations in existing implementations and the need for standardization to achieve a robust, interoperable mechanism. They also discuss practical translation strategies, latency and cascading concerns, and outline directions for evolving toward a standard that would unify trigger semantics across graph databases.

Abstract

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.
Paper Structure (25 sections, 5 figures, 4 tables)

This paper contains 25 sections, 5 figures, 4 tables.

Figures (5)

  • Figure 1: PG-Trigger Syntax
  • Figure 2: Syntax-directed translation from PG-Triggers to APOC triggers, for the specific case of node creation
  • Figure 3: Syntax-directed translation from PG-Triggers to Memgraph triggers, for the specific case of node creation.
  • Figure 4: PG-Schema for the graph database used in our running example
  • Figure 5: PG-Schema specification for the running example