Mayleen Lacouture
email: mayleen.lacouture@mines-nantes.fr

Hervé Grall
email: herve.grall@mines-nantes.fr

Thomas Ledoux
email: thomas.ledoux@inria.fr

CREOLE: a Universal Language for Creating, Requesting, Updating and Deleting Resources *

In the context of Service-Oriented Computing, applications can be developed following the REST (Representation State Transfer) architectural style. This style corresponds to a resourceoriented model, where resources are manipulated via CRUD (Create, Request, Update, Delete) interfaces. The diversity of CRUD languages due to the absence of a standard leads to composition problems related to adaptation, integration and coordination of services. To overcome these problems, we propose a pivot architecture built around a universal language to manipulate resources, called CREOLE, a CRUD Language for Resource Edition. In this architecture, scripts written in existing CRUD languages, like SQL, are compiled into CREOLE and then executed over different CRUD interfaces. After stating the requirements for a universal language for manipulating resources, we formally describe the language and informally motivate its definition with respect to the requirements. We then concretely show how the architecture solves adaptation, integration and coordination problems in the case of photo management in Flickr and Picasa, two well-known service-oriented applications. Finally, we propose a roadmap for future work. * This work has been partially supported by

Introduction

The growth of Internet has extended the scope of software applications, leading to Service-Oriented Computing (SOC): it is a new computing paradigm that utilizes services as the basic construct to develop distributed applications, even in heterogeneous environments. To date, there are two popular -and often antagonistic -models for service-oriented computing [START_REF] Pautasso | web services: making the right architectural decision[END_REF], which we now describe as a process-oriented model and a resource-oriented one.

First, interoperability and integration issues have led to the development of WS-* services technology, mainly based on XML and SOAP. Upon services, which group together operations, processes are defined with orchestration languages, like the Business Process Execution Language components to exchange information and to use the information that has been exchanged 1 .Without interoperability, we are faced with composition problems related to adaptation, integration and coordination of heterogeneous services. By adaptation, we mean the problem of switching from one service provider to another without affecting its clients. By integration, we mean the problem of providing a unified interface for a set of resources managed by different CRUD interfaces. By coordination, we mean the problem of executing different scripts, possibly written in different languages, attempting to manipulate the same resources managed by one CRUD interface.

The pivot architecture described in Figure 1 solves these problems. It is built around a universal language for manipulating resources, called CREOLE (CRUD Language for Resource Edition). Scripts written in existing CRUD languages, like SQL, are compiled into the pivot language CRE-OLE and then executed over different CRUD interfaces, like Picasa's or Flickr's. To be effective, a pivot architecture relies on two assumptions. First, it must be possible to compile from any source language to the pivot language. We will briefly see that the language CREOLE satisfies this universality property with respect to CRUD languages. Thanks to this property, scripts written in different CRUD languages can be coordinated by using the Mediator design pattern [13, p. 273]. Second, it must be possible to interface the language CREOLE with the applications manipulating resources, characterized by their own resource representation and CRUD interface. We will see that the design of these interface connectors, called in the following built-in virtual machines, is akin to the design of RESTful Web services [START_REF] Pautasso | web services: making the right architectural decision[END_REF]. We also use other virtual machines, dedicated to the execution of the scripts written in the pivot language CREOLE. To resolve the adaptation and integration issues, the virtual machines are organized following two other design patterns, namely the Adapter and the Facade patterns [13, pp. 139, 185], for adaptation and integration respectively.

We identify several advantages of the pivot architecture. First, using a pivot language avoids the combinatorial explosion of translations, from multiple CRUD languages to different CRUD interfaces. Then, developers are allowed to program in their favorite CRUD language such as SQL or XQuery, with the additional advantage of being able to profit from the specific features offered by each language. Moreover, existing scripts written in different high-level languages can be executed on different CRUD interfaces without the need to be rewritten. Finally, the proposed pivot architecture overcomes the composition problems related to adaptation, integration and coordination. 1 According to the IEEE Standard Computer Dictionary.

Related work

In linguistics, a pivot language is an artificial or natural language used as an intermediary language for easing translation between many different languages (e.g. Interlingua, english). In computing, for analogous reasons, pivot infrastructures built around an intermediate language have been successful. For instance, virtual machines with their bytecode language are now common, allowing programs written in different languages to be compiled and executed over different architectures and systems (e.g. Java VM, .NET).

The pivot architecture can also benefit from techniques for the generation of mediators, adapters and facades. Instead of a manual generation as in Section 5, an automatic generation is possible, as exemplified by Brogi and Popescu [START_REF] Brogi | Automated Generation of BPEL Adapters[END_REF] for BPEL processes, and by Mateescu, Poizat and Salaün for processes represented as symbolic transitions systems and also implemented in BPEL [START_REF] Mateescu | Adaptation of Service Protocols Using Process Algebra and On-the-Fly Reduction Techniques[END_REF].

The main difficulty in a pivot architecture remains the design of the pivot language and its associated virtual machine. Various calculi, described in Bruni's comprehensive synthesis [START_REF] Bruni | Calculi for Service-Oriented Computing[END_REF], have been proposed with the aim to capture aspects of service-oriented computing, from a verification or a modeling point of view but also from a formalization and programming point of view, which is related to our approach. However, these calculi are essentially process-oriented and not resource-oriented. As for the resource-oriented model, limited research have been undertaken in the formalization of RESTful Web services. Recently, Garrote and Moreno have proposed a language [START_REF] Garrote | A Formal Definition of RESTful Semantic Web Services[END_REF] combining a process calculus for the exchanges of messages and the coordination language LINDA [START_REF] Gelernter | Generative Communication in Linda[END_REF] for the description of resource computations. Our solution presents the same two layers: a process language for distribution and a script language for resource computations, which as in Linda, includes operations for adding and deleting data in a shared dataspace, as we will see in the next sections.

Requirements and design rationale for the pivot language

First, we attempt to identify some essential requirements for the language CREOLE, considered as the language for editing resources at the heart of the pivot architecture. Second, we motivate the design with respect to the requirements.

Requirements The requirements can be split into two parts: general ones, relative to serviceoriented computing, and particular ones, relative to the resource-oriented model.

Starting from the analysis led by Caires, Seco and Vieira [24, Sect. 2], and a general presentation of service-oriented computing [START_REF] Huhns | Service-Oriented Computing: Key Concepts and Principles[END_REF], we have identified four general requirements: distribution, process delegation, scope management, and dynamic service binding. We do not deal with the requirements about distribution and process delegation, already well described by Caires et al. [START_REF] Vieira | The Conversation Calculus: a Model of Service Oriented Computation[END_REF], but we focus on scope management and dynamic binding.

A client and a server execute in different contexts: entities used in the execution can be either local or shared between the server and the client. More interestingly, contexts dynamically evolve. For instance, a client can create a new session identifier that it sends to the server with its request. In its reply, the server also transmits the identifier that the client must use in order to relate the reply to its request. Thus, name creation and name extrusion turn out to be two essential requirements. Name extrusion naturally leads to dynamic service binding, when the name represents a service, via its location. Dynamic binding is used for service discovery [20, Fig. 1] and dynamic routing, for instance in a well-known service interaction pattern [START_REF] Barros | Service Interaction Patterns[END_REF] called Request with referral.

We have also identified requirements for the language CREOLE that are particular to the resourceoriented model: they deal with resource modeling and its consequences for a pivot language.

How to represent a resource? In the database field, since Codd's work, the data model has been defined as a relational model. Likewise, the markup language XML, used for representing data in web services, is founded on a relational model, as shown for instance by Benedikt and Koch's formalization of the query language XPATH [START_REF] Benedikt | XPath Leashed[END_REF]. We require that the language CREOLE adopts the relational model to represent resources, therefore assuming a logical approach. Following model theory, we represent resources as a structure, consisting of a universe and an interpretation over the universe of each relation in some signature, used to define the class of the resources considered.

Choosing the relational model results in two requirements for CREOLE, since a pivot language must satisfy two properties, universality and ability to interface, as seen in Section 2.

The relational model is equipped with natural operators, leading to the relational algebra: selection, projection, Cartesian product, set union, set difference, and renaming. We therefore require that the language CREOLE can express all these operations. More generally, we require that the language can express any computable transformation between structures: the language must be universal with respect to the relational model. For instance, it must be able to express aggregation and recursion, two powerful features, found natively but separately in SQL2 and DATALOG3 respectively.

In the relational model, a resource is represented as a relational structure. It has a uniform interface, namely a CRUD interface. A resource can be created or deleted by adding its complete representation to the structure or removing it respectively. It can be requested by querying the content of the structure and updated by modifying the structure. We therefore require that the CRUD interfaces of the relational structures can be mapped to the CRUD interfaces of the resources managed by the applications to which the language CREOLE is connected.

Design rationale Just as the requirements are split into two parts, the language CREOLE is designed with two layers, one defining scripts for resource manipulation and one defining processes for distribution.

Consistent with our logical point of view for representing resources, our script language is first inspired by DATALOG [START_REF] Ceri | What You Always Wanted to Know About Datalog (And Never Dared to Ask)[END_REF], a query language for deductive databases, in other words for structures in the relational model. However, DATALOG has a major limitation: it cannot express the deletion or the update of resources. Its semantics is essentially monotone: the representation of resources always increases during computations. Several disconnected lines of research have addressed this problem, for instance Zaniolo et al. have extended DATALOG with a notion of choice [START_REF] Greco | Greedy Algorithms in Datalog[END_REF] or with aggregate operators [START_REF] Wang | User-Defined Aggregates in Database Languages[END_REF], and Ganzinger and McAllester [START_REF] Ganzinger | Logical Algorithms[END_REF] have allowed facts to be deleted and rules to be selected with priorities. Instead of using ad-hoc extensions, we choose to use linear logic as a foundation for our language. Two recent works have directly inspired our work.

First, Pfenning and Simmons have proposed a programming language in linear logic [START_REF] Simmons | Linear Logical Algorithms[END_REF]. Besides persistent predicates, as found in DATALOG, there are ephemeral predicates, corresponding to linear resources. The operational semantics alternates a monotone deduction that involves only persistent predicates and a commitment corresponding to the firing of a rule consuming ephemeral atoms, which are propositions built from ephemeral predicates. Second, Betz, Raiser and Frühwirth have defined an extension based on linear logic for the language Constraint handling Rules [START_REF] Frühwirth | Welcome to Constraint Handling Rules[END_REF] (CHR), a declarative language based on multiset rewriting, originally designed for writing constraint solvers and now employed as a general purpose language. They introduce persistent and ephemeral predicates [START_REF] Betz | A Complete and Terminating Execution Model for Constraint Handling Rules[END_REF] in order to ensure termination for so-called propagation rules, leading to a language akin to the preceding one.

Instead of using the distinction between persistent and ephemeral predicates, we use a distinction between relations and multi-relations. Multi-relations are multi-sets: an element in a multirelation may have multiple occurrences. Relations are sets: an element in a relation has a unique occurrence. Exhaustive duplicate eliminations transform a multi-relation into a relation. This distinction leads to a more primitive mechanism. Indeed, whereas an ephemeral predicate is simply encoded as a multi-relation, a persistent predicate is encoded as a relation, and not a multi-relation, that satisfies an extra condition: all atoms built from a persistent predicate must be preserved by rules. Persistence can therefore be encoded.

Finally, generalizing the preceding languages based on linear logic, our script language is based on multiset rewriting. Thus, it has also its roots in the chemical reaction model: it can be considered as a variant of the language GAMMA [START_REF] Banâtre | The GAMMA Model and Its Discipline of Programming[END_REF]. More precisely, it is a restriction of a coordination language with schedulers [START_REF] Chaudron | Towards a Compositional Method for Coordinating Gamma Programs[END_REF] for a variant of GAMMA. Indeed, we have considered as linear resources not only the atoms but also the rules: rules are consumed when they are fired, except when they are replicable. There is also a sequence operator, allowing rules to be organized in distinct phases.

We now come to the distribution layer. Our process language is directly inspired by the joincalculus, a process calculus that can also be considered as a language for multiset rewriting, with a chemical semantics [START_REF] Fournet | The reflexive CHAM and the join-calculus[END_REF]. The join-calculus is interesting because of its natural notion of location and its implementability in a distributed setting. Rules are organized in definitions that are located. Given a channel, which is equivalent to our notion of predicate (multi-relation or relation), all the rules consuming atoms built from this channel belong to the same definition. Whenever an atom is generated, it is migrated to the unique definition dealing with the associated channel: this mechanism mimics a call from a client to the definition acting as a server. The join-calculus is also interesting because of its ability to express dynamic binding: indeed, channels can be communicated. Likewise, predicates can be communicated in CREOLE.

Design and validation of the pivot language CREOLE

We describe CREOLE syntax and its two layers, defining scripts for resource manipulation and processes for distribution, respectively. Table 1 sums up this syntax 4 . We then give the semantics of the language. We end the section by validating the design against the requirements.

:= j 1 -→ ν v. j 2 If j 1 then j 2 with new names - → v - → v = FV( j 2 ) -FV( j 1 ) Molecule j ::= / 0 | a | j & j Conjunction of atoms Predicate X ::= R | M Relation or Multi-relation Atom a ::= X ( - → X , - → v )
Predicate applied to predicates and variables In that case, it must be bound by the rule: it must occur in j 1 . Finally, a CREOLE script can be seen as a specification of a schedule for rules. There are basic scripts, the empty one, which contains no rule and does nothing, and the singleton one, which contains a unique rule that can be fired only once. The parallel operator allows scripts to be concurrently active. For instance, the script r , r allows the rule r to be fired twice, whereas the script r , r allows the rules r and r to be fired exactly once each one, in any order. If a script needs to be executed an indefinite number of times, the replication operator can be used: for instance, the script r ω means that the rule r is always ready to be fired. There is also a sequential operator, at any depth, allowing the transformations defined by scripts to be sequentially composed. The distribution layer is defined around a process language: a process distributes scripts in a client-server architecture. The definition of a script is preceded with the declaration of the public predicates provided by the script. Two processes can be put in parallel: they execute concurrently without directly communicating. To enable a direct communication between two processes, the initial emitter or caller needs to be declared as a client, and the initial receiver or callee as a server. Consider the process let p s in (D)s, where p s is the server process and (D)s the client process, equal to a simple script s declaring public predicates in D. Each rule j 1 -→ ν v. j 2 defined in script s can use in j 1 and j 2 the predicates in D. But it can also produce in j 2 atoms built from predicates declared as public in the server process p s . In other words, a client can invoke a server. How does the server reply to the client? The client cannot directly consume atoms from predicates declared as public in the server process. Indeed, this interaction would violate the locality principle that we impose to the process language, in conformity with the join-calculus [START_REF] Fournet | The reflexive CHAM and the join-calculus[END_REF]: for each public predicate, there is one, and only one, script consuming this predicate, the script where the predicate is declared, which allows a very simple implementation for atom communication. Actually, the client must transmit to the server a reference to one of its own public predicate, which then can be used by the server to reply. Thus, we introduce second-order predicates, X ( -→ Y , -→ v ), which are applied to predicates -→ Y and variables -→ v , in addition to first-order predicates, X ( -→ v ), only applied to variables -→ v . Thus, the rule j 1 -→ ν v. j 2 can also produce in j 2 atoms built from predicates bound by j 1 . A predicate used in the script that is neither public nor bound is private: it is not usable outside of the script.

Semantics with distributed chemical abstract machines

The operational semantics of our script language is given by a reflexive chemical abstract machine [START_REF] Fournet | The reflexive CHAM and the join-calculus[END_REF]. Due to the lack of space, it is informally given in this paper, with some approximations. Its complete and accurate definition can be found in a technical report [START_REF] Grall | Linear logic as a foundation for service-oriented computing[END_REF].

A configuration γ of the machine consists of two parts, ρ σ , where ρ is the reaction part, a multiset of executing scripts, and σ is the solution part, a multiset of molecules. There is a standard structural congruence between configurations, as described by Berry and Boudol for the π-calculus [START_REF] Berry | The Chemical Abstract Machine[END_REF]. It expresses for the multiset union -denoted by a comma -associativity, commutativity and neutrality of the empty script and of the empty molecule -both denoted by / 0 -, and for the scope operator ν, the standard rules for name creation and extrusion. There are also two rules defining operators of the language: Fusion and fission ρ σ , j 1 & j 2 ≡ ρ σ , j 1 , j 2 Replication ρ , s ω σ ≡ ρ , s ω , s σ

Fission builds molecules from atoms whereas fusion is the reverse operation, which gives the meaning of the join operator &. As for the replication law, it gives the meaning of the replication operator: a replicated script is always available for execution. The execution of a configuration is defined in three steps. First the duplicate elimination eliminates every duplicated relational atom.

Duplicate elimination

ρ σ , R ( - → v ) , R ( - → v ) ρ σ , R ( - → v )
The duplicate elimination, with possible fusions to decompose molecules, is exhaustively performed between each reduction step to ensure that relational atoms occur at most once in a configuration. The chemical reduction → describes the basic reduction of the chemical abstract machine.

There are two main rules.

Reaction ρ ,( j 1 -→ ν v. j 2 ) σ , j 1 [τ] → ρ σ , ( -→ ν v. j 2 )[τ]
The first rule deals with the main mechanism, reaction. The reaction rule j 1 -→ ν v. j 2 is fireable when a molecule matches the molecule pattern j 1 . The firing generates a new molecule matching the molecule pattern j 2 , using new variables in -→ v ; it consumes not only the molecule matching the molecule pattern j 1 but also the reaction rule.

Sequence ¬(ρ 1 σ ⇒ ) ρ ,(ρ 1 ; ρ 2 ) σ → ρ , ρ 2 σ
The second rule deals with the sequence operator. When the left part ρ 1 of the sequence script does not progress, it can be skipped. It remains to define progression ⇒ from reduction. Assume that configuration γ 1 reduces to configuration γ 2 : γ 1 → γ 2 . After an exhaustive duplicate elimination, configuration γ 2 becomes configuration γ 3 . We say that the machine progresses from γ 1 to γ 3 , denoted γ 1 ⇒ γ 3 , if γ 1 is not structurally equivalent to γ 3 , γ 1 ≡ γ 3 . It means that either the reaction part, the solution part, or both, have changed.

Finally, the machine proceeds as follows. Starting from an initial configuration with no duplicates, it looks for a progression, possibly by using the fusion and fission rules and the replication rule. If no progression can happen, then the configuration is final. Otherwise, it nondeterministically chooses a possible progression, executes the associated reduction and exhaustively eliminates duplicates in the resulting configuration. Now, we come to the semantics of the process language. Given a process, we associate to each script (D + )s declared in the process a chemical abstract machine, called a virtual machine, having as interface the public predicates declared in D + . A distributed configuration δ contains two parts, a multiset of atoms a migrating between virtual machines and a set of local configurations [γ i ] D i , where for each virtual machine i associated to the process, γ i is its local configuration and D i = D + i ∪ D - i the declaration of its predicates, either public (in D + i ) or private (in D - i ). The progression relation between distributed configurations is an extension of the progression relation defined for an individual virtual machine.

Local γ i ⇒ γ i δ , [γ i ] D i ⇒ δ , [γ i ] D i
It also contains two rules for the migration of atoms.

Out a = X ( - → Y , - → v ) X / ∈ D i δ , [ρ i σ i , a] D i ⇒ δ , [ρ i σ i ] D i , a In a = X ( - → Y , - → v ) X ∈ D + i δ , [ρ i σ i ] D i , a ⇒ δ , [ρ i σ i , a] D i
After we have defined the syntax and the semantics of the language CREOLE, we now assess the design with respect to the requirements presented in Section 3.

Validation against requirements For validation, we consider the following requirements: distribution, with two aspects -implementation and expressivity -, scope management and dynamic service binding, script expressivity and ability to interface.

Thanks to its distributed semantics, implementing the language in a distributed context is easy. It suffices to assign to each script and its associated virtual machine a definite location like a Uniform Resource Locator (URL). Then each atom built from a public predicate needs to convey the location where the predicate is declared, in order to allow the atom to be migrated when it is produced in another virtual machine. The only communication primitive in CREOLE is atom migration, corresponding to an asynchronous one-way invocation. As an atom can contain as argument a predicate for reply, dynamic binding is present for predicates, allowing different request-reply interactions, synchronous or not, to be encoded. For instance, let s be the following server script: (I(K) K()) ω . Then an echo interaction can be described as follows: let (I)s in ( / 0 I(K)), (K() . . .). Scope is statically managed for predicates, with the distinction between public and private predicates. Name creation is available for variables, and name extrusion for predicates and variables. Thus, a virtual machine can control its state and share relevant names. For instance, the precedent example can be refined in order to manage a session, allowing the reply to be related to the request:

let (I)(I(x, K) K(x)) ω in ( / 0 ν x.I(x, K) &W (x)), (W (x) & K(x) . .

.).

As for the expressivity requirements with respect to the relational model, it is easy to show that any operation in the relational algebra can be encoded in our script language. Aggregation can also be encoded. For instance, the script / 0

C(0), C(n) & R(x) C(n + 1)
ω counts the number of elements in predicate R, assuming the availability of natural numbers, which can also be encoded in a straightforward manner. It is therefore possible to encode any SQL query in our script language, allowing the definition of a compiler. As for recursion, it is natively supported by our script language. For instance, DATALOG with negation, equipped with its well-founded semantics, can be encoded [START_REF] Grall | Linear logic as a foundation for service-oriented computing[END_REF].

In the relational model, resources are represented as relational structures, using multi-relations when the number of occurrences matters, and using relations otherwise. All CRUD operations over relational structures can be mapped to HTTP operations over resource representations, precisely to PUT, GET, POST and DELETE respectively. This correspondence paves the way for an implementation with RESTful Web services of the built-in virtual machines, connecting the language CREOLE to the applications manipulating resources.

Thus, the language CREOLE satisfies the requirements that we have defined. In the next section, we illustrate the use of our pivot architecture and language in a paradigmatic use case.

Use Case: Photo Management on Flickr and Picasa

Flickr and Picasa are Yahoo's and Google's respective photo management systems. They offer web interfaces (APIs) to enable client applications to publish and organize photos on-line. These interfaces are essentially CRUD interfaces, implemented as RESTful web services and allowing photos to be manipulated as resources. This section illustrates the use of our pivot architecture and of CREOLE to solve adaptation, integration and coordination problems in the case of photo management with Flickr and Picasa. Concretely, our solution is based on three general design patterns, Adapter, Facade and Mediator.

Problem I: Adaptation Yahoo proposes a SQL-like language called YQL to query web services as if they were tables. In YQL, web services are represented as virtual tables wherein columns are mapped to input and output parameters. For example, the Flickr CRUD interface contains a method called flickr.photo.counts to count photos in a given date range. This service is represented in YQL as a virtual table called PhotoCounts with fromDate and toDate as input columns and count as an output column. The method can be called from a YQL query, akin to a SQL query: This script is mapped to a call to method flickr.photo.counts. Columns fromDate and toDate correspond to the method's input parameters, and column count to one of the output parameters.

How can we adapt the YQL script to count photos on Picasa, knowing that its CRUD Interface does not offer a count operation? Figure 2 summarizes our approach. In (a), the YQL script is compiled into CREOLE, then executed on a virtual machine (C-VM). In (b), we implement a virtual machine (A-VM), an Adapter allowing to switch from Flickr to Picasa. In this schema, virtual machines can be compared to components whose provided interfaces are relations, represented here by flat rectangles. We now detail the approach. The fresh variable x, representing a session identifier, is used to relate the reply to the request. Note that the request transmits the relation CountsOut where it will obtain the reply.

The compiled YQL script is executed on a client virtual machine (C-VM). This virtual machine communicates with Flickr's built-in virtual machine (F-VM) which serves as a connector to Flickr's CRUD interface. Built-in virtual machines, like F-VM, are programmed to map CRUD operations over relations to RESTful Web services, accessed by HTTP requests.

In the second part of our solution, we create an adaptation virtual machine (A-VM) to adapt the desired behavior to Picasa's built-in virtual machine (P-VM). The following is the script executed in A-VM5 . To count the photos taken between the two dates, the script uses P-VM's relation PhotoCloning.

Given an identifier y, when the built-in virtual machine P-VM receives a request PhotoCloning(K, y) for the first time, it produces a relation containing the relevant photos, by addressing HTTP GET requests to the Picasa server and answers by sending a first photo using the relation K. Then at each request PhotoCloning(K, y), P-VM sends a new photo of the relation produced over K. When there is no more photo in the relation, it sends a photo with null as identifier. In the A-VM script, each time a photo is received, a request for another photo is sent (cf. lines 2 and 3); moreover, when the date of the photo satisfies the comparison criterion, the counter is incremented. When the null identifier is received, indicating that there are no more photos, the answer is sent to the client (cf. line 4). The whole script is replicated in order to indefinitely satisfy requests. Finally, to switch from Flickr to Picasa, all we need to do is to change the virtual machine used as a server, from F-VM to A-VM, as follows: let (CountsIn, ...) A-VM in C-VM. Nevertheless, CREOLE facilitates the implementation of an integration solution, like the one shown in Figure 3. In this schema, an intermediate virtual machine (I-VM), implementing a Facade, provides a common representation for photos in Flickr and Picasa, which is then used by the client virtual machine (C-VM). In this configuration, built-in virtual machines F-VM and P-VM provide both a relation to obtain photo information. As above, we call these relations FPhotoCloning and PPhotoCloning. Since the intermediate virtual machine (I-VM) holds a common representation for photos, it also provides a relation PhotoCloning, combining the attributes of Picasa's and Flickr's photos in the response. The following is the script corresponding to I-VM. The lists -→ p and -→ f contain the same attributes and are computed from some combination, between intersection and union, of attributes in -→ p and -→ f respectively. As a consequence, we can simultaneously execute queries of photos on both CRUD interfaces. For example, we could execute the script of the adaptation scenario to count all our photos on both Flickr and Picasa, by setting I-VM as the server instead of P-VM: let (PhotoCloning, ...) I-VM in A-VM.

Due to the lack of space, we have presented a simple scenario; nevertheless, there are more complicated differences between Flickr and Picasa that can be tackled with our approach. Consider, for instance, how photos are organized in both services: in Flickr, photos can be organized in sets but can also be on their own; in Picasa however, photos must belong to one and only one album. We can solve this problem by using a common representation for albums and sets, and then applying the same integration schema as in the example shown here.

Problem III: Coordination One of YQL's limitations is the lack of support for aggregation. With CREOLE it is possible to coordinate scripts written in different languages to take advantage of features provided by each language. Hence, we can combine YQL capacity for querying services as tables with SQL support for aggregation. In the example shown in Figure 4 The virtual table PhotoSearch is a representation of Flickr's method flickr.photo.search which takes min_taken_date and max_taken_date as input parameters. Note in the SQL query that R can be any relation since the query is not bound to a concrete database implementation.

The YQL and SQL queries are compiled into CREOLE and executed on a coordination virtual machine (C-VM). The C-VM virtual machine uses the relations PhotoSearch and SearchResult provided by the built-in virtual machine F-VM. Given an identifier x, when F-VM receives a request PhotoSearch(a, b, x), it produces a relation associated to x and containing the photos taken The script s initiates the search by calling the server F-VM. Then, each time a photo is received, a request for another photo is sent (cf. line 2). Finally, when there is no more photo, the script ends. At the same time, the SQL query is compiled into the following script t:

/ 0 Count(0), Count(n) & R( - → y ) Count(n + 1)
ω Finally, a third script c coordinates the previous scripts, implementing a Mediator:

Photo( - → y ) R( - → y ) ω
This script, in parallel with s and t, combines the outcomes of the YQL script s and the counting of the SQL script t with a renaming from Photo to R. It finally produce an atom Count(n), where n is the number of photos.

Conclusion and Future Work

In the context of Service-Oriented Computing, we have identified three main problems related to service composition, namely adaptation, integration and coordination, due to the absence of a unified model for manipulating resources. We have presented our approach to tackle these problems, consisting of a pivot architecture, where existing languages for manipulating resources are compiled into a pivot language, called CREOLE, and then executed over different resource interfaces, which are CRUD interfaces. We have mainly introduced CREOLE, a universal language for resource manipulation, which is at the heart of our solution. The motivating example of photo management on services like Flickr and Picasa has concretely shown how our proposed architecture solves adaptation, integration and coordination problems, and how CREOLE can be used either as a CRUD language or as a target language for the compilation from existing CRUD languages. Yet we have only explored the resource-oriented model for services. An extension towards the process-oriented model would be valuable: indeed, it will bring a unified foundation for serviceoriented computing. Actually, the two models share a lot of similarity, since they follow a same architecture with three layers. First, there are resources. Second, there are services, limited to CRUD operations for the resource-oriented model and extended to any computation for the processoriented model. Third, there are processes or scripts for orchestrating services.

Our future work has therefore two main objectives. First, we want to develop the formal foundations of the language CREOLE, as begun in our technical report [START_REF] Grall | Linear logic as a foundation for service-oriented computing[END_REF]. The main questions here are the development of the theory of the language, from operational semantics to bisimilarity, and the assessment of its expressive power. Second, we want to implement the language and the whole pivot architecture. Four questions are here important: implementation of the chemical abstract machine and of its distribution, design of compilers into CREOLE for existing languages like YQL and BPEL, design of a user-friendly programming language based on the core calculus presented here, implementation of built-in virtual machines by connecting to RESTful services and WS-* services. Thus, these objectives pave the way to a unified foundation for service-oriented computing, in a theoretical and practical perspective.

Figure 1 :

 1 Figure 1: A Pivot Architecture

  Process p ::= ( -→ X )s | let p in p | p , p Script or Let server used in client or Parallel Script s ::= / 0 | r | s , s | s ; s | s ω Skip or Rule or Parallel or Sequence or Replication Rule r :

  SELECT count FROM PhotoCounts WHERE fromDate ="01/01/2009" AND toDate="31/12/2009"

Figure 2 :

 2 Figure 2: Flickr-Picasa Adaptation To compile the YQL script into CREOLE, we map the virtual table PhotoCounts to relations CountsIn and CountsOut. Input columns fromDate and toDate are mapped to CountsIn's parameters, and output column count is mapped to CountsOut's last parameter. The following is the resulting CREOLE script: 1: / 0 ν x.CountsIn(x, "01/01/2009", "31/12/2009", CountsOut) & Session(x), 2: Session(x) & CountsOut(x, n) Result(n)

  Photo(id, date, -→ y ), where -→ x and -→ y do not have the same elements.

Figure 3 :

 3 Figure 3: Flickr-Picasa Integration

Figure 4 :

 4 Figure 4: Coordination

Table 1 :

 1

Language CREOLE -Scripts and processes Scripts and processes The most primitive entities in CREOLE are predicates, either multi-relations or relations, and variables. Atoms are built using predicates and variables: a predicate X can be applied to a sequence -→ Y of predicates, possibly empty, and to a sequence -→ v of variables, giving atom X( -→ Y , -→ v ). Atoms a 1 , . . . , a p can be joined together to make a molecule a 1 & . . . & a p . The core part of CREOLE scripts are reactions that transform molecules into other molecules. A reaction is specified by a rule j 1 -→ ν v. j 2 , transforming any molecule matching the molecule pattern j 1 to a new molecule matching the molecule pattern j 2 , using new variables in -→ v . A variable in j 2 is free if it occurs in j 2 without being declared in -→ v .

  , a YQL script to select photos taken between 01/01/2009 and 31/12/2009 is coordinated with a SQL script that counts rows from a given relation. Here are the corresponding YQL and SQL queries:

	SELECT * FROM PhotoSearch	SELECT COUNT(*) FROM R
	WHERE min_taken_date="01/01/2009"
	AND max_taken_date="31/12/2009"

See[START_REF] Gogolla | Formal semantics of SQL[END_REF] for a formalization of SQL's semantics.

See[START_REF] Ceri | What You Always Wanted to Know About Datalog (And Never Dared to Ask)[END_REF] for an introduction to DATALOG.

As usual, we denote by FV(t) the set of free variables occurring in the term t. The notation -→ x denotes a sequence of x, when the particular members of the sequence do not matter; the sequence may be empty.

For readability, the rule R & S R & Q is written R & S Q, where we have underlined the persistent atom R. We also use natural numbers, and the relations Between and NotBetween to compare dates, and Null and NotNull to test nullity, assuming their availability.

Acknowledgments We are grateful to the anonymous reviewers of FOCLASA 2010 for their useful suggestions to improve this paper.

the CESSA project (http://cessa.gforge.inria.fr/doku.php).