# Autonomic Semantic-Based Context-Aware Platform for Mobile Applications in Pervasive Environments
## 4 Ontology and Rules-Based Context Model
### Context Modeling
#### 4.1.1 Context Sub-Ontology  
We divided the context sub-ontology into seven sub-contexts (see Figure 3). * The _ResourceContext_ describes the current state of the hard equipment and soft equipment (memory size, CPU speed, battery energy, etc.). * The _User Context_ describes information about the user, which can alter the adaptation service. User preferences include user age, preferred languages and preferred modalities (voice, gesture, pen click, mouse click, etc.). A user can select which multimedia object can be adapted (image, text, video or audio), for example if he or she receives audio when he or she is at work, he or she would rather receive a text instead; that means we need an adapting service to change the audio to a text. We can find also a description of the user's health situation, as the user can be healthy or handicapped (Figure 4). Figure 4: User context sub-ontology. Figure 3: An overview of the structure of the common context ontology. * The _Smart-Object Context_ describes data that are gathered from different sensors and describe orchestrated acts of a variety of actuators in smart environments (Figure 5). We have three types of sensor data: (1) bio-sensor data represent data that are captured by bio-sensors, like blood pressure, blood sugar and body temperature; (2) environmental sensor data represent data that are captured by environmental sensors, like home temperature, humidity, etc. ; (3) device sensor data represent data that are captured by sensors, like CPU speed, battery energy, etc. * The _QoS Context_ describes the quality of any mobile-based application, which can be represented in our ontology, which is defined as a set of metadata parameters. These QoS parameters are: (1) continuity of service; (2) durability of service; (3) speed and efficiency of service; and (4) safety and security (see Figure 6). Figure 5: Smart-object context sub-ontology. Figure 6: QoS context sub-ontology. * The _Host Context_ represents different hosts of services proposed by providers. For example, services can be hosted on local devices or on the cloud. The local device class contains information about fixed devices or mobile devices. Mobile devices have limited resources, such as battery, memory and CPU. The Cloud class contains information about the cloud server (e.g., Google cloud) that can be used for hosting services. The service is deployed and migrated on the host, and as the service has constraints, so a substitution of the service location could occur (a possible scenario is when the battery level is low, the service should be migrated on the cloud, so that the data could be stored separately and that could help minimize the use of energy). As mobile limited resources can break the mobile services, we are looking to the cloud or resources in proximity as a way to ensure the service continuity on mobile devices (see Figure 7). * The _Environment Context_ describes spatial and temporal information (Figure 8):
* Temporal information can be a date or time used as a timestamp. Time is one aspect of durability, so it is important to date information as soon as it is produced. * The _Place_ describes related information about the user's location (_longitude, altitude_ and _attitude_), in a given location, where we can find available mobile resources. The mobile resources are mobile devices, such as tablets, smartphones, laptops and smart objects, such as bio-sensors, environment sensors and actuators, etc. Resources are accessible by users. * The _ActivityContext_: according to a schedule, a user can engage in a scheduled activity. * The _Document Context_ describes the nature of the documents (text, video, audio). The document context specifies a set of properties related to a specific media type: (1) text: alignment, font, color,  
Figure 8: Environment context sub-ontology. Figure 7: Hard context sub-ontology. format, etc. ; (2) image: height, width, resolution, size, format, etc. ; (3) video: title, color, resolution, size, codec etc. ; (4) sound: frequency, size, resolution, and format (Figure 9).