• No results found

3.3 Reactive Languages

3.3.2 Reactive Languages for the Semantic Web

Reactivity plays an important role in realising the Semantic Web vision. The research on Semantic Web reactivity can profit from research results on Web reactivity that need to be adapted or extended. Moreover, approaches that cope with existing and upcoming Semantic Web technologies (by gradually evolving to- gether with these technologies) are more likely to leverage the Semantic Web endeavour. Along this line, of crucial importance for the Web and the Semantic Web is the lightness of technologies’ usage (in particular the languages’ usage) that should be approachable also by non-programmers.

The topic of reactivity on the Semantic Web has just begun to be investigated and, hence, leaves room for interesting research issues; some languages with reactive capabilities for the Semantic Web are touched on in the following.

RDFTL

RDFTL(RDF Triggering Language) [117, 118, 116] is an Event-Condition-Action rule language for RDF repositories that has evolved from the proposal introduced in [115], where it is shown how an Event- Condition-Action language for XML data can also be used for RDF data by making use of the XML serialisation of RDF. RDFTL operates on the RDF triples/graphs; it is a path-based language using path functions and expressions ´a la XPath adapted to the RDF data representation formalism.

Reactive Capabilities.The components of an ECA rule of the language:

event part insertions and deletions of resources (as instances of a given class) or of arcs specified by a triple. Instead of detecting replace operations, RDFTL has the ability to detect changes of arc targets.

condition part query consisting of conjunctions, disjunctions, and/or negations of path expressions; it represents a boolean-valued expression that can make use of a $deltavariable having as set of in- stantiations the values that have triggered the rule.

action part sequence of one or more actions, where each action represents an insertion or deletion of a resource given by its URI, or an insertion, deletion, or update of an arc. The parts of RDFTL rules communicate just through the instantiations of variable $delta.

Arguably, because of its syntax, the structure of complex RDFTL programs is not easy to grasp. Also, detection of temporal combinations of events (composite events) is not supported.

3.3. REACTIVE LANGUAGES

Distributed Environment.A distributed version supporting ECA rules on distributed RDF repositories is under development as part of the SeLeNe project15. The project investigates self e-learning networks,

where such a network is a distributed repository of meta-data related to learning objects. The proposed architecture contains peers and super-peers, which coordinate a group of peers. However, the accent is on infrastructure issues and not e.g. on means for communication between the peers of the network.

Formal Semantics.Declarative semantics of language or language components is not provided. Though, the rule execution semantics of RDFTL is described. For this, a recursive function is used that takes as input an RDF graph and a sequence of updates to be performed. The function gives as output the final, updated graph (the sequence of updates is empty). The immediate coupling mode and rule prioritisation are used in RDFTL.

Implementation.The architecture of a system working on centralised systems and one on decentralised systems is proposed. Their implementation is ongoing work based on the ICS-FORTH RDFSuite repository [10].

Experimental Results. Not available yet, as the language is not fully implemented. The authors intend to experiment with the language using as testbed SeLeNe’s educational meta-data.

The RDFTL event-condition-action language for RDF data is a quite recent work towards a reactive Semantic Web; however, first results on RDFTL are promising.

Algae

Algae16is proposed by the W3C as a general-purpose RDF query language. Beside the querying capabili-

ties, Algae supports production rules that insert data into the RDF graph.

Reactive Capabilities. The concept of actionis used in Algae for the directivesask, assert, and fwrule; they determine the use of an expression specification for querying RDF data, for insertions into the data graph, or for specifying simple ECA rules. The first directive is mandatory for an Algae processor, the other two are defined in an extension module17. Besides insertions of RDF data, no other update

capabilities (deletions, replacements) are supported. More complex updates (e.g. ordered conjunction of updates) are not provided. The rule extension to Algae supports just production rules (as simple form of ECA rules).

Algae is based on N-triples18 for representing and querying RDF triples; the syntax is extended with

the mentioned directives and constraints’ specifications (e.g. arithmetic or string based). Formal Semantics.No formal semantics is provided.

Implementation.Algae has been implemented as part of the Annotea Project19; the project provides a

research platform for collaborative applications based on meta-data. Experimental Results.Such results have not been published so far.

15SeLeNe project,http://www.dcs.bbk.ac.uk/selene/ 16Algae,http://www.w3.org/2004/05/06-Algae/

17Algae Extension for Rules,http://www.w3.org/2004/06/20-rules/ 18N-triples,http://www.w3.org/TR/rdf-testcases/

Part II

The Language XChange

CHAPTER

FOUR

Paradigms. Concepts. Syntax

Reactivity on the Web is the ability to detect simple and composite events that occur on the Web and respond in a timely manner. It is an emerging research issue promising useful technologies for upcoming Web systems. Many Web-based systems need to have the capability toupdate datafound at (local or remote) Web resources, toexchange informationabout events (such as executed updates), and todetect and reactnot only to simple events but also to complex, real-life situations. The issue of updating data plays an important role, for example, in e-commerce systems receiving and processing buying or reservation orders. The issues of notifying, detecting, and reacting upon events of interest begin to play an increasingly important role within business strategy on the Web, and event-driven applications are being more widely deployed: terms such as zero latency enterprise, the real-time enterprise, and on-demand computing are being used to describe a vision in which events recognised anywhere within a business can immediately activate appropriate actions across the entire enterprise and beyond.

In order to meet (most of) the requirements for realising reactivity on the Web, which have been re- vealed by developing use cases such as the one presented in Section 1.2, the novel languageXChange [50, 49, 43, 25, 47, 19, 18, 48, 24, 17] for programming reactive behaviour and distributed applications on the Web has been developed. XChange is a high-level programming language; its name mirrors (some of) the main features an approach to reactivity on the Web should have:exchangeof information about events andchange(or update) of data as reaction to (local or remote) events. The language XChange has been carefully designed so as to mirror clear design principles by the syntax of the language.

Event-Condition-Action (ECA) rules are a natural candidate to implement reactive functionality. An XChange program consists of one or more ECA rules of the formEvent Query – Web Query – Action. They specify to execute theActionas an automatic response to the occurrence of a situation specified by anEvent Query, provided theWeb Querycan be evaluated successfully. This chapter provides a detailed discussion on each of the three components of an XChange reactive rule. An XChange program runs locally at some Web site — called XChange-aware Web site. It can access and modify local and remote data (Web resources) as reaction to events. Typical events include updates of data, timer events, but can also be high-level, application-dependent events, e.g. the cancellation of a flight. Programs exhibit global behaviour by reacting to changes at (remote) Web sites. In turn, these reactions can trigger further reactions at other Web sites.

The structure of this chapter is as follows: Section 4.1 presents the paradigms upon which the language XChange is built. Section 4.2 introduces the concept ofeventand discusses the kinds of events XChange supports. Section 4.3 introducesevent messagesas means for representing event data. Section 4.4 discusses means for specifying (classes of) events of interest that might require a reaction; it introducesevent queries – queries against event data – by discussing their essential traits, their kinds, and also the notion of answer to an event query in XChange. Section 4.5 offers a short discussion on Web queries in XChange. Section 4.6 introduces means for updating data with XChange, it discusses XChange’supdate patternsand their constructs for specifying insertions, deletions, and replacements of data. Section 4.7 offers a discussion on complex updates in XChange and the concept of transactions comprising updates. The chapter ends with Section 4.8, an introduction into XChange rules that puts together the puzzle pieces discussed throughout

4.1. PARADIGMS