 John), where CE {Drama, Action, War} such that it is the most similar concept to the concept Social. Similarity (Action, C, O) is the semantic similarity captured from the ontology O (e.g., TvAnytime ontology) between the Social concept and its closest neighbor in John's profile. Finally, rating (c, John) is the rating that John gave to the closest neighbor of Social. Once profiles are homogenized, vector metrics such as cosine can be applied to capture their similarity. Context-to-Context Matcher This matcher measures the similarity between two contexts. A context is seen as a conjunction of contextual attributes such as time, address, device, and SO on. Each contextual attribute takes values from a hierarchy of values as shown in Figure 10.15. Based on these hierarchies, we propose a hybrid metric to measure the simi- larity between two different values of the same contextual attribute within a given hierarchy of values. This similarity combines the shortest path length (SPL) and the Depth-relative (DEPTH) distance [44]. SPL specifies that the smaller the number of edges between two values is, the more are these values similar. DEPTH metric specifies that deeper values in the hierarchy are more similar than higher ones because deeper values share more information. The depth of two values is given by the depth of their lowest common ancestor. Hereafter, we propose the formula (10.2) The similarity between two contexts C1 and C2 is then computed as follows: MATCH(c1,c2) (10.3) According to the CARS architecture we propose, the context-to-context matcher is used at design time when clustering contexts and at runtime when identifying the cluster to which belongs the active context. Device Computer Mobilephone Desktop Laptop Smartphone GSMphone Figure 10.15 Example of contextual attribute hierarchy. Service Delivery Platforms 10.4.5 Toward Service-Based CARS Once contexts are learned and contextual profiles are constructed for each user in the RS, we show how runtime services (matching and Binding) can be deployed 