With the increasing amount of data collected by IoT devices, detecting complex events in real-time has become a challenging task. To overcome this challenge, we propose the utilisation of semantic web technologies to create ontologies that structure background knowledge about the complex event-processing (CEP) framework in a way that machines can easily comprehend. Our ontology focuses on Indoor Air Quality (IAQ) data, asthma patients’ activities and symptoms, and how IAQ can be related to asthma symptoms and daily activities. Our goal is to detect complex events within the stream of events and accurately determine pollution levels and symptoms of asthma attacks based on daily activities. We conducted a thorough testing of our enhanced CEP framework with a real dataset, and the results indicate that it outperforms traditional CEP across various evaluation metrics such as accuracy, precision, recall, and F1-score.