XChange: A rule-based language for programming reactive behavior on the Web

Reactivity on the Web is an emerging research issue covering: updating data on the Web, exchanging information about events (such as executed updates) between Web nodes, and reacting to combinations of such events. Reactivity plays an important role for upcoming Web systems such as online marketplaces, adaptive Web and Semantic Web systems, as well as Web services and Grids.

Following a declarative approach to reactivity on the Web, a novel reactive, rule-based language called XChange (see publications) has been developed. The language XChange follows clear paradigms that aim at providing a better language understanding and ease programming. XChange paradigms:

 

    • Event vs. Event Query. An event is a happening to which each Web site may decide to react in a particular way or not to react to at all. One might argue that defining an event in such a way is too vague. The intention here is to emphasise that one can conceive every kind of changes on the Web as events. However, each Web-based reactive system can be interested in different types of events or in different combinations of (like a given temporal order between) such events. Thus, the large spectra of possible events are always filtered relatively to one’s interests. In order to notify Web nodes about events and to process event data, events need to have a data representation. In XChange, incoming events are represented as XML documents.Event queries are queries against event data. Event query specifications differ considerably from event representations (e.g. event queries may contain variables for selecting parts of the events’ representation). Most proposals dealing with reactivity do not significantly differentiate between event and event query. Overloading the notion of event precludes a clear language semantics and thus, makes the implementation of the language and its usage much more difficult. Event queries in XChange serve a double purpose: detecting events of interest and temporal combinations of them, and selecting data items from events’ representation. This double purpose is novel in the field of reactivity and reactive rules.

 

 

    • Volatile vs. Persistent Data. The development of the XChange language – its design and its implementation – reflects the novel view over the Web data that differentiates between volatile data (event data communicated on the Web between XChange programs) and persistent data (data of Web resources, such as XML or HTML documents). The clear distinction between volatile and persistent data aims at easing programming and avoiding the emergence of a parallel Web of events.

 

 

    • Rule-Based Language. Reactivity can be specified and realised by means of reactive rules. XChange is a rule-based language that uses reactive rules for specifying the desired reactive behavior and deductive rules for constructing views over Web resources’ data.An XChange program is located at one Web site and contains reactive rules, more precisely Event-Condition-Action rules (ECA rules) of the form Event query – Web query – Action. Every incoming event is queried using the event query (query against volatile data). If an answer is found and the Web query (query to persistent data) has also an answer, then the Action is executed. The fact that the event query and the Web query have answers determines the rule to be fired; the answers influence the action to be executed, as information contained in the answers are generally used in the action part.

 

    • Pattern-Based Approach. XChange is a pattern-based language: event queries, Web queries, event raising specifications, and updates describe patterns for events requiring a reaction, Web data, raising event messages, and updating Web data, respectively. Patterns are templates that closely resemble the structure of the data to be queried, constructed, or modified, thus being very intuitive and also straight-forward to visualize.

 

    • Processing of Events
        • Local Processing and Incremental Evaluation. Event queries are processed locally at each XChange-aware Web node. For efficiency reasons, (composite) event queries are evaluated in an incremental manner.
        • Bounded Event Lifespan. An essential aspect of XChange is that each XChange-aware Web node controls its own event memory usage. In particular, the size of the event history kept in memory depends only on the event queries posed at this Web node. This is consistent with the clear distinction between events as volatile data and standard Web data as persistent data.

       

 

    • Relationship Between Reactive and Query Languages. A working hypothesis of the XChange project is that a reactive language for the Web should build upon a Web query language. XChange embeds the (Semantic) Web query language Xcerpt.

XChange

 

 

XChange: an ongoing research project

The design, the core language constructs, and the semantics of XChange are completed. The proof-of-concept implementation follows a modular approach that mirrors the operational semantics. Issues of efficiency of the implementation, esp. for event detection and update execution, are subject to future work.

Acknowledgements

This research has been funded by the European Commission and by the Swiss Federal Office for Education and Science within the 6th Framework Programme project REWERSE number 506779.

Share this

Leave a comment

Solverwp- WordPress Theme and Plugin