XMatch : A language for satisfaction-based selection of Grid services

Grid systems enable the sharing of a large number of geographically-dispersed resources among different communities of users. They require a mapping functionality for the association of users requests expressed in terms of requirements and preferences to actual resources. This functionality should deal with a potentially high number of similar resources and with the diversity of the perceived satisfactions of users. We propose XMatch, a query language enabling the expression of the user request in terms of the expected satisfaction over XML-based representation of available resources. This language offers a compact way for users to express their preferences for Grid resources and enable the maximization of the global preference.


Introduction
Grid systems follow a new paradigm of distributed computing that enables the sharing of resources and services that are not subject to centralized control, are geographically dispersed and can dynamically join and leave virtual pools [1].Users typically express their requests as constraints and preferences using a well-known set of terms defined in an information model and describing the resource characteristics.A resource request may involve different types of resources or more items of the same resource and it requires the capability of expressing inter-dependencies among them.Such inter-dependencies may be verified before starting the service provision or may require the knowledge about the status of resources during the service provision.Given the large number of possible attributes and the need for making an automatic selection, it is essential to define mechanisms enabling the efficient evaluation of the degree to which resources satisfy the request.
In our previous work [2], we have proposed a model for the rigorous representation of service characteristics, for the association of each of their possible values with the user satisfaction and for the aggregation of the single satisfactions in an overall score using a particular logic.In this paper, we propose XMatch, a query language enabling the expression of the user requirements and preferences based on the defined model.This language is inspired by XQuery [3] reusing a set of constructs useful for our goal and providing clauses based on our service evaluation model.Each XMatch query is executed on a snapshot representation of the available Grid resources.In a scenario involving a workflow requiring the selection of resources not only at its start, but also during its execution, different XMatch queries can be defined at different instants.The evaluation of how XMatch can be used together with specific workflow description languages [4] is not in the scope of this paper.
The paper is structured as follows: in Section 2 we set out our service evaluation model used to measure the satisfaction; in Section 3, we introduce the XMatch language with a number of examples; in Section 4, we use the language in two important use cases concerning the Grid computing area; in Section 5, we present a number of works that are relevant to our area of research; in Section 6, we draw up our conclusions and plan for future work; in Appendix 7, the EBNF (Extended Backus-Naur Form) grammar definition of our language is given.

Background on the service evaluation model
In order to understand the goal of the language that we are proposing, it is important to set out the core part of the service evaluation model proposed in [2].It is an approach tailored to the problem of identifying a service satisfying a request from the requester viewpoint.In particular, we define a model for the rigorous representation of service characteristics, for associating each of their possible values to the satisfaction perceived by a specific viewpoint and for the aggregation of the single satisfactions in an overall score using a particular logic.
Our model does not make assumptions as regards the definition of the attributes and the way values are associated to them.Specific representations are considered by different domains like the area of information modeling, knowledge representation, ontologies and expert systems.As regards the Grid community, GLUE (Grid Laboratory Uniform Environment) Schema [5] and JSDL (Job Submission Description Language) [6] are meaningful proposals in the information modeling area; an ontology-based matchmaker is presented in [7]; Component-Expert technology [8] is proposed in the area of expert systems.
The measurement theory [9] and the Logic Scoring of Preferences (LSP) method [10,11] are the building blocks of our model.The former supports the rigorous representation of properties of interest by defining a mapping from the empirical world into its formal representation, thus enabling to perform meaningful analysis and forecasts.The latter supports the synthesis of the global satisfaction by associating elementary satisfactions to each property and by providing a flexible aggregation mechanism.

Measurement theory
In this section, we introduce the basic concepts of the measurement theory that are useful to model in a rigorous way the attributes characterizing the entities to which the user is interested in expressing satisfaction predicates.These concepts enable to define an unambiguous machine-processable representation of the domain of interest.We start by considering the following definition [9]: Definition 1. Measurement is the process by which numbers or symbols are assigned to attributes of entities in the real world in such a way as to describe them according to clearly defined rules.
A proper insight of this definition requires the investigation of the concepts of entity and attribute.The former is an object or event of the real world, whereas the latter is a feature of this object or event.For each entity under investigation, each of its attributes needs the expression of criteria in order to determine its measurableness and define its measurement.Empirical relationships are inferred from attributes of entities.Therefore, respective formal relationships must be based on the formalization of these attributes in the models of the entities.We define an empirical relationship as the relationship among entities of the real world based on rules derived from experience.The first step towards the representation of the aspects of interest consists in defining an abstraction of the reality under investigation.An empirical relational system can be defined in the following way: Definition 2. An empirical relational system is an ordered tuple ERS = (EO, er 1 , . . ., er n , 1 , . . ., m ) where EO is a set of empirical objects, er i (i = 1, . . ., n) are k-ary empirical relationships (k 2) defined in EO, j (j = 1, . . ., m) are binary closed operations between empirical objects in EO.
An empirical relational system describes the objects of the real world (EO) and our empirical knowledge of their attributes (the empirical relationships er i ).We introduce the formal relational system enabling to model each empirical object, relationship and operation: Definition 3. A formal relational system is an ordered tuple FRS = (FO, fr 1 , . . ., fr n , 1 , . . ., m ) where FO is a set of formal objects, f r i (i = 1, . . ., n) are k-ary formal relationships (k 2) defined in FO, j (j = 1, . . ., m) are binary closed operations between formal objects in FO.
In the formal relational system, empirical objects are mapped into the formal objects, empirical relationships are modeled by the respective formal relationships and empirical operations are mapped into formal operations.The link between the empirical relational system and the formal relational system is represented by the following concepts of measure and measurement scale.Definition 4. Let EO and FO be a set of empirical objects and a set of formal objects respectively.A measure µ : EO → FO is a function mapping each empirical object eo ∈ EO into a formal object µ(eo) ∈ FO (the measurement value).
The measure µ enables to define the measurement scale expressing a mapping between the empirical and the formal relational system.Definition 5. Let ERS = (EO, er 1 , . . ., er n , 1 , . . ., m ) and FRS = (FO, fr 1 , . . ., fr n , 1 , . . ., m ) be an empirical relational system and a formal relational system respectively.Let µ : EO → FO be a measure.S = (ERS, FRS, µ) is a measurement scale if and only if ∀i ∈ [1, n], ∀j ∈ [1, m] and ∀eo 1 , . . ., eo k , b, c ∈ EO (k 2) the following properties hold: Five measurement scales are reputed to be particularly meaningful [9]: (1) the nominal scale is used when the measured objects need to be partitioned in classes; (2) the ordinal scale is a nominal scale with an order relation among the classes; (3) the interval scale is an ordinal scale that preserves the difference among the values associated to the measured objects; (4) the ratio scale is an interval scale that maintains constant the ratio of the values associated to the measured objects; finally, (5) the absolute scale is a ratio scale representing the only possible scale suitable to measure the attribute under investigation.
We have considered software measurement theory [9] in order to quantitatively express attributes and properties of interest.Without this step, no evaluation method can be used for obtaining meaningful information, therefore we consider the adoption of this theory as a requirement that has to be satisfied before starting to apply our evaluation method.

LSP
We present two steps included in the Logic Scoring of Preferences (LSP) method [10,11].The first step that we consider is the definition of the elementary criteria of satisfaction that are functions associated to the values of measurements concerning the attributes of the entities to examine.These functions map each possible value into a number e ∈ [0, 1] (i.e., e = 0 means 'no satisfaction', whereas e = 1 means 'full satisfaction') expressing the satisfaction for each possible value.Therefore, the elementary criteria of satisfaction are defined depending on the set of possible measurement values.There are three main ways to define an elementary criterion of satisfaction [10]: an enumeration of all possible values returned by a measurement of an attribute, an absolute classification of these values and a relative classification.
The second step of the LSP method is the synthesis of the satisfaction concerning a feature that can be modeled only by a set of measurements.The method prescribes the definition of functions returning a global satisfaction E ∈ [0, 1].Such functions are based on the satisfactions e 1 , . . ., e n defined by n elementary criteria to be aggregated and by their respective weights w 1 , . . ., w n .These weights can be selected in order to reflect the relevance of the attribute that the satisfaction refers to.Besides, they must be positive (i.e., w i > 0 ∀i) and normalized (i.e., n i=1 w i = 1).A wide spectrum of nonlinear multi-criteria scoring functions has been defined in order to model simultaneity (i.e., e i and e j have to be simultaneously greater than a threshold), neutrality, replaceability (i.e., a high value of e i can compensate a low value of e j ) and other input relationships.These scoring functions, defined in [10], have the following generalized form: (1) E = ( w 1 e 1 r +. . .+w n e n r ) . .where −∞ r +∞.The power r is a parameter selected in order to capture the desired logical relationship and intensity of polarization of the aggregation function.The calculation of the value assigned to the r parameter is based on the number n of satisfactions to be aggregated and on the expected degree of conjunction [10,11].A useful notation based on [11] is presented in Fig. 1(a).An aggregation function is represented by a circle; for each satisfaction e i a weighted entry arc is defined (i = 1, . . ., n; n i=1 w i = 1); finally, for each circle we have a single exit arc (the synthesized global satisfaction).Besides, the aggregation functions can be composed in order to produce other functions enabling to define aggregation criteria based on a particular logic.
By using this notation, in Fig. 1(b) we introduce a particular scoring function defined in [10]: the conjunctive partial absorption function suitable for aggregating a primary satisfaction e p and a secondary satisfaction e s .The arithmetic mean function A (r = 1) is the input of the medium quasi-conjunction function CA (r = −0.72)and the weights are placed as presented in the figure.Apart from the value of the secondary satisfaction e s , we have E = 0 if the principal satisfaction e p is equal to 0; on the contrary, if e p > 0 the global satisfaction E is positive.Finally, we have the largest global satisfaction (E = 1) if e p = e s = 1.

The service evaluation model
We start by providing a number of definitions that are the building blocks of our service evaluation model.The first definition associates each attribute to its measurement scale.By this association, the meaningful predicates can be identified.Definition 6.Let A be the set of attributes of the entities involved in the evaluation.AM is the set of pairs: (a, S a ) where a ∈ A and S a = (ERS a , FRS a , µ a ) is a measurement scale.
The next definition concerns the set of elementary criteria of satisfaction.

Definition 7.
Let A be the set of attributes of the entities involved in the evaluation.EC A is the set of elementary criteria of satisfaction for each a ∈ A.
The following equivalence relation is defined in order to identify equivalence relevance classes for the attributes.

Definition 8.
Let A be the set of attributes of the entities involved in the evaluation, a i and a j be elements of A, then ∼ REL is an equivalence relation on A defining a collection of pairs (a i , a j ) where a i ∼ REL a j means that the satisfaction concerning the values of a i is as relevant as the satisfaction concerning the values of a j .The next definition introduces the functions needed to aggregate the values returned by the elementary criteria of satisfaction.Definition 9. AF ECA is the set of functions for the aggregation of the satisfaction synthesized by the elementary criteria in EC A .
The definitions given above compose our service evaluation model (SEM ) synthesized by the following function: (2 Figure 2 expresses how the arguments of the function SEM have to be used in order to obtain the overall satisfaction degree.Considering the figure: (1) the measurement scales for the attributes under investigation are defined; (2) the satisfaction concerning the value of each attribute is produced by its respective elementary criterion of satisfaction; (3) the satisfactions reputed to be of the same relevance are grouped together by means of ∼ REL ; (4) the overall score is obtained by using the general pattern by firstly (4a) aggregating the satisfactions belonging to the same category and secondly (4b) by performing the aggregation of the satisfactions synthesized for each category.

The XMatch language
In this section, we introduce the XMatch language enabling to express queries over XML-based representations of Grid resources by considering also the satisfaction degree that a user perceives as regards the possible values of the attributes of interest.In Appendix 7, the complete grammar is given.The grammar rules are given only for symbols starting with the prefix XM, while the other symbols are taken from the XQuery W3C specification [3].The core part of the XMatch language is an expression defined in the grammar by the symbol XMExpr as follows: (3) XMExpr ::= XMForClause XMLetClause+ XMWhereClause XMReturnClause The rule defining this symbol is inspired by the FLWOR (For-Let-Where-Order by-Return) expression of the XQuery language [3].The first clause (XMForClause) of this expression generates an ordered sequence of tuples of bound variables called the tuple stream.For each set of bound variables generated in this step, the second clause (XMLetClause) enables to bound one or more variables to the value returned by an elementary criterion of satisfaction as regards elements belonging to the tuple stream.The third clause (XMWhereClause) enables to associate each variable defined in the second clause (i.e., an elementary satisfaction) with a relevance category, thus defining the aggregation pattern.The fourth and last clause (XMReturnClause) is used to return the result as an XML document and allows to select a subset of solutions based on their overall satisfaction.

Generation of the tuple stream
As stated in the previous section, the clause XMForClause generates an ordered sequence of tuples of bound variables, called the tuple stream.This is a simplified version of the XQuery ForClause, where only the basic constructs are maintained to select elements from an XML document and to generate set of elements by using joins.For each XMatch expression, only one XMForClause is allowed with one or more variables to be bound to different types of nodes.The URILiteral is defined in the XQuery specification and should refer to a URI that can be resolved to a file containing the data in XML format from which the set of important fragments are extracted.The OrExpr is also part of the XQuery specification.

Expressing the Satisfaction
In this section, we describe the symbol XMLetClause as the essential construct for defining a single elementary criterion of satisfaction.The three main categories are supported (see Section 2): an enumeration of all possible values returned by a measurement of an attribute, an absolute classification of these values and a relative classification [10].
We start by describing the elementary criteria of satisfaction when the result of a path expression is a singleton.The first category of elementary criterion of satisfaction can be used when the number of possible values for which the user wants to express an explicit satisfaction is finite.For instance, a user may want to express a number of acceptable possibilities for the operating system type where its job should be executed; the most preferred one is Scientific Linux, but RedHat Enterprise Linux is acceptable with lower satisfaction.This could be expressed as in Example 6 by using the XMSimpleEnum clause.
(6) let $e1 := $CS/OSName eq "Scientific Linux" satisfies 1, "RedHat Enterprise Edition" satisfies 0.8 A more complex use case supported in XMatch is the association of an elementary satisfaction by enumeration to a compound comparison predicate.For instance, if a user wants to express a satisfaction associated to both the name and version of an operating system, this can be done as in Example 7 by using the XMCompEnum clause.(7) let $e1 := ($CS/OSName, $CS/OSVersion) eq ("Scientific Linux", "3") satisfies 1, ("RedHat Enterprise Edition", "3") satisfies 0.8 The second category of elementary criterion of satisfaction can be used when the expression of satisfaction is based on parameters independent from attribute values under investigation.The possible functions that map the range of values into a satisfaction are infinite.Our choice is to express in the language three meaningful functions.They are linear and capture an increasing satisfaction, a decreasing satisfaction or a satisfaction centered around a value.An example of usage for the first function (linear increment) is a user requiring a storage service with at least 50 GB of available disk space.Values up to 70 GB produce an increasing satisfaction, while values greater than 70 GB are considered to be equal and fully satisfying.This can be captured in XMatch as in Example 8 by using the XMRange clause.The satisfaction is 0 if the value of the attribute is lower than or equal to the lower bound of the range, while it is 1 if the value of the attribute is equal to or higher than the upper bound.The second linear function (linear decrement) is similar to the previous function, except that for values lower than or equal to the lower bound, the satisfaction is 1 and for values equal to or higher than the upper bound, the satisfaction is 0. For attribute values in the range, the satisfaction linearly decreases.For instance, let us consider a user that is fully satisfied if the response time of a service is lower than or equal to 5 ms, but he will accept values up to 30 ms (see Example 9).The last function should be used when a high satisfaction is associated to values close to the one reputed to be the optimum.For instance, let us consider a user requiring a bandwidth for a network service around 200 Mb/s with a 10% tolerance (see Example 10).(10) let $e4 := $NS/Bandwidth in 180 to 220 satisfies with around The third category of elementary criterion refers to a relative comparison among the attribute values of all entities in the evaluation context.This criterion requires the introduction of aggregation functions (e.g., min or max).They can be used in both the first and second elementary criteria given above.For instance, let us consider a user requiring the storage service offering the highest free storage capacity (see Example 11).(11) let $e5 := $SS/FreeSpace eq max($SS/FreeSpace) satisfies 1 The use case of a relative elementary criterion concerning a range of values can be expressed by enabling the possibility of using aggregation functions to define the range bounds.For instance, a user may be fully satisfied when he is assigned for the service with the lowest response time among the available ones, but his satisfaction linearly decreases up to 0 when the highest is given.(12) let $e6 := $CS/EstimantedResponseTime in min($CS/EstimantedResponseTime) to max($CS/EstimantedResponseTime) satisfies with linear decrement In the Examples from ( 6) to ( 12), the hypothesis is that the path expression returns a singleton, while in the remaining part of this section, we generalize the behavior of the XMLetClause to path expressions returning a sequence with multiple atomic values.In order to perform a meaningful evaluation of the satisfaction, we need to introduce the following definitions.Definition 10.Two distinct elements el 1 and el 2 of an XML document are in intra-evaluation relationship if and only if the qualified name of el 1 is equal to the qualified name of el 2 and they are siblings.Definition 11.Two distinct elements el 1 and el 2 of an XML document are in inter-evaluation relationship if and only if they are not siblings and the path from the root to el 1 and the path from the root to el 2 are equal.
According to the last definition, two elements in inter-evaluation relationship are identified by the same XMPathExpr expression, but they are not siblings.In order to exemplify the two definitions, let us consider the following example.( The path expression /DataSet/A/B/C returns a sequence with seven C elements.As an example in this sequence, the first and second element (lines 4 and 5) are in intra-evaluation relationship because they share the same parent node (line 3); the second and the third one (lines 5 and 8) are in inter-evaluation relationship because they have different parent nodes (lines 3 and 7 respectively), but are identified by the same path expression.We consider values in intra-evaluation relationships as alternative values when determining the satisfaction concerning the attribute defined according to our service evaluation model (see Section 2.3).Therefore, the evaluation of an elementary criterion is made for each value and the higher satisfaction will be selected for the attribute under consideration.As regards values in inter-evaluation relationships, they are reputed to refer to different alternative entities according to our service evaluation model.Therefore, the evaluation of the global satisfaction must be based on only one entity among the alternative ones.Such an entity is selected maximizing the global satisfaction.In order to exemplify the concepts presented by the Example 13, let us consider a user requiring an A element.The user has a linearly increasing satisfaction from 0 to 1 for the values of C from 0 to 10.This elementary criterion can be written in XMatch as expressed in Example 14. ( 14) let $e1 := $A/B/C in 0 to 10 satisfies with linear increment By means of the XMForClause, the variable $A is bound to each A element in the document presented in the Example 13.Let us consider the first A element: according to Definition 10, the C elements in lines 4 and 5 are in an intra-evaluation relationship.The same relationship holds for the C elements in lines 11 and 12.For each subset of the elements that are in intra-evaluation relationship (i.e., 10 and 2 in lines 4 and 5; 1 in line 8; 2 and 3 in lines 11 and 12), a representative providing the maximum satisfaction is selected and returned as part of the sequence assigned to the $e1 variable, that is (1, 0.1, 0.3).This demonstrates how the intra-evaluation relationships can be resolved within the single elementary criterion.According to Definition 11, the three satisfactions in the sequence refer to attributes that are in an inter-evaluation relationship.This implies that in order to select the satisfaction participating to the aggregation producing the global satisfaction, we need to relate the values returned by different elementary criteria considering also their relevance.A complete example is given in Section 4. Following the same rules, the elementary criterion applied to the second A element will bound the variable $e1 with the singleton sequence (0.7).

Classifying the satisfactions by relevance
In this section, we explain how the association of an elementary satisfaction to a relevance category is modeled in the XMatch language.Potentially, the relevance categories can be infinite, but only three of them are introduced as they are sufficient for meaningful use cases.They are defined in the XMatch language grammar by using the following string literals: essential, desirable and optional.The advantage of such a definition is the improvement of the legibility of XMatch queries.A possible approach to generalize the language to an high number of relevance classes is to use natural numbers to label the relevance categories.The lower is the natural number associated to a relevance category, the more important is the satisfaction.(15) XMWhereClause ::= "where" XMRelevanceExpr ( "and" XMRelevanceExpr )* XMRelevanceExpr ::= ( "$" VarName "is" | XMVarNameList "are" ) ( "essential" | "desirable" | "optional" ) XMVarNameList ::= "(" "$" VarName ( "," "$" VarName )+ ")" Given a set of XMLetClause expressions defining elementary satisfactions, each of them can be associated to a relevance category by using the XMWhereClause (see Example 16).This provides the meaningful information for building the aggregation pattern.(16) where ( $e1, $e2 ) are essential and $e3 is desirable Weight and power parameters used in the aggregation pattern (see Fig. 2) are considered to be part of the query processor.Let us consider Example 17 showing an XML document having elements in both intra-and inter-evaluation relationships.We consider a user that wants to select an A element for which it is essential that a C element is higher than 6 and it is desirable that a D element is higher than 8.This expectations can be written in XMatch as showed in the following example: (18) for $A in doc("data.xml")/DataSet/A,let $e1 := $A/B/C gt 6 satisfies 1 let $e2 := $A/B/D gt 8 satisfies 1 where $e1 is essential and $e2 is desirable The values returned by the expression $A/B/C are in both intra-and inter-evaluation relationships.The same condition holds for the values returned by the expression $A/B/D.Considering the rules defined in Section 3.2, the variable $e1 is bound to the sequence (1, 0, 0), while the variable $e2 is bound to the sequence (0, 1).In order to choose the satisfaction participating in the aggregation for each elementary criterion, we introduce the ancestor relationship for performing such a choice.This relationship applies to the values of an XML document selected among two or more XMLetClause's and is presented in Definition 3.3.

Definition 12.
A value v ih (h ∈ [ 1, m]) in the i-th sequence (v i1 , . . ., v im ) returned by a path expression /X/Y (where X and Y are path expressions) is in an ancestor relationship with a value v jk (k ∈ [ 1, n]) in the j-th sequence (v j1 , . . ., v jn ) returned by a path expression /W/Z (where W and Z are path expressions) if and only if the path X is equal to the path W and the number of steps from the element v ih to the element v jk is equal to the number of steps in Y plus the number of steps in Z.If v ih is in an ancestor relationship with v jk , then the same relationship holds for their respective elementary satisfactions.
In order to exemplify this definition, we consider the two path expressions in Example 18 (/A/B/C and /A/B/D) applied to the XML document in Example 17.They identify the sequences (10,2,1,2,3) and (6,9) respectively.Considering the Definition 12, X is equal to /A/B, Y is equal to C, W is equal to /A/B and Z is equal to D. The first and the second value of the first sequence (i.e., 10 and 2) are in an ancestor relationship with the first value of the second sequence (i.e., 6), while they are not in an ancestor relationship with the second value (i.e., 9).For the final aggregation, we have to select only one value for each elementary criterion.The choice is made by selecting the n-tuple of elementary satisfactions (n is the number of elementary criteria of satisfaction) that are in ancestor relationships and that maximize the global satisfaction.It may happen that it is not possible to produce a complete tuple because the structure of the XML document may lead to the identification of a set of elementary satisfactions that are in ancestor relationship whose cardinality is less than n.In this situation, the missing elementary satisfactions are considered to be equal to 0. In Exampl 18, we have two elementary criteria, therefore we must produce pairs of elementary satisfactions (i.e., n = 2).The sequence e 1 = (1, 0, 0) associated to the sequence of values v 1 is composed of three values, while the sequence e 2 = (0, 1) associated to the sequence of values v 2 is composed of two values.In particular, we can point out that the second value of e 1 (i.e., e 12 = 0) has no respective satisfaction in e 2 for which an ancestor relationship holds.Therefore, the related pair is (e 12 , ), where the symbol ' ' expresses the lack of an elementary satisfaction (to be replaced with 0 during the aggregation phase).Summarizing, the tuple of elementary satisfactions that are candidate for the aggregation are: (1, 0), (0, ) and (0, 1).The tuple that maximizes the global satisfaction is the first one because its first value is essential and equal to 1.

Constructing the result
In this section, we describe how the result of the query is constructed and returned.Our decision is to define a clause that does not provide any transformation capability.The transformation of the result can be achieved by adding a postprocessing phase using languages like XQuery or XSLT.The XMReturnClause clause returns an XML document with a predefined structure as presented in Example 19.(19) <Results> <Result E="0.98"> ... </Result> <Result E="0.94"> ... </Result> </Results> Each Result element contains a set of elements as generated by the XMForClause and an E attribute with the overall satisfaction associated to the solution.These elements are given following a decreasing order with respect to the value of E.Moreover, the number of results can be limited in two ways: by asking the 'Top K' results and by dropping all solutions that do not reach a minimum overall satisfaction.(20) XMReturnClause ::= "return" "top" digits ( "with threshold" XMSatLiteral )?

Use cases
In this section, we present two meaningful use cases in the area of Grid computing.The first use case refers to the selection of a set of three different Grid services that better satisfy the user expectations.The XML representation of these services is simplified in the sense that neither intra-evaluation nor inter-evaluation relationships are present.The second use case refers to the selection of a single storage service, but its structure is more complex and presents intra/inter-evaluation and ancestor relationships.

Computing, network and storage resources
We consider a simplified scenario where core services referring to computing, storage and network resources are defined as follows: the computing service is a uniquely identified Grid service that can provide a user software application for computing power in a certain execution environment; the storage service is a uniquely identified Grid service that manages storage extents to be used for storing data; finally, the network service is a uniquely identified service that offers unidirectional communication capability between network domains that are sets of services sharing the same connectivity (we refer to the model defined in [14]).The following XML fragments represent a computing, a storage and a network service.They are based on a schema and represent the mapping to a formal relational system.In a real scenario, a broker service maintains and continuously updates a cache with the representation of the available services [15].The broker also receives requests from users and, based on their requirements and preferences, performs the matchmaking phase during which suitable solutions are prepared and one is selected.Let us consider a user that requires a computing service offering the Scientific Linux operating system in its version 3.0.3,but also CentOS version 4.0 is acceptable with lower satisfaction.Then, the user requires an Intel Pentium processor family.The application is expected to store permanent data for around 220 GB in a storage service.A network service with around 70 Mbit/s of bandwidth and a small RTT (Round Trip Time) is desirable.Finally, the minimization of the waiting time of the computing service is optional.In Example 22, we show a possible XMatch query expressing these requirements.let $e1 := ($CS/OSName, $CS/OSVersion) eq ("Scientific Linux", "3.03") satisfies 1, ("CentOS", "4.0") satisfies 0.8 let $e2 := $CS/ProcessorFamily eq "Intel Pentium" satisfies 1 let $e3 := $SS/AvailableSpace in 200 to 250 satisfies with linear increment let $e4 := $NS/Bandwidth in 50 to 100 satisfies with linear increment let $e5 := $NS/RoundTripTime in 0 to 10 satisfies with linear decrement let $e6 := $CS/FreeJobSlots in 0 to max($CS/FreeJobSlots) satisfies with linear increment where ($e1, $e2, $e3) are essential and ($e4, $e5) are desirable and $e6 is optional return top 10 with threshold 0.6 Each let clause is used to express an elementary criterion of satisfaction, while the where clause describes the aggregation pattern in Fig. 3 and corresponds to the following equation of our service evaluation model:
Summarizing, the representative tuple of satisfactions for the first storage service is (1, 1, 1, 1, 1), while the representative tuple of satisfactions for the second storage service is (1, 1, 1, 0.9, 1).Because of the monotonicity of the weighted power mean [16], we can assert that the first storage service will be selected as it provides the highest satisfaction among the considered services.The XMatch query given in Example 31 has also a representation in terms of an aggregation function as defined in the previous use case (see Eqs (23)(24)(25)(26)(27)(28)(29) and Fig. 3).

Related work
Relevant works for our activity are present in two main areas: the database area and the Grid computing area.In the first area, the literature about preference queries grew up in the last twenty years.The Agrawal and Wimmers proposal [17] is targeted at giving users the ability of quickly and flexibly express their preferences over search queries in the Web.This work was proposed in the context of searching on-line information about products and services where the number of items is a critical factor for the query response time.The concept of score was defined in terms of values belonging to the set [0, 1] ∪ {⊥, } representing the possible user preference.The symbol '⊥' represents the indifference while the symbol ' ' represents a veto.Given the structure of the description of a set of entities, the user can express a set of preference functions by assigning scores to possible combinations of values in the description and a way to combine such preferences is provided.The concept of score given in this work relates to the user preference as in our proposal.Conversely, their global preference is the result of a combination of the user preferences considered by relevance (i.e., first vetoes, then values from 1 to 0 and finally the indifference), while in our proposal the global satisfaction is the result of an aggregation taking into account the relevance of each attribute and specific conjunction degrees.As regards the mapping to data models, the relational one was selected, while we have opted for XML.Kießling proposed a formal language for formulating preference queries based on the Best-Matches-Only (BMO) query model [18,19].It developed a set of constructors and combinators that can be used to write preference expressions.An algebra modeling such operators was defined and extensions for both SQL (Preference SQL [20]) and XPATH (Preference XPATH [21]) were proposed.In our work, we focused on the XML data model and we have proposed a new language based on XQuery.Chomicki proposed a logical framework for formulating preferences as strict partial orders by using arbitrary logical formulas [22].In order to embed such formulas into relation algebra, a single winnow operator that can be parameterized by a preference formula was defined.This enables the rewriting of preference formulas as SQL queries.Our language is targeted at semi-structured data and our approach has been to define a new language.
In the Grid computing area, there are several works trying to introduce quality aspects in service selection.In [23,24], a framework to support QoS management in service-oriented Grids is proposed.It includes support for resource and service discovery based on QoS properties.The approach is to model these properties in the WSDL (Web Service Description Language) document describing a service, then to use an extended UDDI (Universal Description and Discovery Integration) to enable QoS-based discovery and selection.The expression of the desired service is based on the boolean logic, therefore this framework enables the partition of services in two categories: the one that satisfy the user expectations and the one that do not satisfy the user expectations.Our approach enables to use a continuous logic for expressing the satisfaction associated to each service.In this way, the services can be partitioned in an arbitrary number of categories.Another relevant work is a framework for the reputation management in Grid systems that provides a distributed mechanism for resource selection [25].This framework relies on the concepts of trust and reputation based on community experiences to classify, select and tune the allocation of entities.Trust is defined as the underlying principle for a security mechanism applicable in a global context and helps in reducing risks in unknown situations.Reputation refers to the history of the trust exhibited by an entity.For each entity that can be requested, an overall grade is computed as the aggregation of the elementary grades assigned by service requesters.The algorithm is an adaptation of a mechanism for evaluating trust in peer-to-peer networks.As regards the elementary grade, there is no specification about the way this can be evaluated, however an algorithm to compute the decay of trust values depending on time and on the global reputation returned by service requesters is provided.This work provides a meaningful way to synthesize a community-based reputation concept, while our work focuses on a user-based satisfaction concept.Reputation and satisfaction differ because the former is a possible metric that can be applied to an attribute, while the latter is the acceptance degree concerning the value returned by a measurement for such a metric.Finally, we mention an ontology-based matchmaker [7] enabling a flexible and extensible approach for performing Grid resource selection.It allows the definition of ontologies describing resources and user requests.The ontology-based matchmaker performs a semantic-based selection with a ranking phase using the attribute specified in the RankBy element, while we propose a syntax-based selection with a ranking phase supporting the expression and aggregation of satisfactions over a number of different attributes.

Conclusions
Grid systems require a mapping functionality for the association of users requests expressed in terms of requirements and preferences to actual resources.Our work started by proposing a model for the evaluation of the satisfaction perceived by a potential user for a set of services.In this paper, we have presented a mapping of such a model to a language for querying XML-based representations of available resources.This language provides a bi-directional mapping with our model, thus offering a tailored solution for its application.It also offers a compact way for users to express their preferences for Grid resources and enable the maximization of the global preference.Future work will be targeted at defining a method for rewriting XMatch in terms of XQuery in order to exploit the available XQuery processor implementations.In this way, we will be able to evaluate, test and tune the suitability of our language.After that, it will be possible to design and implement a dedicated processor providing an optimized execution of XMatch queries.Another important aspect is the extension of the language to enable the definition of the weights and the power parameters.Finally, a meaningful activity is to include the XMatch language in the metamodeling framework for engineering Grid services proposed in [26].

XMatch grammar
In this appendix, we define the complete grammar of the XMatch language specified in the simple Extended Backus-Naur Form (EBNF).The grammar rules are given only for symbols starting with the prefix XM, while the other symbols are taken from the XQuery W3C specification [3].

Fig. 2 .
Fig.2.From attribute values to the overall satisfaction degree.