With the sudden emergence of many dangerous viruses in recent years and with their rapid transmission and danger to individuals, most countries have adopted several strategies, such as closure and social distancing, to control the spread of the virus in the population. In parallel with all these precautions, scientific laboratories are working on developing the appropriate vaccine, which in many cases takes many years. Until then, it is necessary to resort to many solutions, including solutions that rely on information technologies and artificial intelligence (AI). In this context, this paper proposes a new solution based on the ontology and rules of intelligent reasoning. Initially, the virus environment is analyzed, followed by the extraction and editing of the main elements of the ontology using the “Protégé” software. In the last step, the proposed solution is tested, by choosing the city of Adrar in southwestern Algeria, which was particularly affected by COVID-19. Three scenarios were shown for different cases. The efficiency of the proposed solution was confirmed through the instructions it provides in the event of symptoms appearing in a person. In addition, this solution helps the competent authorities know the location and extent of the epidemic by informing the local communities.