COVID19-Routes: A Safe Pedestrian Navigation Service

COVID-19 has become a global pandemic during 2020 due to its high contagiousness and the high mobility of the world’s population today. In just one year, this virus has caused millions of infections and deaths worldwide. These numbers will continue to grow until the population becomes immune to the virus thanks to an effective vaccine. Until this is possible, the only viable strategy is to try to stop its expansion through preventive measures such as limiting mobility, the use of masks, etc. In order to support these measures, this article presents a service to provide safe navigation solutions to reduce the likelihood of infection by avoiding potential conflict areas in the city. To identify these hotspots, a strategy that combines a rule-based system and a common-sense knowledge base is proposed. Through this strategy, an occupation model and a danger model are inferred. This requires the prior capture of knowledge about the general functioning of the city, its inhabitants and the virus. The proposed service makes decisions from these two models. Finally, a validation process has been carried out through surveys to evaluate the proposed solution. Obtained results demonstrate the potential of the proposed solution as a tool to identify safe routes that allow citizens to move around the city with low exposure to COVID-19.


I. INTRODUCTION
According to the weekly report of 5 April 2021 provided by the World Health Organization (WHO) there have been a total of 130,422,190 confirmed cases and 2,842,135 confirmed deaths from SARS-CoV-2 around the world [1]. Since the first case was identified in China by Dr. Li Wenliang in December 2019, this virus, also known as COVID-19, has had a great negative impact on different aspects of society.
Although the consequences in important areas such as social or cultural are being devastating, without a doubt the most affected is the economy, where important losses and discouraging numbers of job destruction are being registered [2], [3]. In just one year, COVID-19 has gone from being an unknown to spreading across the planet and conditioning our COVID-19 is a highly infectious virus that spreads between people in close contact. According to the information provided by the WHO [4], the human to human spreading of the virus occurs due to close contact with an infected person exposed to coughing, sneezing, respiratory droplets or aerosols. Thus, until there is no herd immunity, the best way to combat the virus is to contain its spread through measures that minimize contact between people on a daily basis. Some of the most prominent are listed below: • Quarantines, which prohibit staying on the street without justified reasons.
• Capacity limitations or lockdown of public places and events. • Restrictions on the maximum number of people who can meet in private places.
• Mobility restrictions at different scales: local, national, international, etc.
• Mandatory use of masks.
• Minimum safety distance between people.
• Curfews, prohibiting free movement during certain time slots. However, there is currently a huge handicap that makes it more difficult to comply with some of the above measures: the population density of cities. The human population density in these areas is higher than ever before for several reasons. One of the most important is the migration of the population from the countryside to the cities, also known as the phenomenon of rural exodus. This population movement has been mainly motivated by the economic development experienced by society during the Industrial Revolution and especially from the second half of the 20th century. These facts, together with the enormous increase in population mobility, make it possible for any disease transmitted through human contact such as COVID-19 to spread at great speed and be difficult to control.
A direct consequence of this high occupancy of cities is that it is difficult to comply with some of the measures that are closely related to the number of people, such as social distancing or capacity limitations. In addition, it also contributes to exacerbating situations that by nature are already critical in a pandemic context, even when the density of people is lower. These situations usually involve groups of people gathering either occasionally or constantly. Some clear examples could be leisure areas where there is a substantial increase in the number of people moving around at weekends, or markets where large numbers of people gather all the time.
At the end of the quarantines that were established in many countries as an extraordinary containment measure, citizens resumed their routine returning to work, schools, shops, restaurants, etc. In order to face this ''new normality'' and prevent the spread of the virus, it is of vital importance to establish new mechanisms to identify and avoid any situation that could be dangerous from the health point of view. Although measures have been imposed to reduce exposure to the virus in this new scenario, it is being proved insufficient in many cases, as can be seen with the appearance of a second and third wave of infections [5].
For this reason we must continue working to ensure that this new normality is safe in our cities, with special emphasis on the most effective measures. One of the actions that can have a great impact is to reduce, as far as possible, crowds or hotspots and avoid those areas that can have a greater risk. Such crowds tend to concentrate because of citizens' travel routines in their daily lives, resulting in situations that increase the likelihood of contagion. Some examples of these situations are areas close to schools where large crowds of children and young people are formed during entry and exit hours (a group that has been proven to be a vector of contagion to be taken into account [6], [7]), or areas near nursing homes where one of the most vulnerable groups of people [8] may be walking around at certain times of the day. This is the main objective of the proposed work, the identification of this type of situation to help to correct the patterns of movement of citizens that may be problematic and, as a final result, to reduce the probability of contagion. To this end, we propose a safe pedestrian navigation service that allows people to consult possible risk areas in the city and, thus, avoid them through alternative routes or roads. A direct consequence of this approach is that compliance with distance measures would be greatly facilitated and less crowding would occur at certain times of the day.
To support this safe navigation service, a danger model is proposed to identify everyday situations in the city that, due to their nature, can be dangerous because of the large number or type of people they gather. For this model to be really useful it must be able to capture the usual functioning of the city and the routines of its citizens. This is the only way to effectively identify and represent risk in different areas of the city. To obtain this model we propose to combine the accuracy of a rule-based system like CLIPS [9] with the flexibility and inference capability of a common-sense knowledge base as Scone [10], [11]. On the one hand, we define an occupation model that represents the mobility routines of citizens in the different contexts that occur throughout the day. This type of knowledge fits very well with rule-based representations since they are defined according to well known information. An example of this could be knowledge such as ''at the time of entering the school, many people gather in nearby areas'' or ''there are many people in the leisure areas on weekends''. On the other hand, we have used Scone to be able to work with the semantics of more complex knowledge that requires the use of sophisticated mechanisms, such as inheritance, relationships, etc. An example of the knowledge we have modeled at Scone is the types of groups of people, the types of amenities that can be found in the city, the relationships between them, etc. Thanks to common sense reasoning mechanisms, Scone is able to infer the danger model. This model makes it possible to identify the areas of the city with the highest risk of contagion based on the occupancy model and its knowledge base. Therefore, the main contributions of this article are a) the strategy to infer these models and b) an architecture that integrates all the mentioned components. Based on this architecture, a safe pedestrian navigation service is proposed. This service focuses on offering users a way to move around the city safely while minimizing exposure to the virus. An interface is also presented for users to interact with this service in a fast and intuitive way. Although the work is focused on the construction of safe pedestrian routes in a COVID-19 pandemic context, it is important to mention that the proposal can be used for other purposes, such as avoiding sunny areas in summer or streets that may be closed due to an event in the case of car routes, for example. This article is organized as follows. First, Section II reviews the literature of how technology is helping to contain the pandemic, with a special focus on solutions based on the Smart City and the Internet of Things (IoT). Section III presents how to obtain the occupation and danger models used to determine risky areas. Section IV describes the strategy followed to build the representation of the city and integrate it with the danger model. Section V shows in detail the architecture that supports the safe navigation service. Section VI describes the evaluation process, and Section VII shows how the evaluation has been used to validate the proposed solution and the results obtained. Finally, Section VIII summarizes the main ideas extracted from this paper, and other applications for the proposed system are discussed.

II. RELATED WORK
Now that vaccines are available, and while herd immunity is still being achieved, the most effective strategy to stop the pandemic is to contain and mitigate the spread of the virus to prevent potential outbreaks. For this reason, great efforts are being made to reinforce those measures that are being effective in this fight, such as social distancing, quarantine, provision of essential services, etc.
One of the main allies to achieve this goal is technology, since it allows the adoption of strategies that would be difficult to implement manually. As a result of the integration of technology into the management and decision-making processes of the pandemic, government teams are seeing their work greatly facilitated by solutions based on the Smart City [12], [13], the Internet of Things (IoT) [14] or the Intelligent Transportation System (ITS) [15]. A clear example of the advantages that the integration of technological solutions can bring to the management of the COVID-19 pandemic is the case of South Korea, where it has been possible to bend the curve in the earliest phase of the virus [16], [17].
Although the different applications being used during the pandemic can be classified in various ways, one of the most representative is the classification based on when they come into action during the state of emergency [18]. According to this criteria, three main categories are identified: detection of the emergency, alert of the emergency once detected and mitigation of the emergency after being alerted. However, although they have different objectives, the last two categories usually overlap. In this and future pandemics, it will be of vital importance to have mechanisms in the cities, one of the main sources of transmission, to enable these three activities to be carried out as effectively as possible. In addition, some aspects of crisis management need to be redesigned so that future disease outbreaks are treated as critical emergencies as soon as the first evidence appears. Finally, successful management of future pandemics will also require full integration of all data generated and provided by smart cities [19].
In the detection phase, applications focus on identifying significant patterns that deviate from what is known as normal. To carry out this type of task it is necessary to have models that represent the usual behaviour of the variable being controlled. Once an abnormal pattern has been detected, it is possible to identify the problem that is causing it and anticipate the consequences it may have. For example, hospitals are using these types of applications to prevent malfunctions due to the pandemic, either through simulations [20] or through Artificial Intelligence techniques such as Machine Learning [21]. Anticipating possible problems like lack of beds, health care personnel, health care machinery, etc. is allowing hospitals to take measures as setting up field hospitals, postponing non-essential surgeries or even referring patients to private hospitals [22], among others.
A variety of IoT-based solutions have been proposed within this detection phase. Some of them stand out for the use of sensors to detect possible symptoms related to the disease and take actions such as preventive isolation of patients, anticipation of possible outbreaks, etc. The solutions proposed are very varied, from wearable devices such as headsets that allow measuring temperature, heart rate and breathing [23] to more sophisticated devices that allow the monitoring of people who have been in contact with other infected people [24]. There is also another variant of applications that do not focus on identifying possible symptoms of the virus, but on the different effects that the pandemic is having on the population. An example of this could be the work proposed in [25]. Through crowdsourced smartphone data they are able to identify alterations in sleep patterns, one of the possible effects on the mental state of citizens as a consequence of the stress and fatigue caused by the pandemic. With the same objective, other approaches based on social networks can be found. Here, concrete patterns in the mental state of citizens [26] are identified through platforms such as Twitter 1 or Weibo. 2 In the second stage, the alert phase, the main objective of the applications is to alert and inform pandemic managers and citizens. In April 2020, the World Health Organization (WHO), aware of the importance of proper communication during the course of a pandemic, published a standard message library. Thanks to this library, institutions in each country can adapt these messages to obtain a uniform discourse with the rest of the world, using it in their communications with the general public through SMS or voice messages [27]. They also encouraged telephone companies to collaborate with their communication technologies to support this process. Communication with vulnerable groups in society, such as the sick or the elderly, is another example of applications where technology is helping a lot. An example of this is the work presented in [27], where social networks and messaging are used to maintain contact with people who suffer from some kind of mental illness. Through these communication channels it is possible to manage their concerns about the current situation: fear of treatment interruption, lack of medication, etc. Another area in which technology is very useful is in the fight against misinformation regarding the management of the pandemic [28]- [30]. This type of application is being of great importance since it allows institutions to identify erroneous sources of information and act accordingly. Being able to detect and combat misinformation in an early stage is becoming critical during the pandemic. Failure in this task represents a danger to the population: the promotion of masks that do not meet safety criteria, a poor dissemination of measures, etc.
The last group of applications is aimed at mitigating the spread of the virus. Some of the most common strategies are the reduction of contact between people or the monitoring of measurements compliance, for example. Microsoft Teams, 3 Skype, 4 Slack 5 o Google Meet 6 are some of the group communication tools that make it possible in both education [31], [32] and work [33]- [36] environments to carry on with their daily work when it is not possible to attend their workplaces in person. Contact tracing, one of the most important activities to control the pandemic, is also leveraging technology. The different applications that are appearing in this area are allowing to track in a very efficient way the people who have been in contact with COVID-19 infected people [37]- [39]. Another area that is benefiting from technology during the pandemic is healthcare. This is primarily because it allows patients with minor illnesses to receive the care they need while minimizing their exposure to the virus [40]- [42]. In the field of medical care, coordination applications for the provision of medical products in order to anticipate possible supply problems are also noteworthy [43].
Technology is also being a good ally in surveillance and prevention tasks, such as the use of surveillance cameras to control the use of masks [44], infrared thermal cameras in airports to detect people with fever in real time [45] or drones to cover larger surveillance areas [46]. However, these conform a small representation of the whole set of applications where technology is being used, and this work pretends to provide another solution in this category: the combat of the pandemic.

III. THE DANGER MODEL
An overview of the process for generating the proposed danger model is shown in the Figure 1. As can be seen, the approach followed to obtain this model is divided into two stages. On the one hand, the first stage focuses on identifying the density of citizens or level of occupation in certain areas of the city in a given context. Once this occupation level or occupation model is obtained, it is used as the input element for the next stage. In the next stage, this model is combined with knowledge about the normal functioning of the city and the behaviour of its citizens. This makes it possible to identify what level of danger is involved in each of the areas of the city identified as relevant areas.
To obtain an occupation model faithful to reality, it is necessary to take as a basis the context that describes the exact moment the model represents and certain relevant characteristics of the city. But what do we really understand as ''context'' in the scope of this work? The term ''context'' refers to set of characteristics and parameters that allow us to capture, describe and represent the state of an entity at a given moment. Therefore, the context of the city represents certain qualities that are of great importance for understanding what is happening and what is the state of the city. To be more precise, we are interested in context parameters that represent in detail how citizens are distributed in the city. The accuracy of these parameters is also relevant since it is used to identify and define the occupation model. Thus, this context focuses especially on temporal characteristics such as the hour of the day, the day, the month of the year or even if we are on a holiday. This is due to the fact that it is possible to predict more accurately the occupation of certain places in the city taking into account citizens' routines, that are directly related to these parameters.
We have used OpenStreetMap (OSM) [47] to determine which areas of the city need special attention. OSM is a collaborative project to create editable maps with a series of tags to describe the possible amenities of a city, available in https://wiki.openstreetmap.org/wiki/Key:amenity. This set of tags includes a great variety of common facilities in cities such as hospitals, schools or bars, for example, with a total of more than 100 amenities organized by categories, such as education, transport or health, among others. Working with these tags has several advantages: a) having a representative set of emblematic places in a city that has been validated by a large community or b) the possibility of easily integrating the proposed work with other types of information sources provided by OSM, as will be seen later. Therefore, the occupancy model defines the level of occupancy of a subset of these amenities. This model is used in the safe navigation system from the perspective of the pandemic and, therefore, when we talk about the occupation level of an amenity we refer to the movement of people originated in the streets surrounding the amenities.
In addition to context and amenities information, it is necessary to have a strategy for the inferencing of the occupation level of different amenities distributed around the city. To carry out this task we propose a rule-based system approach. This approach allows the modelling of citizens' routines, behaviour and mobility patterns through a well-defined set of rules. Through these rules, the rule-based system is able to interpret the context that represents the state of the city and infer what is happening in each of the amenities being considered. This set of rules is composed of two types of rules. On the one hand, there is a more generic type of rules used to infer new and more advanced information. This new information completes the description of the state of the city from the basic information provided by the context. A simple example could be a rule that states that it is weekend when the context date (day, month and year) represents that it is Saturday or Sunday. Although this may seem trivial, this simple deduction allows more elaborate and concrete rules to infer the state of occupation of some of the city's amenities. Another type of more elaborate rules are those that allow to infer, for example, when we are in a holiday period context, such as summer holidays. On the other hand, the other type of rules focuses on capturing citizens' routines in relation to specific city amenities. These rules are the most important as they focus on describing how the occupancy level behaves in any possible combination of context parameters. Therefore, these rules represent the daily life of the city and establish the behaviour of citizens with regard to each amenity for any possible context.
A possible example to better understand the proposed approach could be the case of school-type amenities. We know that in this type of amenities children take a break from classes at weekends and, therefore, the schools generally remain closed. Similarly, the children also take a break from school on public holidays and holiday periods, such as Columbus Day (in Spain) or Christmas, respectively. In these cases, establishing the level of occupation is quite simple as the schools remain closed and their occupation is practically zero. However, not all the scenarios that can occur in schools are so easy to model. The difficulty depends on the number of factors to be considered. As a consequence, the occupancy levels of this type of amenity may take on intermediate values.
In general, we can identify the following scenarios (note that we are using the typical schedules in Spain): • Start time of classes. This moment is a short interval of time during which all students arrive at school. For example, in Spain this interval is between 08:50 and 9:00. It is considered a critical moment as the occupancy reaches its highest level.
• Class time. Although during these hours all the children are in class, they are inside the building in their respective classrooms. For this reason, the surroundings of the building are not considered risky areas. Therefore, the occupancy level is low during the period between the start and the end of the classes.
• End of class time. This moment is a short time interval during which all students leave the school. For example, this interval takes place between 14:00 and 14:10 in Spain. It is considered a critical time as the maximum occupancy level is reached.
• Afternoon. Once morning classes are over, it is usual for children to receive extracurricular classes. Although these activities gather many children, the total number of people is lower than that obtained during morning classes. For this reason, the level of occupation can be categorised as medium. This interval starts at 15:30 and ends at 20:00 in Spain.
• From the closing time until the entry time of the next day. As in the other scenarios where schools were closed, such as at weekends or during holiday periods, the level of occupation is considered zero.
As can be seen, with a few rules it is possible to represent the normal functioning of schools from the point of view of the occupancy level. Following this approach, to consider other amenities we simply need to replicate the strategy followed with schools. For example, in the case of hospitals the occupancy level never is zero because they never are closed normally. However, it is necessary to represent the possible fluctuations the occupancy level may experience in this case depending on the time and day of the week. Hospitals usually have a higher flow of people during medical consultation and visiting hours. On the other hand, there it is experienced certain level of peace and quiet at weekends. As can be seen in these examples, the rules offer great expressiveness and power to represent people behaviour. In the proposed approach we have used CLIPS, a tool that provides a development environment for the production and execution of expert systems to define the necessary rules and represent the behaviour and mobility patterns of citizens in several amenities.
Once the occupancy model is obtained, the next step is to use this model to obtain the level of danger of the different types of amenities. Considering that one of the main sources VOLUME 9, 2021 of COVID-19 transmission are agglomerations, it would be logical to think that the risk of transmission depends only on the volume of people in an area. However, it is not as simple as it seems. The level of danger is not directly proportional to occupancy level. To achieve a more precise approximation of the level of danger we must take into account other factors. In this paper we propose a danger model that takes into account 3 factors: vulnerability, transmission risk and the aforementioned level of occupation.
On the one hand, vulnerability and transmission risk are factors that are closely related to the groups of people or types of population that live in cities, such as children, adolescents, adults, the elderly, the sick, etc. Vulnerability is used to represent how the virus affects the health of each group. Thus, the greater the level of vulnerability of a group, the greater the impact of the COVID-19 on the life expectancy of the person in that group. According to various studies [8], the virus has an important impact on people over 65 years of age, reaching very high mortality rates. Similarly, people of any age with pre-existing medical conditions, including non-communicable diseases (e.g. cardiovascular disease, hypertension, diabetes, chronic respiratory diseases or cancer), are also at risk of developing serious illness [48]. In contrast, several studies have found strong evidence that children who test positive for COVID-19 experience much milder symptoms [49], [50]. This means that this group, composed of children and young adults who have no underlying health conditions, have a lower risk of developing serious symptoms of the virus.
On the other hand, transmission risk represents the probability that members of a group transmit the COVID-19 to other people, either from the same or a different group. In this paper we do not treat it as a numerical and quantifiable parameter, but rather as a qualitative factor that affects the spread of the virus based on the attitude taken by each group towards the virus: if they comply with the spacing measures, use of masks, etc. Data collected during this and previous pandemics, such as the H1N1 (2009) pandemic, have provided clear evidence in various studies that certain factors have a major influence on compliance with safety directives. For example, in [51]- [55] a correlation has been found between people who feel more vulnerable to the virus, such as those with a previous health condition, and the likelihood that they comply with the prevention measures proposed by the authorities. On the contrary, it has been confirmed that young people and young adults are the group that most violates prevention measures. One of the measures they most violate is social distancing [6], [7], which is aggravated by the active social life that characterizes this group. Aware of this problem, the authorities are trying to make this group aware of the importance of stopping the advance of the virus. An example of this is the message ''You are not invincible'' promoted in March 2020 by the WHO [56]. Showing mild symptoms or not being truly aware of the seriousness of the situation is making the group a major focus of contagion today.
As we have seen above, it is necessary to determine some mechanisms to describe behaviours and situations that involve handling knowledge about how the world works. For this reason, we have decided to use Scone, a knowledge base that provides a description language close to natural language that allows us to capture all the semantics implicit in the concepts described. By default, Scone has a core knowledge base in which concepts and generic relationships are modelled so that it is not necessary to start from scratch. However, it is essential to model more complex entities that are specific to a particular application domain. This is the reason why we propose an approach to represent complex concepts such as transmission risk, vulnerability or the types of population and their behaviour, necessary to infer the danger model required for the safe navigation service.
Listing 1 shows as an example how some of the most basic concepts for the scenario proposed in this work would be represented in Scone. A very important advantage of this knowledge base is that internally it allows the inheritance of properties, relationships or restrictions. This is very useful since concepts such as {elderly person} or {young person} inherit all the common properties of the type {person}, while the characteristics that make them different are specific to each of them. In the same way, concepts such as {restaurant} or {pub} can inherit more elaborate characteristics like the fact that they have timetables, serving drinks, maximum capacity, etc.

Listing 1. Basic concepts.
A fundamental parameter for determining the level of danger of an amenity is to know what types of groups visit the place frequently. In order to do so, we define the relation that can be seen in  The next challenge to be addressed is the representation of the concept ''vulnerability'' for each group of people according to the terms described above. As a preliminary step, it is essential to define some key aspects of this concept, such as what ''level of vulnerability'' means and how it can be measured. In the first two lines of Listing 3 it is shown the definition of the concept {vulnerability measure}, that represents an entity that symbolises a measure of vulnerability. This concept has been defined as a qualitative measure whose level of intensity is determined by a conceptual unit of measurement, {vulnerability level unit}. Roles, one of Scone's most powerful mechanisms, have been used to specify that certain levels of vulnerabilities are associated with a group of people. Through roles it is possible to indicate that specific individuals play a particular role within a given context. An example of use of this mechanism can be seen in line 5, where it is indicated that the entity {COVID-19 vulnerability level} is a role that a {vulnerability measure} can play for a type of {person}. Finally, it is necessary to establish these roles through the {x-is-the-y-of-z} function in order to achieve the desired objective: to associate a level of vulnerability to COVID-19 with each of the groups of people considered. Lines 6-19 show various examples: the levels of vulnerability of the elderly, children and young people, in this order.

Listing 3. Definition of vulnerability in Scone.
The same strategy followed to represent the concept ''vulnerability level'' has been applied to define in the knowledge base that each group of people has a risk or probability of becoming ill and, therefore, of spreading the virus. The Listing 4 shows how the qualitative measure {risk level} has been defined together with its corresponding unit of measure {risk level unit} on lines 1 and 2, respectively. We have used the Scone's role paradigm to model the association between a group of people and their corresponding level of transmission risk. Finally, lines 6-19 define this risk for, again, the elderly, children and young people.
A similar strategy has been used to model the concepts of occupancy, occupancy level and how a particular occupancy level is associated with a particular amenity (see Listing 5). These terms are used to integrate into Scone the occupation levels previously identified through the rule-based system.

Listing 5. Definition of occupation in Scone.
Following the example of schools, it is possible to represent the most relevant aspects that are necessary to determine the level of danger of schools. Thanks to the knowledge we have modeled on the knowledge base, Scone can infer that schools are mostly occupied by children and young people, who are at low risk of developing serious symptoms of the virus (low level of vulnerability). In contrast, Scone is also able to deduce this group of people has a very high risk of transmitting the virus (high transmission risk level) due to their usual behaviour patterns. By applying the rules constructed in the rule-based system, it is also possible to define in Scone VOLUME 9, 2021 the occupation level of schools in a given context based on people routines and the functioning of this type of amenity.
Once the most relevant aspects of how the world works and how the virus spreads (and its implications) have been identified and represented, it is necessary to integrate and interpret all the knowledge to obtain the danger model. To this end, we propose in Algorithm 1 an approach to address the problem. The process begins by introducing in the rule-based system a new fact that represents the context in which is based the danger model generation process. As a direct consequence, this new fact triggers those rules whose antecedents are satisfied by the context. The result is the occupation model with an occupation level for each amenity type considered. The next step is to query Scone to get the information needed to infer the danger levels of the amenities: which are the groups that usually visit each type of amenity, the COVID-19 vulnerability level and the transmission risk level of each group of people, for example. Finally, once all the necessary information has been gathered, the level of danger for each type of amenity is estimated using the expression in line 10.

Input:
Access to the scone knowledge base Access to the rule based system (RBS) Output: Danger model 1: context = define the context based on the parameters to take into account (day, month, year, time, etc.) 2: Assert in the RBS a fact that represents the context 3: occupation_model = obtain the occupations from the active facts of the RBS 4: for every (occupation_level, amenity_type) in occupation_model do 5: occupation_types = ask Scone the question: Who is this amenity_type normally occupied by? 6: for every occupation_type in occupation_types do 7: add Scone answer to ''What is the COVID-19 vulnerability level of the occupation_type?'' on vulnerability_levels 8: add Scone answer to ''What is the transmission risk level of the occupation_type?'' on transmision_risk_levels 9: end for 10: danger = max(vulnerability_levels) * max(transmision_risk_levels) * occupation_level 11: add (amenity_type, danger) to danger_model 12: end for 13: return danger_model

IV. REPRESENTING THE CITY
A danger model that identifies potential conflict areas is not enough to provide a safe navigation service that minimises the risk of contagion. A representation of the city's physical environment is also needed to obtain routes that meet certain restrictions. This spatial information is very varied as it must capture different aspects of the city that are relevant to navigation such as streets, connectivity between them, distances, traffic rules, etc. The approach followed in this work is based on graphs, as its great versatility makes it one of the most widespread structures in the problem of pedestrian routing paths [57]- [60]. As a result, all the information necessary to identify those routes that minimize the risk of contagion are represented by nodes and edges that connect these nodes.
Once the strategy to represent the most relevant aspects of the city has been identified, we must feed the system with real information. We have taken as a reference the large amount of geographical information collected on the OSM platform. Thanks to the large amount of data it contains, it would be possible to apply the proposed solution to any place in the world. The only condition is the region have to be properly represented in the OSM databases. It is also important to take into account social factors that may affect the occupancy model, e.g. meal times, school start times, etc. Through the osmnx 7 tool we have incorporated into the graph the necessary OSM information about the city that is relevant to the problem addressed here. Following the methodology proposed by the OSM platform, nodes represent geographical positions and edges the roads that connect them, such as streets, roundabouts, roads, etc.
In order to combine the danger model with the representation of the city, it is necessary to previously identify the nodes that represent the areas marked as dangerous in the model. Until now we have treated danger areas as a concept that refers to places that could be dangerous from the point of view of the COVID-19. However, this concept is too abstract when we have to carry out lower level operations. For this reason, it is very important to define what is considered a dangerous area or hotspot from the perspective of the pedestrian routing path. In this way, a danger area is represented by the nodes of the graph that are walkable and are at a certain distance from the amenities identified as dangerous in the danger model.
It has been designed a process to make the relevant queries through the Overpass API, 8  model. The query is shown in Listing 7. It is important to note that this query returns all street nodes even if only one of them is within range. 3) As can be seen, the first query retrieves all the nodes that are in the radius, whether they are in the streets (target), in the buildings or in any other OSM entity. For this reason, in this third step, the results of the previous queries are compared to select only the street nodes that are strictly within the specified radius of each of the amenities. To do this, it is only necessary to find out which nodes identified in the second query are in the first or vice versa.
Once the nodes located in the areas marked as dangerous by the danger model have been identified in the graph, we can proceed to integrate the model information into the graph. To this end, we propose to carry out a process to penalise all the edges that have any of the previously identified nodes as their origin or destination. This penalisation is intended to favor streets that do not pass through any dangerous areas or hotspots. In this way, when calculating a route from an origin to a destination point, priority is given to the safest streets considered in the danger model. Equation (1) shows the expression used in the proposed approximation. This simply consists of penalising the length of the road by applying a known correction factor: the level of danger calculated in Section III. weight = length road * penalty. (1) With the graph configured according to the danger model, it is possible to identify routes that allow people to move around safely. Any algorithm that can calculate the shortest path in a graph can be applied to this task. Although there are many alternatives, some of the most popular are Dijkstra's algorithm, Bellman-Ford algorithm, A* search algorithm, Floyd-Warshall, Johnson's algorithm, Threshold Algorithm or Viterbi algorithm [61]. For this work we have decided to use Dijkstra's algorithm, the most well known shortest path algorithm, because it has been widely validated by the scientific community [62].

V. THE SAFE NAVIGATION SERVICE
An overview of the proposed architecture to integrate all the components is shown in Figure 2. This architecture is of great importance since it is the basis of the safe navigation service. As can be seen, this architecture is made up of two main parts. On the one hand, we have the component that carries out the tasks of reasoning. These tasks allow the identification of the areas of greatest risk of infection for citizens and to obtain a spatial representation of the city that takes into account these areas, as described in Section III and Section IV. On the other hand, we find a new component that enables users to access this safe navigation service taking this representation as an input parameter. To make this possible it uses two key elements: a Safe Route API and a web server to display maps. The Safe Route API consists of a REST API that we have developed to perform queries and operations about the representation of the city. Safe routes can be obtained from an origin to a destination, identifying dangerous areas or hotspots for a particular context, identifying streets to be avoided, recovering all the amenities of the city of a particular type, etc. This API can be accessed directly from the access point associated with it. In this way, it can be used in more complex applications or through the web server proposed in the architecture.
The main objective of this web server 9 is to provide an intuitive interface for citizens to interact with the API in a simple way. The interface of this web server consists of a map where all the information offered by the service is interactively represented. An example of what can be done with this interface is shown in Figure 3, representing a school neighbourhood in the middle of a school break. Firstly, we can see how users can use heat maps to quickly identify where there are dangerous areas in order to avoid them on their movements. They also have the option of displaying information about the type and level of danger for each of the regions marked on the heat map. Another feature of the web server is the possibility of highlighting those types of amenities to which you want to pay more attention. Figure 3 shows, for example, the schools in purple. Another example of what can be done using this proposed service is the calculation of routes. Figure 4 shows how two types of routes can be obtained through the service. On the one hand, the red route represents the shortest way to go from the origin to the destination indicated by the user. The route obtained may cross areas marked as dangerous because the distance is the only factor taken into account. In contrast, a new factor is introduced for the calculation of the green route. This factor is the danger level obtained through the danger model. Regarding these safe routes, it is important to take into account the following aspects: • The route obtained minimises the total danger along the entire path. However, there may not be any possible path where the route would not cross any dangerous areas. 9 https://pike.esi.uclm.es:7166/src/visualizer.html In these cases, the route includes these areas trying to minimize the danger for the rest of the path.
• When there are several possibilities for safe routes, priority is given to the shorter one.

VI. EVALUATION
Certain aspects must be taken into account in order to evaluate the quality of the routes obtained through the proposed approach. On the one hand, we must first identify which parameters should be evaluated to determine whether a solution, a route in this case, is correct or not. As the navigation service aims to stop the pandemic and reduce the rate of COVID-19 infection, we consider that the fundamental parameter should be the level of risk of the routes. On the other hand, the proposed approach is based on common sense knowledge, which is a special type of knowledge that tries to represent how the world works in the way in which humans think, emulating our reasoning processes. The purpose is to be able to deal with unexpected and unforeseen situations in the manner a person does. For these reasons, we believe that the most appropriate way to evaluate the performance of the work presented is to contrast the responses of the safe navigation service with the responses that would be provided by humans.
To carry out this comparison it is necessary to design and plan meticulously the procedure to be followed. The first step is to identify a representative set of scenarios or cases to evaluate the aspects mentioned above. In the next step these scenarios should be presented both to the service and to individuals to obtain the results they consider most appropriate. Finally, these results must be compared to obtain the performance provided by the service.
According to the proposed service, a scenario is entirely defined by a tuple with two points, origin and destination points, and a context that represents the circumstances of the city. For the evaluation process, the parameters that define each context have been slightly simplified to facilitate the evaluation of the scenario by the respondents. Thus, these contexts are defined by the time, the day of the week, the month of the year and whether it is a public holiday in the city. A total of 10 different scenarios have been defined in order to cover different situations that may occur during the pandemic in the daily life of the city. It is important to note that we have designed these scenarios so that the same origin/destination is evaluated under different circumstances or contexts. For this reason we have identified five origin/destination pairs with different contexts for each. A brief summary of these scenarios is given below:  • Cases 3 and 8: the context of Case 03 represents it is 11:00 in the morning on a non-holiday Tuesday in October, while the context of Case 08 represents it is 10:15 in the morning on a holiday Tuesday in February.
• Cases 4 and 7: the context of Case 04 represents it is 15:00 in the afternoon on a non-holiday Tuesday in April, while the context of Case 07 represents it is 13:00 in the afternoon on a non-holiday a Sunday in April.
• Cases 6 and 9: the context of Case 06 represents it is 09:10 in the morning on a non-holiday Monday in November, while the context of Case 09 represents it is 09:10 in the morning on a non-holiday Monday in August. The next challenge to be addressed for the service evaluation is to present the scenarios to the people surveyed. To address this challenge it is necessary to find a way to make it easy for people to define routes for any of these contexts and scenarios. For this reason, we have decided to use surveys using a web interface 10 designed specifically for this task. Figure 5 shows the interface. As can be seen, this tool has a very simple and intuitive interface so that respondents can use it easily. It is important to note that we have taken special attention to make this website compatible with any browser and device type so that the survey can reach more people. This interface consists of two main elements: a) a map, an interactive element that allows to zoom in, move the camera, tilt the image, etc. so that the respondent can configure the view as he/she likes; and b) the menu, that is used to display all the information about the different scenarios.
When the respondent selects one of the available cases, two markers (origin/destination) will be added to the map and the menu will load all the information about the scenario. This is the information the respondent will need to take into account for the route design: time, day of the week, etc. The procedure 10 https://pike.esi.uclm.es:7166/ to be followed by the respondent to design his route is very simple. As shown in Figure 5, the respondent only has to add markers and place them in the desired locations. Once the respondent is satisfied with the design of his route, he only has to press the ''Send result'' button and the website will check that everything is correct to store the results. Apart from the route, other information about the respondent is also collected for statistical purposes: how much he/she knows about the city, possible comments on the design of his/her route, age range and gender. We have also developed a website 11 where respondents can find out information about the navigation service, the survey and how to answer it using a video and a step-by-step guide. This website is written in Spanish to ensure that all respondents have the necessary information to conduct the survey.
The last task of the evaluation process is to measure the level of quality of the routes provided by the safe navigation service. As mentioned at the beginning of the section, we compare the routes obtained by the service with the routes provided by the respondents in the previous step. Two reference parameters have been used for this comparison. The first parameter is the number of dangerous points visited on the route that have been obtained by contrasting the points that form the route with the danger model of the service. The second one, the total distance of the route.
To generate the routes in the navigation service, the danger model must be updated according to the scenario. In this way, the system obtains a danger model adapted to each scenario based on the context associated with it. In addition to the context-specific parameters, the system takes into account the usual routines in Spain as a reference: entering and leaving class, lunchtime, leisure time, etc. We have decided that for this evaluation process the danger model must take into account all the amenities derived from educational centres (schools, colleges, universities, etc.), hospitals and leisure places (restaurants, bars, pubs, cinemas, etc.).
As can be seen, both the contexts of the different scenarios and the amenities have been strategically chosen to cover situations in the city that could become conflictive. In Table 1 there is a summary of the situations to be simulated for each of the cases. For example, in Case 01 it is represented a scenario where the user should consider that, due to the date and time, schools are hotspots because it is school start time. On the contrary, it must be concluded that the number of people enjoying their leisure time is very low as people are usually working on a Monday at that time. On the contrary, Case 09 represents a scenario where it should be deduced that there is no class due to the summer holidays but, on the contrary, there could be more people enjoying their free time.

VII. RESULTS AND DISCUSSION
In order to compare the routes chosen by humans and those obtained by the service, it was necessary to produce a representative sample to draw conclusions. For this reason, a total of 325 surveys were conducted. These surveys were done completely anonymously using the web interface presented in the previous section. Table 2 shows a summary categorising the age and sex ranges of the participants. The information collected during this experiment have been published so that they can be examined or reused in other works [63]. Table 3 shows a summary of the results/routes obtained for the 10 scenarios designed in the evaluation section by the safe navigation service proposed in this work. As can be seen, the table focuses on analysing the number of dangerous points present on each of the routes and the total distance of the route. Three main blocks can be identified in the table: • Safest route: this block shows the statistics of the safest routes, according to the proposed service, for each of the cases or scenarios designed. To obtain this type of routes, the service has used both the spatial representation of the city and the danger model corresponding to the scenario being evaluated. In this way, the safest route is prioritised and, when it is compared with routes of equal danger, the shortest route is considered a better choice.
• Shortest route: this block shows the statistics of the shortest routes, according to the proposed service, for each of the cases or scenarios designed. In this type of routes, any aspect related to danger or COVID-19 has been completely ignored. Therefore, the service only uses the previously identified spatial representation of the city.
• Google route: this block shows the statistics obtained by calculating the routes for each of the cases using the Google Maps platform. 12 The default configuration provided by Google Maps for pedestrian routes has been used to obtain these routes. It has been considered interesting to include this last block in order to analyse the level of danger, from the COVID-19 point of view, of the routes provided by one of the most popular navigation systems. This makes it possible to analyse not only the risk of the routes collected through the surveys conducted, but also to obtain an approximation of the level of exposure to the virus of millions of people who are users of Google Maps.
As can be seen in the table, for the Safest route approximation, the safe navigation system is able to find completely safe routes in 70% of the scenarios. Thus, according to the danger model, these routes do not visit any risk areas. For the remaining 30% of the scenarios, only an average of 1.66 hotspots are visited along the route. With regard to the results obtained for the Shortest route and Google route modalities, the number of dangerous points visited by the routes varies, from 1 to 34, obtaining an average of 9.5 and 12.8 for each of these criteria, respectively. It is important to note that, although this secure routes has a penalty in terms of route length, we can see that it only represents an increase of 400 metres on average. We can also see how this penalty is higher in those scenarios where, due to the context of the city situation, the number of dangerous areas is higher. This is completely normal since, as there are more areas to avoid, the route pass through alternative paths to reach the destination. For example, this means an increase in the route distance of 743 and 1030 metres in Case 03 and Case 06 (the most dangerous routes in the Shortest route block), respectively. That is to say, an increase of 41% and 33%.
A boxplot of the results obtained through the surveys is presented in Figure 6. In this case, the diagram focuses on the number of dangerous points visited along the 325 routes collected through the surveys. It is important to note that, as an anonymous survey, it is possible that some of the surveys have been done maliciously or simply contain errors. For this reason, it is automatically verified that the survey was carried out correctly within the expected parameters.
However, because each of the cases represents a context with different characteristics, the boxplot shown in Figure 7 is much more representative. This boxplot illustrates the differences between the results of each of the cases. Several deductions can be drawn from this diagram. On the one hand, it can be seen that it is common to obtain a great variability, within the same scenario, in the number of dangerous spots visited. As discussed throughout the text, there are a wide variety of factors that can influence this aspect, such as the respondent's perception of risk of infection, knowledge of the city, age, etc.
On the other hand, the boxplot shows that there is also a large variability in the number of dangerous points visited between the different scenarios. This is very striking as the difference in length of the routes does not differ greatly between the scenarios designed. This can be seen in the boxplot of Figure 8, where the results for the length of the routes in each scenario are represented. A clear example of this is the difference between the number of dangerous points visited between each scenario and its counterpart in terms of origin and destination points. For example, in Case 06 and Case 09, despite having the same origin and destination, they show a large difference in the average danger level of the surveys. This is because the contexts associated with each case are not the same since, as shown in Table 1, Case 06 presents a much more conflicting scenario. Case 09, on the other hand, represents a much simpler situation as it takes place at 9:00 a.m. in August, a non-teaching period when many people are on holidays.   In the light of these results it is possible to conclude that there is significant evidence that the approach proposed in this paper provides safer routes from a COVID-19 point of view than those normally used by citizens.
In this way, avoiding crowds during times of pandemic minimises the contact between people and, consequently, reduces the exposure of citizens and the spread of the virus.

VIII. CONCLUSION
This paper has presented COVID19-routes, a safe navigation service for pedestrians in cities. The service pretends to be a mitigation tool for the COVID-19 virus. This idea of safe navigation is based on the premise that, in order to increase the safety of pedestrians, it is necessary to avoid areas of the city where the probability of contagion is higher. Like all navigation systems, the main objective is to provide routes from origin to destination points. However, the proposal offers an innovative approach where the main objective is not the shortest route, a rute with less traffic or the fastest one. The most important objective is to identify the route with the lowest risk of COVID-19 infection.
In order to identify which areas should be avoided, two models are proposed. On the one hand, we present the occupancy model. This model focuses on representing the mobility patterns of citizens in different contexts. A rule-based system is used to support the type of knowledge associated with these patterns. On the other hand, we present the danger model with the aim of identifying potentially dangerous situations. Three key elements are combined to obtain this model: the occupation model, general knowledge about how the world works and common sense reasoning processes. To support the last two elements, the use of Scone, an open-source knowledge-base (KB) system, was proposed. Finally, a graph-based approach to integrate both models with spatial information of the city was presented.
A set of test cases was defined to evaluate the proposed service and demonstrate its performance. Due to the nature of the knowledge involved, the results were compared with results generated by real people through surveys. In conclusion, this comparison shows a substantial improvement in reducing exposure to the virus.
To finish, it must be mentioned that although this work is focused on the building of safe pedestrian routes in a COVID-19 pandemic context, the system presented can be used with other purposes. Here, the danger model has been defined to enable the representation of relevant knowledge about some COVID-19 parameters but, in the same way, other parameters can be added to consider new contexts. The model could be extended with commonsense information about how the temperature changes along the year or how the sun behaves during the day in a concrete zone to infer the better pedestrian routes in specific cases, looking for the most sunny areas in winter and the less sunny areas in summer, for instance. Other examples and fields of application are the construction of emergency routes for ambulances or police cars, that also should avoid areas close to schools during specific hours of the day in addition to other problematic areas; or finding the most secure pedestrian routes at night, considering poorly lit streets, streets in bad condition or similar. In short, the competence of the system can be improved to face several kind of problems by adding new knowledge modules.

DETAILS ABOUT THE HUMAN AND ANIMAL RESEARCH DISCLOSURE
Anonymous surveys are used to evaluate the proposed approach. These surveys do not collect personal data such as name, surname or any other type of information that would allow the survey to be associated with an identity. No sensitive information such as health data or similar is collected.