Analysis and optimisation of event-condition-action rules on XML
Introduction
Event-condition-action (ECA) rules are used to provide reactive functionality in many settings, including active databases [31], [35], workflow management, network management, personalisation and publish/subscribe technology [4], [16], [17], [20], [29], [32], and specifying and implementing business processes [2], [19], [26].
In this paper we propose a simple ECA rule language for providing reactive functionality over corpora of XML documents. The motivation for this work is the increasing use of XML as a mechanism for data warehousing—see for example recent extensions of commercial database systems to support storage, viewing and exporting of XML data, and discussions in [1], [16], [21], [23], [29], [33]. In this context, there is a need for incremental maintenance of the materialised views in the XML data warehouse, for validating and cleansing the input data streams, and for maintaining audit trails of the data. By analogy to their use in conventional databases, ECA rules can be used as an integrating technology for providing this kind of reactive functionality on corpora of XML documents. For a `push' type environment, ECA rules are a mechanism for automatically broadcasting information to subscribers as the contents of relevant documents change. They can also be employed as a flexible means for maintaining statistics about document and Web site usage and behaviour.
One of the key recurring themes regarding the successful deployment of ECA rules is the need for techniques and tools for analysing and optimising their behaviour [18], [19], [27]. Thus, the second part of this paper explores techniques for analysing and optimising our proposed ECA rule language for XML.
The closest work to ours is [15], [16], [17], [26]. Ref. [26] describes a language for interacting with XML sources on the Web which incorporates ECA rules. However, details of the syntax and semantics of these rules are not given, and their analysis and optimisation are not addressed. Ref. [16] discusses extending XML repositories with ECA rules in order to support e-services. Active extensions to the XSLT [39] and Lorel [1] languages are proposed which handle insertion, deletion, and update events on XML documents—in contrast, we consider only insertion and deletion events here (see Section 2 below). It is proposed in [16] that analysis techniques developed for conventional active databases can be applied to these extended languages too but details are not given. Ref. [17] discusses a more specific application of the approach to push technology where rule actions are methods that cannot update the repository, and hence cannot trigger other rules.
A more recent paper [15] also defines an active rule language for XML, but is not concerned with rule analysis. The rule syntax it describes is similar to the one we define here, the rule format being based on the definition of triggers in SQL3. Its rule execution semantics is rather different from the model we adopt, however. Generally speaking, insertions and deletions of XML data (so-called bulk statements) may involve document fragments of unbounded size. Ref. [15] describes a semantics whereby each (top-level) update is decomposed into a sequence of smaller updates (which depend on the contents of the fragment being inserted/deleted) and then trigger execution is interleaved with the execution of these smaller updates. In contrast, we treat each top-level update as atomic and trigger execution is invoked only after completion of the top-level update. In general, these semantics may produce different results for the same top-level update and it is a question of future research to determine their respective suitability in different applications.
Other related work is [29], [33]. Ref. [29] discusses monitoring and subscription in Xyleme, an XML warehouse supporting subscription to Web documents. A set of alerters monitor simple changes to Web documents. A monitoring query processor then performs more complex event detection and sends notifications of events to a trigger engine which performs the necessary actions, including creating new versions of XML documents. The focus of this reactive functionality is highly tuned to this specific application.
Ref. [33] proposes extensions to the XQuery language [40] to incorporate update operations (we refer the reader to that paper for a review of the provision of update facilities in other XML manipulation languages). The update operations proposed are more expressive than the actions supported by our ECA rule language since they also include renaming and replacement operations, and specification of updates at multiple levels of documents. Triggers are discussed in [33] as an implementation mechanism for deletion operations on the underlying relational store of the XML. However, provision of ECA rules at the “logical” XML level is not considered.
This paper is structured as follows. Section 2 defines a simple language for specifying ECA rules on XML documents. The language is illustrated by means of some examples, and its syntax and semantics are then specified more formally. Section 3 discusses techniques for analysing rule behaviour, including issues such as triggering and activation relationships between rules, and a more sophisticated analysis technique based on abstract interpretation. Section 4 discusses techniques for optimising the execution of our ECA rules. Section 5 gives our concluding remarks and outlines directions for further work.
Section snippets
The ECA rule language
An XML database consists of a set of XML documents. ECA rules on XML databases take the following form:
on event
if condition
do actions
We first illustrate our ECA rules by means of three examples. We then define their syntax and semantics more formally. Example 1 The following XML database consists of one document which lists the books and magazines held by a bookstore, where the books-in-stock element summarises the ISBN numbers of books that are currently in stock, i.e., whose quantity-in-stock value is
Analysing ECA rule behaviour
Analysis of ECA rules in active databases is a well-studied topic, with a number of approaches appearing in the literature, e.g., [5], [6], [8], [10], [11], [12], [13], [14], [19], mostly in the context of relational databases. A key analysis question is that of termination of the rule execution, and a set of ECA rules is said to be terminating if for any initial event and any initial database state, the rule execution terminates.
Triggering and activation relations between rules have been used
Optimising ECA rule execution
A number of techniques can be used for optimising the execution of our XML ECA rules:
- (i)
The triggering relationships between rules derived using the techniques discussed in Section 3.1 can be used at runtime in order to optimise event detection in the updateDB function described in Section 2.2.
In particular, if it is known that the action a just applied to the database by updateDB cannot trigger a rule i, then there is no need to evaluate rule i's event query on the new database and the set
Conclusions
We have proposed a simple ECA rule language for providing reactive functionality on XML databases, and have developed new techniques for analysing the triggering and activation dependencies between XML ECA rules. By combining these new techniques with recent theoretical results regarding containment and equivalence of XPath/XQuery expressions, and with analysis and optimisation approaches for ECA rules that were developed for conventional databases, we have thus proposed a number of techniques
James Bailey received a B.E. and B.Sc. in 1993 and a Ph.D. in 1998 from the University of Melbourne. His doctoral research examined the foundations of active rule analysis. From 1998 to 2000, he was a Postdoc and then Lecturer at the University of London (King's and Birkbeck Colleges). He is currently a Lecturer at the University of Melbourne and his research interests include active rules, computation on the World Wide Web, data mining and agent systems.
References (40)
- et al.
Relational transducers for electronic commerce
JCSS
(2000) - S. Abiteboul, J. McHugh, M. Rys, V. Vassalos, J.L. Wiener, Incremental maintenance for materialized views over...
- A. Adi, D. Botzer, O. Etzion, T. Yatzkar-Haham, Push technology personalization through event correlation, in: Proc....
- et al.
Behaviour of database production rules: termination confluence and observable determinism
- et al.
Static analysis techniques for predicting the behavior of active database rules
ACM TODS
(1995) - S. Amer-Yahia, S. Cho, L.V.S. Lakshmanan, D. Srivastava, Minimization of tree pattern queries, in: Proc. ACM SIGMOD...
- J. Bailey, A. Poulovassilis, An abstract interpretation framework for termination analysis of active rules, in: Proc....
- J. Bailey, A. Poulovassilis, C. Courtenage, Optimising active database rules by partial evaluation and abstract...
- J. Bailey, A. Poulovassilis, P. Newson. A dynamic approach to termination analysis for active database rules, in: Proc....
Improved rule analysis by means of triggering and activation graphs
Compile-time and runtime analysis of active behaviors
IEEE Transactions on Knowledge and Data Engineering
An algebraic approach to static analysis of active database rules
ACM TODS
Active rules for XML: a new paradigm for e-services
VLDB Journal
Designing Database Applications with Objects and Rules: The IDEA Method
Cited by (25)
From policy implementation to business process management: Principles for creating flexibility and agility
2012, Government Information QuarterlyCitation Excerpt :The ‘action’ describes the actions to be performed if the rule fires. These actions may in turn cause further events to occur, which may in turn cause more ECA rules to fire (Bailey, Poulovassilis, & Wood, 2002). ECA allows the invocation of services according to the real-time situation, e.g., applying different versions of a policy based on the time of the submitted request.
An approach to grid resource selection and fault management based on ECA rules
2008, Future Generation Computer SystemsCitation Excerpt :We refer the reader to [13,14] for a general discussion of ECA rules in databases, where they are more commonly known as triggers and where they are used for activities such as incremental maintenance of materialized views and replicas, constraint enforcement, and maintaining audit trails and database usage statistics. More broadly, ECA rules have also been used in workflow management, network management, personalization, and publish/subscribe technology [15–23]. There are several advantages in using ECA rules to implement an application’s reactive functionality, rather than encoding it in application code [12].
Event-condition-action rules on RDF metadata in P2P environments
2006, Computer NetworksCitation Excerpt :Developing ECA rule support for RDF in a large-scale distributed application such as SeLeNe was a major motivation for the evolution of our RDFTL language. One precursor of the work presented here is the XML ECA Language described in [9,10]. This language uses a fragment of XPath for querying XML documents within the event and condition parts of rules, and an XML update language for specifying the rule actions.
Real time user adaptation and collaboration in web based cognitive stimulation for elderly people
2016, Advances in Intelligent Systems and ComputingXTrigger: XML database trigger
2014, Computer Science - Research and DevelopmentQuality of service management by active grid information server in grid computing
2012, Network Quality of Service
James Bailey received a B.E. and B.Sc. in 1993 and a Ph.D. in 1998 from the University of Melbourne. His doctoral research examined the foundations of active rule analysis. From 1998 to 2000, he was a Postdoc and then Lecturer at the University of London (King's and Birkbeck Colleges). He is currently a Lecturer at the University of Melbourne and his research interests include active rules, computation on the World Wide Web, data mining and agent systems.
Alexandra Poulovassilis received a B.A. degree in Mathematics from Cambridge University (Trinity College) in 1982. During 1983–1985 she worked with IBM Greece. She obtained M.Sc. and Ph.D. degrees in Computer Science from London University (Birkbeck College) in 1986 and 1990 respectively. Her doctoral research was in the area of functional database languages. She is currently a Professor at Birkbeck College and a member of the Database and Web Technologies Group. Her current research interests are active rules, data integration, database programming languages, heterogeneous databases, and web dynamics.
Peter Wood received a B.Sc. degree in 1977 and an M.Sc. degree in Computer Science in 1982, both from the University of Cape Town (UCT), South Africa. He worked for the Institute for Applied Computer Science at the University of Stellenbosch during 1983 and 1984, before leaving for the University of Toronto where he received a Ph.D. in Computer Science in 1989. After spending a number of years as a member of the Departments of Computer Science at UCT and then King's College London, he joined Birkbeck College as a Senior Lecturer in January 2001. His research interests include database query languages, query optimisation, active and deductive rule languages, and graph algorithms.