Lara Kallab
email: lara.kallab@open-groupe.com

Richard Chbeir
email: richard.chbeir@univ-pau.fr

Michael Mrissa
email: michael.mrissa@innorenew.eu

QoR-driven Resource Selection for Hybrid Web Environments

Keywords: Hybrid Web environments, Resource selection, i-compositions

In the Web of Things (WoT) context, an increasing number of objects provide functions as RESTful services (resources), that can be composed with other existing resources, to create value-added processes (compositions). However, to form a composition, selecting the suitable resources is becoming more challenging, due to: (1) the growing number of resources providing identical functions, which calls for the use of Quality of Resource (QoR) to distinguish between them, and (2) the transient nature of resource availability as a result of objects' sporadic connectivity in the WoT environments. In this chapter, we present a QoR-driven resource selection approach that forms i-compositions (with i ∈ N * ) offering different implementation alternatives. This is done using a selection strategy adaptor that considers QoR constraints and Inputs/Outputs matching of related resources, as well as resource availability and users' different needs (e.g., optimal compositions having the highest scores, and optimistic compositions having acceptable scores but obtained in more satisfactory delays). Analysis are made to evaluate our resource quality model against existing ones, and experiments are conducted in different environments setups to study the performance of our work.

Introduction

Nowadays, a plethora of Web environments (Web applications, Web platforms, etc.), publish their functions as RESTful services, i.e., self-contained and selfdescribing resources that follow the REpresentational State Transfer (REST) architectural style [START_REF] Roy | Architectural styles and the design of network-based software architectures[END_REF]. As the Web has become a major medium of communication, integrating objects (e.g., smart devices) into the Web and taking advantage of its open popular standards (e.g., HTTP), has created an emerging trend: the Web of Things (WoT) [START_REF] Barnaghi | From data to actionable knowledge: Big data challenges in the web of things [guest editors' introduction[END_REF]. In the WoT, objects are abstracted as RESTful services, which are resources individually identifiable with a Uniform Resource Identifier (URI) and provide functions callable using HTTP methods (e.g., GET and POST). A resource is either (i) dynamic, connected to and removed from the Web environment at different instances, or (ii) static, always connected to the environment. In many cases, a single resource is not sufficient to satisfy specific user requests, and often, resources are combined forming a composition that achieves the desired results. To form a composition, selecting the appropriate resources is essential. However, several challenges arise:

1. Selecting the appropriate resource for a function: With the growing number of resources realizing the same function, selecting the appropriate one while considering user constraints (if given), is non-trivial for end-users. Therefore, taking into account the Quality of Resource (QoR) attributes used to differentiate resources having identical functions [START_REF] Wang | A survey on bio-inspired algorithms for web service composition[END_REF], is important to select the suitable resource for a function. The increasing number of candidate resources and their various QoR attributes [START_REF] Kaewbanjong | Qos attributes of web services: A systematic review and classification[END_REF] (e.g., Availability and Cost) require an automatic approach that facilitates the task for end-users, and accelerates the selection process. Also, during selection, considering the matching of the input and output (I/O) parameters of the related resources is essential to generate compositions that fit efficiently users needs. 2. Forming different composition alternatives: The selected dynamic resource(s) for a composition may be unavailable for execution. To avoid repeating the selection process to form new suitable composition, providing i-compositions (i ∈ N * ), i.e., a set of compositions having different implementation alternatives, becomes important. These compositions respond to the user request by using, each, a different set of resources. This allows to substitute a composition that misses a resource, by another one consisting of available resources. Furthermore, in some cases, users require compositions having the highest possible scores, others may need compositions having acceptable scores obtained in more satisfactory delays, etc. Thus, forming compositions that are adaptive to different user needs is essential. In the literature, some works [START_REF] Bennara | Linked service selection using the skyline algorithm[END_REF][START_REF] Wang | Effective bigdata-space service selection over trust and heterogeneous qos preferences[END_REF][START_REF] Xu | Novel artificial bee colony algorithms for qos-aware service selection[END_REF] were based on Quality of Services (QoS) to select the most suitable ones according to user constraints or preferences, without taking into account I/O service matching and service dynamicity. Others [START_REF] Lécué | A formal model for semantic web service composition[END_REF][START_REF] Rodriguez-Mier | An integrated semantic web service discovery and composition framework[END_REF] aimed at finding a sequence of services starting from given inputs and leading to the desired outputs, without considering service matching on the functional level, their QoS, and dynamicity. Also, none of the existing service composition approaches [START_REF] Benouaret | Top-k web services compositions: A fuzzy-set-based approach[END_REF][START_REF] Deng | Top-k automatic service composition: A parallel method for large-scale service sets[END_REF], forms several types of compositions realizing different user needs (optimal compositions having the highest scores, optimistic compositions having acceptable scores but obtained in more satisfactory delays, etc.).

To address the aforementioned challenges and existing limitations, we present, in this chapter, a QoR-driven resource selection that forms i-compositions (with i ∈ N * ) offering different implementation alternatives for user request. To do so, we define a Selection Strategy Adaptor (SSA) that allows selecting the suitable resources, while considering user QoR constraints and I/O matching of related resources, as well as resource dynamicity and user requested composition type (e.g., optimal compositions having the highest scores, and optimistic compositions having acceptable scores but obtained in more satisfactory delays). Resource selection is automatic, i.e., based on semantic annotations integrated within resource descriptions expressed using Hydra [START_REF] Lanthaler | Hydra: A vocabulary for hypermedia-driven web apis[END_REF] in our work.

The rest of the chapter is organized as follows. Section 2 motivates our work, and describes the main challenges and needs. Section 3 discusses related work and shows the originality of our solution. Section 4 details our resource selection solution. Section 5 compares our defined QoR model against existing works, and evaluates the solution performance. Finally, Section 6 concludes the chapter.

Motivation, Challenges and Needs

We motivate our work through OpenCEMS4 : a Web platform that provides solutions for energy data management in connected environments. The platform allows to connect (1) stationary and mobile objects that provide static/dynamic resources, and (2) Web applications exposed as static resources. The resources, described in Hydra, are used for: collecting on-site data, preprocessing collected data, and analyzing data. Many requests occur in OpenCEMS. We consider a building manager that wants to predict the temperature in the conference room A. To satisfy his request, specified by the "ATP" (Air Temperature Prediction) function, it is important to select the appropriate resources realizing his need5 . However, several challenges arise, as illustrated in Figure 1: When several resources are identified having the same function required to answer "ATP", as "Air Temperature Collection", selecting the appropriate ones among others is not obvious for end-users, as the building manager. Therefore, QoR plays an essential role to select the suitable resources. For instance, object o s1 can be better than others (e.g., o m3 and o m4 ) as it may have: (i) full battery capacity denoting a full availability, (ii) continuous connectivity to the environment (since it is static), (iii) cost free when using it, and (iv) high usage rate (it has been invoked many times). Considering these QoR, allows selecting the appropriate resources among other candidates. As many candidate resources can connect to openCEMS with various QoR, resource selection requires an automatic approach to facilitate and accelerate the task for the building manager. Such approach should also consider I/O matching of the linked resources to guarantee efficient composition results. Moreover, in some cases, the building manager may require: (a) Prediction results using the most qualified resources. In this case, the resources to be selected are the ones having the highest values of quality aspects, independently of the selection response time, as the building manager may need to adjust the necessary temperature, in conference room A, for a meeting that will start in the late afternoon.

o m1
(b) Fast but good prediction results. As the building manager might be feeling very hot in the conference room A, he needs fast prediction results to regulate the temperature. This is done by selecting the first resources realizing his demand without the need to check others. However, and despite requiring fast results, it is important that the selected resources have minimal quality aspects to guarantee good composition results. (c) Always available results. The building manager may need to have results at anytime of his request, i.e., even if dynamic resources are disconnected from the Web platform there are always other resources that can take over. Thus, the resources that will be selected are always connected to the environment (static resources) at both instants t and t+n. In other particular cases, the building manager may define other needs as: (i) Trusted results, generated by only static resources already provided by the OpenCEMS Web platform (e.g., o s1 , o s2 , and o s5 ), (ii) Cost free results, using resources without any charge, and Reliable results, using resources that can be linked in the most proper way (i.e., best I/O matching between the related resources), etc. Thus, it is necessary to consider user needs and constraints, and adapt resource selection accordingly. 2. Form several composition alternatives. The selected dynamic resource(s) for a composition may be unavailable during execution. As such, at instant t, 5 mobile objects providing "ATC" are positioned in the conference room A. If o m4 provides the appropriate resource among these objects, it will be selected to take part in the composition. However, at t+n, o m4 is disconnected, and thus, the composition will miss a resource if the composition execution time is t+n. To avoid repeating resource selection process to form a new suitable solution with available resources, it is important to identify i-compositions during resource selection, with i ∈ N * . To address these challenges and respond to user needs, we propose a QoRdriven resource selection adapted to: (i) different requested composition types (e.g., Optimal, Optimistic, and Optimistic cost-free), and (ii) QoR constraints. Our solution considers I/O matching between the related resources and resource dynamicity (when it is necessary), to form the required i-compositions.

Related Work

QoS-based Approaches

In [START_REF] Bennara | Linked service selection using the skyline algorithm[END_REF], a quality-driven solution for resource selection is presented. The approach uses a set of quality attributes incorporated into each resource description expressed with Hydra, and implements a skyline-based algorithm that reduces the set of candidates for a given task. In [START_REF] Berbner | Heuristics for qos-aware web service composition[END_REF], a heuristic is proposed to solve QoSaware Web service composition problem. It uses a backtracking algorithm on the results computed by a Linear Program relaxation, while considering user constraints given to the overall composition. In [START_REF] Wang | Effective bigdata-space service selection over trust and heterogeneous qos preferences[END_REF], an approach for a service selection based on both qualitative and quantitative user QoS preference with services trust properties is presented. The solution is applicable in Big Data Web environments consisting of massive migrated services, i.e., business applications, to the cloud. The work in [START_REF] Deng | Service selection for composition with qos correlations[END_REF] proposes a QoS-aware service composition based on QoS correlations. It produces the optimal composite service, and considers service plans with sequence structure. Discussion: Although these works consider QoS attributes and user constraints/ preferences, they neglect services dynamicity and I/O matching between the linked services. Moreover, they are not adapted to generate different composition types to realize different user needs.

I/O-based Approaches

Work [START_REF] Rodriguez-Mier | An integrated semantic web service discovery and composition framework[END_REF], presents a graph-based framework for automatic service composition, by focusing on the semantic I/O services matching. It produces a service composition containing the minimum number of services, and multiple compositions can be extracted satisfying user request in terms of I/O. In [START_REF] Lécué | A formal model for semantic web service composition[END_REF], a formal model is provided for an AI planning-oriented service composition. It precomputes the I/O semantic similarity between services, according to causal links, which are logical dependencies among input and output parameters of different services. Discussion: Despite computing I/O services semantics, these works do not consider the functional aspect of the related services, nor even the dynamicity of services. Also, QoS attributes and user constraints/preferences are neglected.

k-compositions Approaches

A top-k automatic service composition solution is presented in [START_REF] Deng | Top-k automatic service composition: A parallel method for large-scale service sets[END_REF]. It adopts the idea of MapReduce, by mapping the top-k service compositions into multiple tasks that can be executed in parallel. The solution considers one quality of service, i.e., Response time, and I/O services similarities to filter the services. In [START_REF] Benouaret | Top-k web services compositions: A fuzzy-set-based approach[END_REF], an approach for composing the top-k DaaS (Data as a Service) services is proposed. The top-k compositions are computed based on a fuzzy score, associated for each service and service composition, and fuzzy user preferences expressed in fuzzy terms (e.g., "cheap" for services price). Discussion: Although these works produce several service compositions, and consider QoS attributes, they are not designed to handle service dynamicity, nor the generation of different composition types answering user needs. Also, only in [START_REF] Deng | Top-k automatic service composition: A parallel method for large-scale service sets[END_REF], I/O matching and QoS attributes are used in the same approach.

4 QoR-driven Resource Selection for i-compositions

General Overview

Figure 2 shows the process overview of our resource selection, applicable in hybrid Web environments providing static and/or dynamic resources. The process is used to form i-compositions responding to user request, r, and adapted to user request type. The latter includes one of the following desired compositions types: (i) optimal, denoting compositions having the highest scores, (ii) optimistic, referring to compositions having acceptable scores, i.e., a specific computed threshold (see Section 4.4), or (iii) hybrid, denoting compositions having acceptable scores but whose dynamic aspect is considered, guaranteeing the existence of a composition at any instance. A composition type can be followed optionally by other subtypes (e.g., trusted, denoting that only static resources can be part of the compositions). As for the user request, r, it is defined formally as: Definition 1 -r = (f, P, C), where:

• f, is the user requested function, selected from a list of functions, F, provided by the resources connected to the Web environment at the current instant. -P, is the set of parameters necessary to execute f, such as the required location (e.g., conference room A). P is mainly used by the resource discovery process, which is out of scope of this chapter, to identify the needed resources. -C, is the given user constraints according to which, i-compositions are obtained, and such that The selection process, illustrated in Figure 2, is executed when there are several candidate resources for at least one required function necessary to realize user request, r. The required functions for r form a Workflow Model, WM. During the process, the resources realizing an identical function are grouped into the same resource group, RG. Each resource of a RG can be linked to the resources included in the RG related to the next function (as defined in WM), forming a Directed Resource Acyclic Graph, DRAG. In order to satisfy user different requested composition types, we define a Selection Strategy Adaptor (SSA) that adapts to user needs to form the required i-set of resource compositions. Using a graph algorithm, as DFS (Depth First Search), from the algorithms library, SSA can traverse DRAG to compute the I/O matching of the linked eligible resources (whose QoR values respect user constraints defined in Q c ), and produces optimal compositions having the highest scores. SSA allows also to form compositions having acceptable scores, i.e., a computed threshold, T (see Section 4.4, obtained in more satisfactory delays. Such threshold is computed for the compositions types: optimistic and hybrid.

C = Q c ∪ i ∪ W ∪ d, with: • Q c = Q res c ∪ Q f c ,

Preliminaries

In our work, a resource, res, can be either static, res s , or dynamic, res d . It provides a set of functions:

F = N * i=1 {f i }, with: f i = (n, I, O, m, Q f
) denotes a single function, and where: n refers to f i name, I denotes the input(s) of f i , O denotes the output(s) of f i , m is the HTTP verb used to call f i , and Q f is the set of quality attributes related to each function (

f i ). Q f = N * i=1 {(qf i : vf i )},
with qf i is the name of the quality attribute, and vf i ∈ R + . Each resource has also directly related quality attributes: Q res = N * i=1 {(qres i : vres i )}, with qres i is the name of the attribute, and vres i ∈ R + .

In the literature, we find various QoR used to differentiate resources with similar functions [START_REF] Wang | A survey on bio-inspired algorithms for web service composition[END_REF]. In this chapter, we consider 4 QoR, where some are related to the resource itself, and others related to each of its provided functions:

-Dynamicity, is the quality aspect of whether the resource is always available (res s ) or not (res d ). It is equal to 0 for res s , and to 1 for res d . -Availability, is the degree (%) to which res is operational/ready for immediate use. For resources provided by objects, it denotes their battery capacity. -Cost, is the amount of money to pay to use a function of res.

-Usage, is a value that increments when a resource function is used. To avoid the re-initialization of the usage when a res d is disconnected, we define for each function of a res d , a Time To Live value denoting the maximum time during which a res d can be disconnected before the usage decrements by 1. Based on res definition, we extended Hydra-based resource description 6 , to include the QoR values. QoR are grouped as: (i) maximization attributes, whose values should be maximized (e.g., Availability), and (ii) minimization attributes, whose values should be minimized (e.g., Cost). They are used to compute, for each provided resource function, a global score that is defined as: score(res f ) =

N * i=1 {vres i } + N * i=1 {vf i },
where vres i (excepting the "Dynamicity" attribute value) and vf i are normalized based on the work in [START_REF] Murakami | Services Computing for Language Resources[END_REF].

QoR-based Resource Graph: Formal Modeling

The functions required for f in r, define with their dependencies a Workflow Model, WM. Based on the functions order in WM, the overlapped resources are linked, forming a Directed Resource Acyclic Graph, DRAG, that is defined as:

Definition 2 -DRAG = (RES, Rel, f RES , f Rel ):
-RES, is the set of the identified and overlapped static/dynamic resources.

-Rel, is the set of relations linking the resources together.

-f RES , is the function computing the score of each resource function.

-f Rel , is the function linking the resources together, and computing their link score based on their I/O similarities. The resources providing the same function, form a resource group, RG f , relative to that function, where: RG f = m i=1 res (f,i) , with m is the number of candidate resources realizing function f, and res (f,i) refers to the resource res i providing f. A resource composition, RC, consists of a set of resources included, each, in a different RG f , where: RC = n f =1 res (f,i) , such that n is the number of functions in WM, and i ∈ m, with m denotes the number of resources in the correspondent RG f . During selection, I/O matching score between every linked eligible resources is computed, using any similarity measure function between keywords (as Jaccard measure [START_REF] Niwattanakul | Using of jaccard coefficient for keywords similarity[END_REF]), as follows: sim(res

(f,i) , res (f ,j) ) = U u=1 V v=1 sim(out res(f,i) u , in res(f ,j) v
), with: -res f,i , res f ,j , denote resources that belong, respectively, to RG f and RG f , where f precedes f' in WM. -out u , is an output of res f,i , and U is the number of res f,i outputs.

-in v , is an input of res f ,j , and V is the number of res f ,j inputs. Each RC in DRAG has a score, score(RC), with: score(RC) = Score(RES) + Score(Rel), and where:

-

Score(RES) = n f =1 score(res (f,i) )
, is the scores sum of the involved resources realizing the required WM, with n is the number of WM functions.

-Score(Rel) = sim(res (f,i) , res (f ,j) ), is the sum of I/O similarity scores of each 2 eligible linked resources in RC, where: f precedes f' in WM, and sim(res (f,i) , res (f ,j) ) ∈ [0, 1]. Score(RES) and Score(Rel) can be multiplied, each, by a weight value defined in r, allowing users to assign them a priority for compositions score calculation.

Selection Strategy Adaptor for i-compositions

In order to form i-compositions satisfying different user needs, we define the Selection Strategy Adaptor (SSA) that allows the generation of 3 main compositions types: (1) optimal, (2) optimistic, and (3) hybrid) (see Section 4.1). Each of these composition types can be followed optionally by several composition subtypes, e.g., (i) trusted, refers to compositions having only static resources that are already provided by the Web environment, and (ii) efficient, denotes compositions that include resources with minimal acceptable normalized usage value. As shown in Table 1, the composition subtypes are defined according to either: (i) a minimal QoR attribute value (e.g., Dynamicity for trusted compositions), or (ii) a set of minimal QoR attributes values (Availability, Cost, and Usage for qualified compositions), or (iii) a minimal Score(Rel) (as for reliable compositions), computed based on "l", which is the number of dependencies links between the required functions in WM. However, in addition to these constraints highlighted in red, both optimistic and hybrid composition types should respect other QoR attributes and Score(Rel) values, to ensure having compositions with an acceptable score(RC), and thus, good compositions results. If optimal compositions subtypes are needed (e.g., optimal cost-free), a filtering process is executed before score(RC) calculations. Such filtering is done based on the maximum values of the constraints for which the values are highlighted in red in Table 1, among the resources in DRAG. For example, Optimal Efficient compositions will include resources having Max(Usage), which refers to the maximum value of the Usage attribute among the resources in DRAG. Based on the given composition type, SSA forms the necessary i-compositions. The i value (∈ N * ) can be determined by the user in r, for the 2 main types: optimal and optimistic, where SSA retrieves the i-compositions having the best or acceptable scores respectively. As for hybrid compositions, SSA stops generating the solutions having acceptable scores until having one containing only static resources, guaranteeing the existence of a composition at any instance. If the user defines in r, constraints that do not align with the designated composition subtype constraints, the latter are considered. When optimistic or hybrid compositions are required, SSA applies several steps: 1. Compute the minimum score of an acceptable composition. A composition is considered acceptable, if its score(RC) is a specific Threshold, T. When optimistic or hybrid composition types are requested without subtypes, T is defined as: T = [(n × Avg(Q c )) + (l × 0.5)] × (d/100), where:

-n is the total number of functions in WM.

-Avg(Q c ) are the average of the normalized QoR constraints defined in r (excepting the "Dynamicity" attribute). If Q c are not given, the average of each QoR is calculated using their maximum values among DRAG. -l, is the number of the dependencies links between WM functions. We consider that there is, at least, an I/O similarity match (=0.5) between any two linked resources. -d, is the composition acceptance degree value (%) given in user request. If subtype compositions are requested, T is computed as: T subtype = [(n × Q)+(l×s)]×(d/100), with Q denotes the minimum values of the attributes as in Table 1 (excepting the "Dynamicity"), and s ∈ [0,1] is the minimum I/O similarity matching score between any two linked resources. s = 0.75 whenever subtype = reliable, and s = 0.5 for the rest of subtype values. 2. Compute the score of a composition formed by eligible resources.

To do so, a generator is used to get the possible set of RC without score calculation. During RC generation, the following conditions are performed: (i) If a resource in RC is not eligible, it is registered in array, arr notEl, and another possible RC is generated (ii) If all the resources of RC are eligible, score(RC) is computed. If score(RC) T, RC is saved into the suitable compositions array, arr suitRC, if not, another possible RC is generated While analyzing a RC, if a resource is in arr notEl, another possible RC is generated. If not, conditions (i) and (ii) are tested. If optimistic compositions are required, the generator stops when having i-compositions respecting T. However, if hybrid solutions are needed, the generator stops when having a composition that respects T, and contains only static resources (always available). SSA results are the set of RC included in arr suitRC.

Evaluation and Discussion

In this section, we compare our QoR model to existing works, and evaluate our resource selection solution in a simulated environment provided by OpenCEMS. OpenCEMS offers 2 types of operation: real and simulated. As the real environment is currently being developed with a limited number of resources, in this chapter, we evaluated our work in the simulated functioning of OpenCEMS. The evaluation in the real environment will be presented in a dedicated work. In the experiments, we considered the requested composition type is hybrid, to focus on resources dynamcity aspect while forming the compositions. During the tests, conducted on a Linux Debian (64 bits) virtual machine, with 1 dedicated Intel® Core™ i7-46000 CPU @ 2.10GHz 2.70GHz processor and 1 GB RAM, we show the response time (in ms) based on an average of 5 sequential executions.

Comparison with Existing QoS Models

The comparison between our QoR model against the QoS model of existing works [START_REF] Bennara | Linked service selection using the skyline algorithm[END_REF][START_REF] Berbner | Heuristics for qos-aware web service composition[END_REF][START_REF] Wang | Effective bigdata-space service selection over trust and heterogeneous qos preferences[END_REF], is done independently of the number and type of the QoS used, since our work supports various attributes as long as they are presented in resources descriptions. The work in [START_REF] Bennara | Linked service selection using the skyline algorithm[END_REF] uses 3 attributes: Performance: [0-10], Availability: [0-100], and Reputation: [0-5]. During selection and based on user constraints, a service is chosen over a candidate service if all of its QoS are equal or better than the other, preventing thus having optimistic/hybrid compositions having acceptable overall QoS. Also, and besides neglecting I/O matching of the linked services, by applying our threshold formula, a service with a high attribute value (Availability = 90) and a very low value for another one (Performance = 2) is selected over a service with acceptable values for both attributes (Availability = 70 and Performance = 6), as QoS are not normalized. In [START_REF] Berbner | Heuristics for qos-aware web service composition[END_REF], several QoS are used to describe the services as Response Time and Availability. Contrary to our work, user constraints are given to the global composition (e.g., the overall response time should be < 50s) and not to each service, thus, aggregation functions are used for every QoS parameter. Moreover, weights are given to each QoS while computing the composition score. However, in our approach, user constraints are given to each of the involved services, and weights are assigned to (i) the overall services score and (ii) the overall I/O score that is not considered in [START_REF] Berbner | Heuristics for qos-aware web service composition[END_REF]. In [START_REF] Wang | Effective bigdata-space service selection over trust and heterogeneous qos preferences[END_REF], a service has a score based on the sum of weighted utility functions relative to each QoS attribute. Similar to our work, QoS are normalized and user constraints are given to each service. However, the work does not define a global composition score, since the service of a specific task with the highest score is selected. Therefore, and apart of neglecting I/O matching of related services, no optimistic/hybrid solutions with acceptable scores can be formed.

Resource Selection Performance

For the selection tests, we varied: (1) the number of overlapped resources per function, and (2) the number of functions required in the WM. For these 2 cases, we applied several scenarios: (i) All static resources in DRAG are eligible, (ii) 50% of the static resources in DRAG are eligible, and (iii) all DRAG resources are dynamic and eligible. For (i) and (ii), the first generated possible compositions (without score calculation) include dynamic resources, thus, the selection process continue generating compositions until having one including only static resources with acceptable score. In the best cases, static resources are traversed first, and the selection process responds more rapidly. In the tests, each resource has 2 inputs and 2 outputs, and user constraints are given to: Dynamicity (where static and dynamic resources can be selected), Availability, Cost, and Usage. In the experiments, we assumed that the I/O similarity score between a resource and another related one is 0.5. In Figure 3, in which the workflow consists of 3 functions, response time evolves with the growing number of resources. When dynamic resources exist, the response time increases, as their dynamicity is considered. The results also show that the increasing number of resources affects more the response time, comparing to the number of functions.

Conclusion

This chapter presents a QoR-driven resource selection approach that forms icompositions (i ∈ N * ) in Hybrid Web environments connecting static resources (always available), and dynamic resources (connected/disconnected at different instances). To do so, we defined a Selection Strategy Adapter that considers different compositions types (e.g., Optimal and Optimistic) and subtypes (e.g., Cost-free), QoR constraints, as well as resource I/O matching and dynamicity. Analysis are made to compare our QoR model with existing works, and tests are conducted to study our solution in a simulated Web environment offered by OpenCEMS. In the future, we plan to evaluate our work in the OpenCEMS real functioning, while considering subtypes compositions. We also seek to deploy an automatic orchestration to execute the compositions.

Fig. 1 : 1 .

 11 Fig. 1: Challenges illustration in the OpenCEMS platform 1. Select the appropriate resources to form a suitable composition.When several resources are identified having the same function required to answer "ATP", as "Air Temperature Collection", selecting the appropriate ones among others is not obvious for end-users, as the building manager. Therefore, QoR plays an essential role to select the suitable resources. For instance, object o s1 can be better than others (e.g., o m3 and o m4 ) as it may have: (i) full battery capacity denoting a full availability, (ii) continuous connectivity to the environment (since it is static), (iii) cost free when using it, and (iv) high usage rate (it has been invoked many times). Considering these QoR, allows selecting the appropriate resources among other candidates. As many candidate resources can connect to openCEMS with various QoR, resource selection requires an automatic approach to facilitate and accelerate the task for the building manager. Such approach should also consider I/O matching of the linked resources to guarantee efficient composition results. Moreover, in some cases, the building manager may require: (a) Prediction results using the most qualified resources. In this case, the resources to be selected are the ones having the highest values of quality aspects, independently of the selection response time, as the building manager may need to adjust the necessary temperature, in conference room A, for a meeting that will start in the late afternoon.

  refers to the set of constraints given to the resources (Q res c ) and to their provided functions (Q f c ), with Q res c j , and where: -n is the number of attributes describing a resource, and m the number of attributes describing its provided functions (see Section 4.2). -q res i |q f j = [min i|j -max i|j ], with min i|j , max i|j are respectively the minimum and maximum values given for q res i and q f j . • i ∈ N * , is the desired number of compositions. By default i=1, and can be only specified for optimal and optimistic compositions. For the hybrid compositions, the number of solutions depends from resource dynamicity aspect of the formed compositions (see Section 4.4). • W = {w qor , w io }, are the weights given respectively to the score of the resources and their I/O matching, during compositions score calculation (see Section 4.3). w qor , w io ∈ R + and are bounded by [0, 1]. • d, is the degree value rate (in %) of the threshold, T (see Section 4.4), that refers to the minimal acceptable score of the i-compositions.

Fig. 2 :

 2 Fig. 2: Overview of the resource selection process

Table 1 :

 1 QoR values and Score(Rel) in optimistic and hybrid compositions subtypes Dynamicity Availability Cost Usage Score(Rel)

Fig. 3 :

 3 Fig. 3: Response time while varying number of resources

Fig. 4 :

 4 Fig. 4: Response time while varying number of functions Comparing Figure 3-(a) to Figure 3-(b), response time increments less significantly with the existence of static eligible resources, as the selection process stops when having a composition of static resources. Figure 3-(b) represents the worst case scenario, where DRAG contains only dynamic resources that are eligible.Thus, all compositions scores are computed, causing an important response time with the evolution of resources number. Figure4-(a), in which resource number per function is fixed to 5, shows that response time increases with the number of required functions. Similar to the first case, the selection process is faster when there are static eligible resources, as the selection process stops before the generation of the rest of the possible compositions. As for Figure4-(b), response time evolves significantly, since DRAG contains dynamic eligible resources, thus, all compositions scores are calculated. The results highlight the importance of the existence of static eligible resources in DRAG, as the selection process stops when having a composition including static resources with an acceptable score. When dynamic resources exist, the response time increases, as their dynamicity is considered. The results also show that the increasing number of resources affects more the response time, comparing to the number of functions.

Figure 4 -

 4 (a), in which resource number per function is fixed to 5, shows that response time increases with the number of required functions. Similar to the first case, the selection process is faster when there are static eligible resources, as the selection process stops before the generation of the rest of the possible compositions. As for Figure4-(b), response time evolves significantly, since DRAG contains dynamic eligible resources, thus, all compositions scores are calculated. The results highlight the importance of the existence of static eligible resources in DRAG, as the selection process stops when having a composition including static resources with an acceptable score.

o m2 o m3 o m4 o s1 o s6 o m2 o m3 o s1 o m1 o s2 o s4 o s5 o s3 o s2 o s4 o s5 o s3 user user t t+n (n ∈ ℕ * ) Conference Room A Conference Room A o s6 X o s = stationary object o m = mobile object o m5 o m5 Function Object

	Air
	Temperature
	Collection
	(ATC)

o m3 , o m4 , o m5 , o m6 , o m7 , o s1 , o s2 , o s5

	CO 2
	Collection
	(COC)

Connected Environment & Distributed Energy Data Management Solutions: https: //opencems.sigappfr.org/

We assume the resource discovery is already performed based on the required location

Hydra description example is available online: https://tinyurl.com/tose56k