## 4 Context Reasoning  
### Reasoning Challenges  
Although the process of modeling and storing contextual data has its own merits, unprocessed data collected from the sensory layer of the IoT infrastructure have conceptually low importance and usefulness. Thus, the integration of context reasoning, the next step according to the context life cycle, is fundamental in fulfilling the purpose of CA systems,  
\begin{table}
\begin{tabular}{l l} \hline \hline name & Short text to name the location \\ description & Long text to describe the location \\ shape & Point, circle, polygon \\ latitude, longitude & An array of points that define the area \\ radius (optional) & Used in circle shapes \\ address (optional) & Possible address of the location \\ \hline \hline \end{tabular}
\end{table}
Table 2: Properties of outdoor location class.  
Figure 6: Asserted context class.  
i.e., the dissemination of high level contextual information to interested applications and devices for efficient service delivery.  
The main challenges that a reasoning procedure for IoT ecosystems should address are (a) complex representation, (b) uncertainty or lack of contextual data and (c) computational performance [77]. In other words, the inference engine should be able to model and perform the logic despite its complexity to tackle situations where contextual data are missing or noisy and to respond in real time. Each one of the above challenges will be further analyzed with respect to the methods that best address them.  
Complex representation requires that the appropriate method can be exploited in every real-world situation. Supervised and unsupervised methods excel at solving known problems (such as activity recognition) but are not suitable to support a generic reasoner that addresses a variety of situations. Still, ML models can be used to solve the specific problem that they were trained for and share their output with the main reasoner. Probabilistic and fuzzy logic are niche techniques that supplement the reasoner with their ability to tackle uncertainty and probabilities instead of facts. Thus, only rules and ontologies support complex representation and can be used as the basis for a reasoner that addresses a wide range of situations, as required by the IoT paradigm.  
Contextual data in an IoT ecosystem can be considered big data, thus inheriting their traits and characteristics. Similarly, they inherit uncertainty due to noise, incompleteness, and inconsistency [78]. The most common techniques to mitigate the effects of uncertainty on context reasoning are fuzzy logic and probabilistic logic [9]. Fuzziness as a technique to address uncertainty is introduced by [79], while [80] combine fuzzy logic with rules to implement a decision support system.  
Finally, computational performance is related to the ability of the reasoner to produce an updated, high-level context when required by the IoT applications and devices. Ontologies may show decreased performance as the ecosystem scales up and the volume of data increases [9], although Instance Store [81] was introduced to partially solve the issue. Rule-based logic, being less resource intensive, shows better performance and behavior with scalable ecosystems [6].