<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta>
      <journal-title-group>
        <journal-title>SEBD</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Towards a Standard for Triggers in Property Graphs</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Luigi Bellomarini</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Anna Bernasconi</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Stefano Ceri</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Alessia Gagliardi</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Davide Magnanimi</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Davide Martinenghi</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Banca d'Italia</institution>
          ,
          <addr-line>Rome</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Politecnico di Milano</institution>
          ,
          <addr-line>Milan</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2024</year>
      </pub-date>
      <volume>32</volume>
      <fpage>23</fpage>
      <lpage>26</lpage>
      <abstract>
        <p>Graph databases are emerging as the leading data management technology for storing large knowledge graphs; significant eforts are ongoing to produce new standards (such as the Graph Query Language, GQL) and enrich them with properties, types, schemas, and keys. In this article, we present PG-Triggers, a 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 briefly discuss how they can be implemented on top of the most popular graph databases. The main objective of this article is to discuss 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 eforts towards a full-fledged standard proposal.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;property graphs</kwd>
        <kwd>standards for graph databases</kwd>
        <kwd>trigger standardization</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        Graph databases are becoming increasingly important as frameworks for representing and
understanding the intricate connections that exist in the real world [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Thanks to their expressive
query languages, rich customer support, and strong performance, they are steadily more used
to store large knowledge graphs, in a variety of domains that include, e.g., mobility, social, and
biological networks.
      </p>
      <p>
        As customary in data management evolution, standards for graph databases are emerging,
most importantly the Graph Query Language (GQL) [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], whose roadmap is followed with interest
by the major companies in the field. In addition, the research community has proposed various
formalizations so as to enrich the semantics of graph databases, first by shaping them in the
form of Property Graphs [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], and then by defining the notions of PG-Keys [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] and PG-Schema [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
      </p>
      <p>
        In this paper, we follow up along this trend and propose PG-Triggers. Triggers exist since the
birth of relational databases [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], have been studied in [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], and formalized in the ISO-ANSI SQL3
Standard [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. So far, they have not been formalized by the graph database research community,
although they can be informally supported by most graph database systems, even if in diversified
ways (see Section 2). Hence, our proposal for PG-Triggers has the potential to influence future
standard development as well as to suggest new directions to the evolution of graph databases.
      </p>
      <p>
        In this paper we summarize some of the findings discussed in [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. While here we focus on
the syntactic and semantics aspects of the proposed standard, in [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] we also demonstrate our
idea in practice on Neo4j. We show that Neo4j already supports all the required components
for implementing our PG-Trigger concepts; however, it does so within a community-supported
library, called Awesome Procedures on Cypher (APOC) [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ], and not as part of Cypher [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] – the
declarative graph query language adopted by Neo4j. Our approach easily extends to Memgraph.
Our translation schemes show that current Neo4j or Memgraph solutions could rather easily
evolve into unified and solid abstractions, along the PG-Trigger proposal, so as to favor a wider
use of empowered triggers.
      </p>
      <p>Contributions. Our main contribution is a proposal for adding reactive behavior in the form
of triggers to graph databases, which follows from our comparative review of graph database
technologies, presented in Section 3. This proposal aims to be natural and useful:
• Natural, as it suitably adapts the recommendations of the SQL3 standard to a graph setting,
thereby adhering to the principle of least surprise, for the great benefit of people already
acquainted with the well-known corresponding relational notions.
• Useful, as knowledge management through reactive behavior proves to be very efective
in numerous knowledge-intensive (instead of just data-intensive) scenarios.</p>
      <p>Adapting the notion of triggers to Property Graphs is, however, far from trivial, as, on one
hand, it requires dealing with non-relational concepts such as nodes, relationships, labels, and
properties, and, on the other hand, it lacks a full correspondence with the notion of table, which,
in the relational case, is the source of events that can be monitored by triggers. To this end, our
proposal identifies the notion of label as the most suitable and natural choice for defining a set
of target elements in the graph, much in the same way in which tables do in SQL triggers.</p>
      <p>It is worth mentioning that, although PG-Triggers can be implemented on top of Neo4j
through the APOC trigger library (which provides evidence of the feasibility of our proposal),
this step also requires extending APOC triggers with a few important, missing ingredients,
among which the support for a correct cascading of triggers (occurring when a trigger’s action
causes the activation of other triggers), for event-specific triggering action times, and for
instance-level vs set-level trigger granularities. We support these features in our PG-Triggers
proposal, whose syntax and semantics are streamlined as much as possible, so as to combine ease
of use with expressivity, in the hopes that our proposal can drive forthcoming standardization
choices in Property Graphs.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Related Work</title>
      <p>
        The Property Graph data model applies to a directed graph where nodes and edges are labeled,
and each can have associated 〈property, value〉 pairs. The Property Graph data model has gained
significant popularity and adoption in various graph database systems, including Neo4j [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ],
Memgraph [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ], JanusGraph [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ], Amazon Neptune [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ], Nebula Graph [16], TigerGraph [17],
and more. This large participation and attention on Property Graphs led to the idea of creating a
standalone Property Graph query language to complement SQL, which was raised by ISO SC32/
WG3 members in early 2017 and is echoed in the GQL manifesto of May 2018 [18]. Closely
related eforts include: the Linked Data Benchmark Council (LDBC) Groups [ 19], the Graph
Query Language Core (G-CORE) [20], PG-Keys [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], and PG-Schema [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
      </p>
      <p>Only a few reactive extensions are discussed for research prototypes using graph databases.
Among them, GraphFlow [21] and TurboFlux [22].</p>
    </sec>
    <sec id="sec-3">
      <title>3. Comparative Review of Graph Database Technology</title>
      <p>We analyze some of the commercial graph database systems, highlighting how they support
reactive computations. In particular, we first analyze products focused on supporting graph (or
RDF) data and then we consider systems mixing graph data with other kinds of data, including
relational and document/key-value data.
3.1. Graph Databases
3.1.1. Graph Databases with trigger support
• Neo4j. Neo4j is an open-source NoSQL native graph database; it is the most widely
adopted graph database [23]. It has introduced Cypher, a declarative language for querying
and manipulating graph data, the de facto standard in graph databases. Neo4j does not
support triggers natively, however, triggers are included in APOC (Awesome Procedures
on Cypher), a popular extension library for Neo4j.
• Memgraph. Memgraph is another open-source graph database compatible with Neo4j,
built for real-time streaming. It ofers an implementation of triggers that supports the
execution of any openCypher [24] query.
3.1.2. Graph Databases with event listeners
• JanusGraph. JanusGraph is an open-source, distributed graph database system built
on the graph computing framework Apache TinkerPop; it is eficient in handling very
large graphs with billions of vertices and edges. In JanusGraph, triggers can be produced
through the "JanusGraph Bus", a collection of configurable logs to which JanusGraph
writes changes to the graph.
• Dgraph. Dgraph is an open-source, horizontally scalable, distributed graph database.</p>
      <p>
        It provides a flexible query language for querying and manipulating data, called DQL.
Dgraph provides the Dgraph Lambda framework [25], which can be used to react to
events through Typescript or Javascript functions.
• Amazon Neptune. Amazon Neptune is a fully managed graph database service provided
by Amazon Web Services. Amazon Neptune supports both the Apache TinkerPop Gremlin
graph traversal language and the openCypher query language for the Property Graph data
model. For the Resource Description Framework (RDF) data model, Neptune supports
the standard open language SPARQL query language [26]. Neptune uses Amazon Simple
Notification Service (Amazon SNS) to provide notifications when a Neptune event occurs.
Neo4j [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ], Memgraph [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]
JanusGraph [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ], Dgraph[27], Amazon Neptune [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ], Stardog [28]
Nebula Graph [16], TigerGraph [17], GraphDB [29]
Oracle Graph Database [30], Virtuoso [31], AgensGraph [32]
Microsoft Azure Cosmos DB [33] , OrientDB [34], ArangoDB [35]
Tr-G Tr-R Ev-L
✓
- ✓(JSBus, Lambda, SNS, Java)
-
- ✓
- ✓(JS, Hooks, AQL)
• Stardog. Stardog is a commercial graph DBMS with a connected Enterprise Knowledge
Graph platform and virtualization capability. It supports GraphQL for the graph store
and SPARQL for the RDF store. It uses Java event handlers to capture changes in the data.
3.1.3. Other Graph Databases
• Nebula Graph. NebulaGraph is an open-source distributed, linear scalable database
supporting eficient graph patterns. It supports Cypher and implements its own nGQL
language; it does not support reactive aspects.
• TigerGraph. TigerGraph is a commercial parallel graph computing platform; it provides
a graph query language called GSQL, which allows user-defined functions and procedures.
      </p>
      <p>It does not include reactive aspects.
• GraphDB. GraphDB is a commercial graph database and RDF store, with eficient
reasoning support. Queries are accepted in GraphQL and SPARQL; triggers are not supported.</p>
      <sec id="sec-3-1">
        <title>3.2. Mixed Graph-Relational Systems</title>
        <p>Mixed graph-relational systems are built by integrating two engines: a graph database and a
relational database. The graph system supports a graph (Cypher-like) query language, whereas
the relational system supports SQL. Queries can be built by assembling Cypher and SQL
statements, where the former operates on graph data and the latter operates on tables. Relational
engines support triggers, compliant with the SQL3 standard, but these do not operate on graph
data.</p>
        <p>• Oracle Graph Database and Graph Analytics. The Oracle Graph Database supports the
Property Graph data model, enabling graph analytics capabilities. Oracle Graph Database
integrates with Oracle’s broader ecosystem, including its SQL-based data management
and triggers.
• Virtuoso. Virtuoso is a multi-model DBMS developed by OpenLink (available both in
open-source and commercial editions), providing SQL, XML, and RDF data management
in a single multithreaded process. The trigger support is provided in the relational DBMS.
• AgensGraph. Agens Graph is an open-source tool whose graph system supports the
Property Graph as well as the relational data model; the latter is built upon PostgreSQL.</p>
        <p>Taking advantage of relational technology, AgensGraph supports triggers.</p>
      </sec>
      <sec id="sec-3-2">
        <title>3.3. Mixed Graph-Document Databases</title>
        <p>Mixed graph-document systems are built by integrating graph data with document bases.
• Microsoft Azure Cosmos DB. Cosmos DB is a globally distributed, horizontally scalable,
multi-model database service, queried through graph database APIs (Gremlin) and
document database APIs (Mongo DB or Cassandra). A JavaScript-integrated query API can be
used to write triggers, which are classified into pre-triggers (executed before modifying
a database item) and post-triggers (after modifying a database item). These must be
specified for each database operation where their execution is expected.
• OrientDB. OrientDB is an open-source, multi-model database management system that
combines characteristics of document databases and of graph databases. It employs a
SQL-like query language called OrientSQL and the native graph query language Gremlin.
In this context, triggers (renamed as Hooks) enable the triggering of actions in response
to document creation, modification, or deletion.
• ArangoDB. ArangoDB is a multi-model, open-source database system that combines the
features of document, key-value, and graph databases into a single platform. It provides a
native graph querying language called AQL (ArangoDB Query Language) for eficient
graph traversals and graph-based analytics. ArangoDB supports diferent events that can
be monitored through a listener (AbstractArangoEventListener).</p>
      </sec>
      <sec id="sec-3-3">
        <title>3.4. Comparison and Discussion</title>
        <p>Table 1 ofers a synoptic view of how graph databases, with their main extensions, support
reactive computations, either directly through triggers or indirectly through event listeners.
Note, however, that trigger support in mixed relational systems operates just upon tables, i.e.,
the relational component. This comparison shows that, although forms of reactive processing
exist in many commercial graph databases, they are not yet well developed.</p>
        <p>In summary, as of today, native triggers on graph data are available just in Neo4j and
Memgraph; moreover, Neo4j triggers are still supported within community-defined APOC
libraries and are not part of the standard language. Many other graph databases and hybrid
systems support ingredients for building reactive systems (e.g., Hooks of OrientDB) but they
are far away from supporting full-fledge trigger systems. This is the ideal time for setting the
requirements for a trigger standard, so as to avoid misaligned deployment of similar but not
identical features; we will show that signs of such misalignment exist already by focusing on
Neo4j and Memgraph, the two graph databases with stronger trigger support, as well as market
leaders within graph database according to [23].</p>
        <p>Note that a trigger standard is quite parsimonious, as triggers are compositions of
eventcondition-action rules that base all their syntax and semantics on a limited number of ingredients,
which define: when they should be activated after a data creation, modification, or deletion;
when their condition should be considered; and when their action should be executed if the
condition is true. The essence of a trigger system should be as much as possible agnostic to
the detailed aspects of the underlying query language - be it SQL, Cypher, or GQL. Fixing
these aspects ahead of language standardization may lead to convergence – at this time being
inexpensive for graph database vendors, whereas -at the time of the SQL3 trigger standard- the
development to obtain convergence among relational databases was quite hard [36].</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. PG-Triggers Definition</title>
      <p>We next propose PG-Triggers, by discussing their syntax and semantics.</p>
      <p>CREATE TRIGGER &lt;name&gt; &lt;time&gt; &lt;event&gt; ON &lt;label&gt;[.&lt;property&gt;] [REFERENCING &lt;alias&gt;...]
FOR &lt;granularity&gt; &lt;item&gt; [WHEN &lt;condition&gt;]
BEGIN &lt;statement&gt; END
&lt;time&gt; ::= { BEFORE | AFTER | ONCOMMIT | DETACHED }
&lt;event&gt; ::= { CREATE | DELETE | SET | REMOVE }
&lt;granularity&gt; ::= { EACH | ALL }
&lt;item&gt; ::= { NODE | RELATIONSHIP }
&lt;alias&gt; ::= [OLDNODES | OLDRELS] AS &lt;alias for old items&gt; |
[NEWNODES | NEWRELS] AS &lt;alias for new items&gt; |</p>
      <p>OLD AS &lt;alias for old single item&gt; | NEW AS &lt;alias for new single item&gt;</p>
      <sec id="sec-4-1">
        <title>4.1. Syntax</title>
        <p>
          The PG-Triggers syntax, shown in Figure 1, is borrowed – as much as possible – from the SQL3
standard, as discussed, e.g., in Chapter 11 of [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]. In our notation, upper case letters are reserved
for terminal symbols; nonterminals are in a low case and enclosed within &lt;&gt; (angle brackets);
optionality is denoted by [] (square brackets); items of which only one is required are enclosed
within braces {}; alternatives are separated by the | symbol; and ellipsis points show that the
preceding element can be repeated.
        </p>
        <p>Note that, due to the richness of the graph data model w.r.t. the relational model, the syntax
has many more options. In particular, note that graph items can either be nodes or relationships;
we use a given label to select, out of all items, the specific set of items that is the trigger’s
target. Note also that trigger events in graph databases are richer than those in relational
databases, as they include the creation and deletion of nodes/relationships as well as the setting
and removal of their labels and properties. In analogy with the UPDATE event of the SQL3
standard, the SET and REMOVE events can refer to properties; thus, the ON clause may refer
to labels (for nodes, relationships, and label themselves) but also to properties, identified by a
&lt;label&gt;.&lt;property&gt;) pair.</p>
      </sec>
      <sec id="sec-4-2">
        <title>4.2. Semantics</title>
        <p>As usual, triggers include a &lt;condition&gt; predicate, which is considered at given action
&lt;time&gt;(s), and a connected action &lt;statement&gt;, which is executed only if the corresponding
condition predicate holds. We next describe the trigger semantics along the classical dimensions,
by making explicit reference to their syntactic elements.</p>
        <p>
          • Granularity. We assume that each trigger execution is linked to a given query in a
graph query language (GQL or Cypher); from our point of view, a query operates on an
initial state and produces a final state, by creating or removing &lt;item&gt;s (i.e., nodes and
relationships), or by setting or removing their labels and properties. These changes are
considered at two possible levels of &lt;granularity&gt;: either individually (FOR EACH
clause) or collectively as a set (FOR ALL clause).
• Action Time. As in relational databases, we consider triggers occurring BEFORE and
AFTER the statement; in addition, we ofer the ONCOMMIT and DETACHED option. As with
relational triggers, BEFORE statements should not produce arbitrary changes, but just
condition NEW states. ONCOMMIT execution occurs before the commit execution, within
the same transaction (possibly causing a rollback of the transaction as a whole), while
DETACHED execution occurs after a successful commit and operates within an autonomous
transaction. Triggers sharing the same action time must be ordered (see next).
• Targeting. Triggers in relational databases are targeted to tables. We opted for using
labels as providers of an analogous context; therefore, in the ON clause, we select as target
the items with a particular &lt;label&gt;.
• Event Types. Events refer to either nodes or relationships and include their creation or
deletion, and the setting or removal of labels and properties.
• Transition Variables. With individual-level granularity, OLD and NEW refer to the old
and new state, respectively. With set-level granularity, transition variables are postfixed
by the NODES keyword or by the RELS keyword; clearly, in this case, the item must be
the same as in the FOR clause. Along with [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ], our proposed syntax ofers an option for
renaming transition variables through the AS clause, for referring to them mnemonically
with respect to the application domain.
        </p>
        <p>Discussion. This definition of semantics is quite close to the relational one, but some diferences
require further discussion.</p>
        <p>
          • Choice of LABELS. Adopting labels for identifying the trigger’s target appears to be the
most natural choice in the case of Property Graphs – every node and relationship, sharply,
either belongs or does not belong to the set of items with a given label. Still, the situation
is more complex than in the relational case, as a node or relationship may have no label,
or instead it may have more than one associated label, whereas a tuple belongs to exactly
one table in the relational model.1 For clarity of the execution semantics, we also make
the assumption that no trigger can monitor the setting or removal of its target label and
that the target label cannot be set or removed within the &lt;statement&gt;.
• The ONCOMMIT option, which is not supported in relational databases, is supported by
Neo4j and Memgraph, although with several options and diferent semantics for each
option. Our interpretation of ONCOMMIT is to consider and execute the trigger when the
transaction reaches the commit point, and then include also triggers’ side efects before
actually committing. The ONCOMMIT option is in part justified in graph databases by the
interleaving of MATCH clauses with node and relationship creations, updates and deletions,
which make the context-of-operation less well-defined than in a relational database. 2
1Labels could be substituted by PG-Types (with STRICT option, which makes them compulsory for all nodes or
relationships) if they will become widely used and accepted as standard.
2The ONCOMMIT option is sometimes advocated for relational databases, e.g., in practitioners’ blogs.
• Similarly, for what concerns the order of execution of diferent triggers that are activated
by the same Cypher or GQL query, these queries are generally much more powerful than
relational update queries, targeted to a single table, as they can update multiple nodes
and relationships, with diferent labels. Hence, the most sensible option for prioritizing
them is to resort to the trigger creation time, thus providing a total order.3 In all cases,
with a given execution order, the execution semantics of cascading triggers should mimic
the relational one, with the stack of trigger execution contexts as described, e.g., in [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ].
        </p>
      </sec>
      <sec id="sec-4-3">
        <title>4.3. Example</title>
        <p>Consider a graph database whose schema, among other things, contains nodes of type Mutation
(with strings name and protein) and CriticalEffect (with the description string),
connected by arcs of type Risk. The simple PG-Trigger shown below reacts to the fact that a new
mutation is associated with a critical efect by creating an alert with the name of the mutation.
CREATE TRIGGER NewCriticalMutation AFTER CREATE ON ’Mutation’ FOR EACH NODE
WHEN EXISTS (NEW)-[:Risk]-(:CriticalEffect)
BEGIN CREATE (:Alerttime:DATETIME(),desc:’New critical mutation’,mutation:NEW.name) END</p>
        <p>
          Besides cases of reactions to node, relationship or property creation, more complex scenarios
include conditions using thresholds or state comparisons, or even side efects in the action of
the trigger. For these kinds of examples and their rendering as APOC triggers, the interested
reader can refer to [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ].
        </p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>5. Discussion and Conclusion</title>
      <p>In this article, we have shown that adding reactive components to graph databases is at the same
time very natural, along the SQL3 standard, and also very useful, as reactive programming can
leverage graph databases in supporting important applications. We have shown that the concepts
of PG-Triggers descend naturally from relational concepts, although they require adaptation to
the richer graph model, which includes nodes, relationships, labels, and properties.</p>
      <p>We have argued that PG-Triggers can be supported on top of Neo4j by making use of the APOC
trigger procedures. A major drawback is that APOC triggers miss some important ingredients
for being fully compliant with standardization needs, including the mastering of activation
before or after operations that cause triggering and a complete and correct management of
cascading changes. One objective of this article is also to motivate graph database companies,
such as Neo4j, to support triggers as part of their standard ofer.</p>
    </sec>
    <sec id="sec-6">
      <title>Acknowledgments</title>
      <p>This work was carried out within the MICS (Made in Italy - Circular and Sustainable) Extended
Partnership and received funding from Next-Generation EU (Italian PNRR - M4 C2, Invest 1.3
D.D. 1551.11-10-2022, PE00000004). CUP MICS D43C22003120001. This work is part of Davide
Magnanimi’s Executive PhD program at Politecnico di Milano.
3Another option would be to use a total order based on the names of the triggers, as some relational databases do
(e.g., PostgreSQL; see https://www.postgresql.org/docs/current/sql-createtrigger.html).
[16] Nebula Graph, Nebula Graph, https://vaticle.com/, 2023. Last accessed online: Nov 20th,
2023.
[17] TigerGraph, TigerGraph, https://www.tigergraph.com/, 2023. Last accessed online: Nov
20th, 2023.
[18] GQL Manifesto, The GQL manifesto - one property graph query language, https://gql.</p>
      <p>today/, 2018.
[19] LDBC, LDBC Graph Query Working Group, https://ldbcouncil.org/gql-community/
overview/, 2023. Last accessed online: Nov 20th, 2023.
[20] R. Angles, M. Arenas, P. Barceló, P. Boncz, G. Fletcher, C. Gutierrez, T. Lindaaker,
M. Paradies, S. Plantikow, J. Sequeda, et al., G-CORE: A core for future graph query
languages, in: Proceedings of the 2018 International Conference on Management of Data,
Association for Computing Machinery, New York, NY, USA, 2018, pp. 1421–1432.
[21] C. Kankanamge, S. Sahu, A. Mhedbhi, J. Chen, S. Salihoglu, Graphflow: An active graph
database, in: Proceedings of the 2017 ACM International Conference on Management of
Data, Association for Computing Machinery, New York, NY, USA, 2017, pp. 1695–1698.
[22] K. Kim, I. Seo, W.-S. Han, J.-H. Lee, S. Hong, H. Chafi, H. Shin, G. Jeong, Turboflux: A
fast continuous subgraph matching system for streaming graph data, in: Proceedings of
the 2018 International Conference on Management of Data, Association for Computing
Machinery, New York, NY, USA, 2018, pp. 411–426.
[23] solid IT consulting, DB-Engines ranking of graph DBMS, https://db-engines.com/en/
ranking/graph+dbms, 2023.
[24] opencypher, http://www.opencypher.org/, 2023.
[25] Dgraph, Dgraph Lambda, https://dgraph.io/blog/post/dgraph-lambda/, 2023. Last accessed
online: Nov 20th, 2023.
[26] W3C, SPARQL, https://www.w3.org/TR/rdf-sparql-query/, 2023. Last accessed online: Nov
20th, 2023.
[27] Dgraph, Dgraph, https://dgraph.io/, 2023. Last accessed online: Nov 20th, 2023.
[28] Stardog, Stardog, https://www.stardog.com/, 2023. Last accessed online: Nov 20th, 2023.
[29] Ontotext, GraphDB, https://www.ontotext.com/, 2023. Last accessed online: Nov 20th,
2023.
[30] Oracle, Graph Database and Graph Analytics, https://www.oracle.com/database/graph/,
2023. Last accessed online: Nov 20th, 2023.
[31] OpenLink, Virtuoso, https://virtuoso.openlinksw.com/, 2023. Last accessed online: Nov
20th, 2023.
[32] Bitnine, AgensGraph, https://bitnine.net/agensgraph, 2023. Last accessed online: Nov 20th,
2023.
[33] Microsoft, Azure Cosmos DB, https://azure.microsoft.com/services/cosmos-db, 2023. Last
accessed online: Nov 20th, 2023.
[34] OrientDB, OrientDB, https://orientdb.org/, 2023. Last accessed online: Nov 20th, 2023.
[35] ArangoDB, ArangoDB, https://www.arangodb.com/, 2023. Last accessed online: Nov 20th,
2023.
[36] J. Widom, S. Ceri, Standards and commercial systems, in: J. Widom, S. Ceri (Eds.), Active
database systems: Triggers and rules for advanced database processing, Morgan Kaufmann,
1996, pp. 233–258.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>S.</given-names>
            <surname>Sakr</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Bonifati</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Voigt</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Iosup</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Ammar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Angles</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Aref</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Arenas</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Besta</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P. A.</given-names>
            <surname>Boncz</surname>
          </string-name>
          , et al.,
          <article-title>The future is big graphs: a community view on graph processing systems</article-title>
          ,
          <source>Communications of the ACM</source>
          <volume>64</volume>
          (
          <year>2021</year>
          )
          <fpage>62</fpage>
          -
          <lpage>71</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>A.</given-names>
            <surname>Green</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Furniss</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Lindaaker</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Selmer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Voigt</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Plantikow</surname>
          </string-name>
          , Iso,
          <source>tech. rep: GQL scope and features</source>
          , https://s3.amazonaws.com/artifacts.opencypher.org/website/materials/ sql-pg-2018
          <string-name>
            <surname>-0046r3-GQL-Scope-</surname>
          </string-name>
          and-Features.pdf,
          <year>2019</year>
          . Last accessed online:
          <source>Nov</source>
          <year>20th</year>
          ,
          <year>2023</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>A.</given-names>
            <surname>Bonifati</surname>
          </string-name>
          , G. Fletcher,
          <string-name>
            <given-names>H.</given-names>
            <surname>Voigt</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Yakovets</surname>
          </string-name>
          , Querying Graphs, Springer International Publishing, Cham,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>R.</given-names>
            <surname>Angles</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Bonifati</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Dumbrava</surname>
          </string-name>
          , G. Fletcher,
          <string-name>
            <given-names>K. W.</given-names>
            <surname>Hare</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Hidders</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V. E.</given-names>
            <surname>Lee</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Libkin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Martens</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Murlak</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Perryman</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Savković</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Schmidt</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Sequeda</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Staworko</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Tomaszuk</surname>
          </string-name>
          , PG-Keys:
          <article-title>Keys for Property Graphs</article-title>
          ,
          <source>in: Proceedings of the 2021 International Conference on Management of Data</source>
          , Association for Computing Machinery, New York, NY, USA,
          <year>2021</year>
          , pp.
          <fpage>2423</fpage>
          -
          <lpage>2436</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>R.</given-names>
            <surname>Angles</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Bonifati</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Dumbrava</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Fletcher</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Green</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Hidders</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Libkin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Marsault</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Martens</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Murlak</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Plantikow</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Savković</surname>
          </string-name>
          , et al.,
          <string-name>
            <surname>PG-Schema</surname>
          </string-name>
          :
          <article-title>Schemas for Property Graphs</article-title>
          ,
          <source>in: Proceedings of the 2023 International Conference on Management of Data</source>
          , Association for Computing Machinery, New York, NY, USA,
          <year>2023</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>K. P.</given-names>
            <surname>Eswaran</surname>
          </string-name>
          ,
          <article-title>Aspects of a trigger subsystem in an integrated database system</article-title>
          ,
          <source>in: Proceedings of the 2nd International Conference on Software Engineering</source>
          , ICSE '76, IEEE Computer Society Press, Washington, DC, USA,
          <year>1976</year>
          , p.
          <fpage>243</fpage>
          -
          <lpage>250</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>J.</given-names>
            <surname>Widom</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Ceri</surname>
          </string-name>
          ,
          <article-title>Active database systems: Triggers and rules for advanced database processing</article-title>
          , Morgan Kaufmann,
          <year>1995</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>J.</given-names>
            <surname>Melton</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. R.</given-names>
            <surname>Simon</surname>
          </string-name>
          , SQL:
          <year>1999</year>
          <article-title>: understanding relational language components</article-title>
          , Morgan Kaufmann Publishers Inc., San Francisco, CA, USA,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>S.</given-names>
            <surname>Ceri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Bernasconi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Gagliardi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Martinenghi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Bellomarini</surname>
          </string-name>
          , D. Magnanimi,
          <article-title>PGTriggers: Triggers for Property Graphs</article-title>
          ,
          <source>in: Proceedings of the 2024 ACM SIGMOD/PODS International Conference on Management of Data - SIGMOD</source>
          <year>2024</year>
          , June 9-15,
          <year>2024</year>
          , Santiago, Chile,
          <year>2024</year>
          . To appear.
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>APOC</given-names>
            <surname>Library</surname>
          </string-name>
          ,
          <article-title>Awesome Procedures for Neo4j 5.9.0.x (Extended), https://github.com/ neo4j-contrib/neo4j-apoc-</article-title>
          <string-name>
            <surname>procedures</surname>
          </string-name>
          ,
          <year>2023</year>
          . Last accessed online:
          <source>Nov</source>
          <year>20th</year>
          ,
          <year>2023</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>N.</given-names>
            <surname>Francis</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Green</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Guagliardo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Libkin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Lindaaker</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Marsault</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Plantikow</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Rydberg</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Selmer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Taylor</surname>
          </string-name>
          , Cypher:
          <article-title>An evolving query language for property graphs</article-title>
          ,
          <source>in: Proceedings of the 2018 International Conference on Management of Data</source>
          , Association for Computing Machinery, New York, NY, USA,
          <year>2018</year>
          , pp.
          <fpage>1433</fpage>
          -
          <lpage>1445</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <fpage>Neo4j</fpage>
          , Neo4j, https://neo4j.com/,
          <year>2023</year>
          . Last accessed online:
          <source>Nov</source>
          <year>20th</year>
          ,
          <year>2023</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <surname>Memgraph</surname>
          </string-name>
          , Memgraph, https://memgraph.com/,
          <year>2023</year>
          . Last accessed online:
          <source>Nov</source>
          <year>20th</year>
          ,
          <year>2023</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14] JanusGraph, JanusGraph, https://janusgraph.org/,
          <year>2023</year>
          . Last accessed online:
          <source>Nov</source>
          <year>20th</year>
          ,
          <year>2023</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <surname>Amazon</surname>
          </string-name>
          , Amazon Neptune, https://aws.amazon.com/it/neptune/,
          <year>2023</year>
          . Last accessed online:
          <source>Nov</source>
          <year>20th</year>
          ,
          <year>2023</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>