Social Parking: Applying the Citizens as Sensors Paradigm to Parking Guidance and Information

: Nowadays, the problem of parking guidance information (PGI) is one of the great challenges of smart cities. Sensor networks have been traditionally used, but they sometimes constitute a high administrative cost. For this reason, this paper presents social parking, a system that is based on the citizens as sensors paradigm, where data are collected by users and are processed using data mining techniques. Moreover, an ontology is used to enable the standardization of information. This way, social parking is compatible with the FIWARE platform. A forecast algorithm was also designed and veriﬁed to estimate the number of free parking spots inside a parking lot. With this aim, we used public parking data from eight parking lots in the city of Zaragoza. Client applications allowed testing of all the functions of the parking system. These tests were carried out in three experimental parking lots in the city of M á laga


Introduction
Nowadays, the concept of the smart city constitutes an important model for the scientific community [1].Planning sustainable urban transformation is a crucial task in the development of cities [2].Transitioning to a low-carbon energy system is vital for realizing sustainable development, and the transport sector is key to the 2050 long-term decarbonization strategy of the European Union [3].Smart city architecture is usually organized into four layers: he application layer, middleware layer, network layer, and sensing layer [4].Within the sensing layer, there are two clearly different paradigms:

•
Traditional sensing using devices.These provide reliable real-time information, but the cost of sensing all of the different elements of the system, the maintenance of the devices, and the communication between them is high [5].

•
Citizens as sensors.This consists of the use of information provided to the system by the citizens themselves [6].This paradigm is less reliable than the traditional one and requires "user education" by means of gamification techniques.Nevertheless, there are no costs regarding hardware investments for its administration.
This paper addresses the problem of parking guidance and information (PGI) by employing the citizens as sensors paradigm.This paradigm implies important cost savings and allows a rapid expansion of controlled parking areas.With this aim, data mining techniques and predictive analysis were used.
In recent years, a set of initiatives has been promoted worldwide for the optimization of the management and use of urban parking.An often-cited study performed by IBM in 2011 estimated that over 30 percent of traffic in a city is caused by drivers searching for a parking spot [7], although Dowling et al. considered this fact astounding and presented a model that showed the spatial and temporal heterogeneity of urban parking [8].Nevertheless, initiatives that make it easier for citizens to find the location of a parking spot contribute to the achievement of better air quality and a reduction in noise pollution.The existence of parking policies has been widely used to promote sustainable transport [9].
In this paper, we present social parking, a system that allows citizens to consult the availability of parking spots in their surrounding area in advance.The combination of real-time data and forecasts based on the analysis of historical data enables the suggestion of more suitable parking areas with a high degree of certainty.In addition, the system provides accurate and permanently updated information about parking to the local administration.This fact will facilitate the planning of new infrastructure, promote certain parking areas, and decrease traffic with more accuracy.Moreover, the citizens as sensors paradigm saves costs, as the citizens themselves provide most of the information.Finally, an ontology was designed to standardize all the information, allowing compatibility with the FIWARE platform.
The rest of the paper is organized as follows.Section 2 shows the related work in intelligent transport systems and parking guidance information.Section 3 presents some of the concepts we use in our system, while Section 4 deals with the design and implementation of the system.Section 5 proposes a data-mining-based forecast algorithm.The algorithm was verified using historical open data of real parking lots in the city of Zaragoza.Section 6 deals with the ontology that was designed.Section 7 presents the applications that were designed to validate our model and the tests that were carried out in Urban Lab, a smart city project located in the city of Málaga.Finally, Section 8 shows the conclusions of our study.

Related Work
Intelligent transport systems (ITS) are advanced applications applied to transport and infrastructure to improve productivity, safety, and environmental performance [10].Among the main transportation issues, parking guidance information (PGI) stands out.A PGI system is designed to help drivers searching for parking spots, acquiring data from the infrastructure, processing the data, and communicating the results to the drivers in a comfortable and distraction-free manner [11].Some studies have shown that having traffic and parking information reduces time in searching for a parking spot [12,13].Concerning how to determine which parking spots are available and which are occupied in real time, the most used points of view focus on data acquisition and transport and processing technology.Thus, systems based on wireless sensor networks (WSNs) are widespread [14].Yoo et al. [15] implemented a helping system for finding parking spots in car parks that deploy a network of wireless sensors.In [16], a hybrid system based on WiMAX and WSN was proposed.The system optimizes the path from the current position of a vehicle to an available parking spot, establishing the transit time, and the fuel consumed as costs.In this system, the user can choose to place higher priority on the path that allows less air pollution.Geng and Cassandras presented a smart parking system using sensors and an allocation system [17].In [18], Lu et al. proposed a multifunctional wireless system that allows the prevention of vehicle theft, navigation to a real-time parking spot, and a parking information system based on ad hoc vehicular data networks (VANET).Correa et al. suggested the cooperation of autonomous vehicles within a vehicular sensor network (VSN) [19].Other examples of the use of WSN can be found in [20] and [21].In short, there are a few parking systems where sensors are used to determine spots.However, it is difficult to extend these systems to large areas because of the cost in sensorization that they would imply, especially in outdoor parking lots.Thus, in practice, this is an unresolved problem in many cities.
For this reason, the present paper addresses the problem of monitoring and controlling parking lots through the application of the citizens as sensors paradigm.This implies significant cost savings for the system and allows for the rapid expansion of controlled parking areas.

Description of the Technologies Used
The basis of the system is the citizens as sensors concept, as we must develop a parking model that provides real-time information on the occupation of available spots without a great deal of investment in sensors or communication and control infrastructure in the parking area.The users of the parking service themselves are the ones who should provide the system, with information on the spots that are occupied and vacated in real time.In return, the system provides reasonably accurate forecasts of where to park.In addition, it provides city managers with detailed information on the patterns and trends in the use of car parks.To obtain this information, the system uses data mining and analysis prediction techniques.These techniques utilize the data offered by citizens and the historical data provided by city managers.The results of the analysis are shown in a dashboard where the values and evolution of the variables of influence as well as the most important indicators are shown.The fundamental factor for the success of the project is citizen participation.Moreover, the standardization of the information is desired.We considered ontologies to be the best ways of achieving standardization.
Next, the main concepts that were used are briefly defined:

Citizens as Sensors
In a relatively short period of time, mobile technology has penetrated significantly into society.The impact of this quick acceptance has transformed many aspects of our lives, influencing not only the way of communicating, but also the perception of culture, community, identity, and relationships.Smartphones have acquired such a widespread presence in society that their users can be easily organized regardless of geographic distances.The mobile phone provides instant access to any information available on the Internet, anywhere, anytime [22,23].This continuous social connectivity has important implications for society and great potential for application in many fields through the exploitation of the data provided by the sensors integrated in smartphones.Many people are now carrying a device (smartphone, tablet, etc.) loaded with sensors, whose readings can be recovered and shared across the network.From this perspective, the users of mobile devices also become mobile sensing devices.This fact leads to the term "citizens as sensors", which is very common today in the paradigm of smart cities [24].This means of sensorization is often called urban sensing, since it is especially suitable for large urban centers with a high population density, but can be implemented in any environment.This is a step forward from current sensor networks because people are no longer just consumers of information, but also produce it.This way, they are part of the process and can assume both roles ("human-in-the-loop") [25].Humans not only act as sensors, but also preprocess and analyze the collected information, introducing subjective factors based on the experience and knowledge of the context.The dissemination of information is nearly immediate, offering the data and observations of users in real time.

Data Mining
Data mining (DM) is an automatic process of analyzing information to discover patterns and to build predictive models [26].The DM process is divided into three stages [27,28]:

•
Preprocessing stage: All the data containing noise or inconsistencies are eliminated, data from multiple sources are integrated, and data are properly formatted.Some preprocessing techniques are the outlier analysis, the adjustment of time-dependent data, the treatment of missing data, and data transformation (e.g., normalization).

•
Modeling stage: Predictive or descriptive models are possible.Predictive models answer questions related to future data.Descriptive models provide information about data relationships and their features.Some of the common modeling techniques are regression, time series, discriminant analysis, artificial neural networks (ANN), K-means algorithms, association rules, Bayesian networks, and genetic algorithms (GAs).
• Assessment of the key performance indicator (KPI) stage: KPIs are used to measure the performance of the process.KPIs may be related to relevance, novelty, quality, or applicability, among others.
Predictive analysis is the application of data mining techniques on large amounts of data that are not significant at a glance with the aim of finding new, meaningful, and useful information.The information can reveal patterns of behavior, trends, and cause-effect relationships.This fact allows the interpretation of historical data, the anticipation of future events, and their causes.
Like databases, traditional analysis methods have also had to adapt to the size and complexity of data mining formats.Mahout is a project of the Apache Software Foundation to produce free implementations (distributed or scalable) of machine learning algorithms, focusing mainly on the areas of collaborative filtering, grouping, and classification [29].Many of the implementations use the Apache Hadoop platform.
Predictive analysis of data is gaining importance every day.Gartner states that the market of business intelligence (BI) platforms and data analysis is immersed in an accelerated transformation, from BI systems used primarily to perform measures and reports to systems that also provide analysis tools for prediction, forecasting, and optimization [30].In fact, one of the new features that Gartner has recently incorporated into the BI quadrant is the inclusion of advanced analysis in the study tools, which include common analytical methods based on the standard predictive model markup language (PMML) and R-based models.

Ontology
Modeling the huge amount of information within the system is therefore a crucial task.As such, we propose the use of ontologies with this aim.There are many definitions of the concept of ontology.Studer et al. provided one of the best-known definitions: an ontology is a formal and explicit specification of a shared conceptualization [31].Ontologies have emerged to standardize and facilitate interoperability of current systems.Several European Union initiatives have tried to harmonize the architecture and the specifications of smart city platforms.Among these initiatives, FIWARE is the most relevant.FIWARE is a public-private initiative on which the European Commission and the private sector collaborate.The main objective of FIWARE is to support several technological aspects of smart cities such as IoT (Internet of Things) device management, data and context management, big data storage, open data management, advanced dashboard, security, and cloud management.FIWARE is based on the principles of interoperability, modularity, generality, and reusability.The smart city context is the one where most FIWARE-based architectures have been applied [32].Thus, the design of social parking follows FIWARE standards.
There are different approaches to the formalization (and implementation) of ontologies that may help in the representation of knowledge.All of these approaches share a minimum set of components: classes, properties, relations, and instances [33].The following generic rules are considered:

•
There is no unique way to model a domain, so there are multiple alternatives to modeling the same domain.In this way, the best model depends on the final objective and its potential extensions.

•
The development of an ontology must be conceived as an iterative process, gradually modeling the objective structure.

•
The concepts included in an ontology should be close to objects, whether physical or logical.
To model the ontology described later in this paper, the previous generic rules were followed.These rules were particularized for the management of parking lots.

Design and Implementation
Social parking was designed with two main objectives.The first objective is making parking easier for users by forecasting the number of free spots in a parking slot or a parking area.With this aim, a forecast algorithm was designed, as described in Section 5.However, it is necessary to identify the current empty spots in the parking lot, so the spots should be marked and registered.This is done by means of a unique identifier and the creation of a fixed map of the parking spots to be monitored.The users will be in charge of informing the system when a parking spot is empty or not, by pointing out the unique identifier of the spot and the action taken (check-in or check-out).This way, the citizens as sensors paradigm is used.
The system detects empty and full spots in real time.It also logs the spot occupation history, to be able to take advantage of the use of data mining techniques to extract relevant information.The system includes the management and administration of parking lots with the aim of implementing measures to prevent fraud as well as managing payments, billing, and fines when suitable.The system was designed within a general ontology that comprises all the concepts that are related to parking.Thus, the model may be generalized for any type of parking.
The second objective of social parking is the standardization of the collected information.Thus, an ontology was designed and is described in Section 6.
The validity of the proposed system was proven as a case of use in the Urban Lab Málaga, as explained in Section 7.
Figure 1 shows the social parking schematic design.out the unique identifier of the spot and the action taken (check-in or check-out).This way, the citizens as sensors paradigm is used.
The system detects empty and full spots in real time.It also logs the spot occupation history, to be able to take advantage of the use of data mining techniques to extract relevant information.The system includes the management and administration of parking lots with the aim of implementing measures to prevent fraud as well as managing payments, billing, and fines when suitable.The system was designed within a general ontology that comprises all the concepts that are related to parking.Thus, the model may be generalized for any type of parking.
The second objective of social parking is the standardization of the collected information.Thus, an ontology was designed and is described in Section 6.
The validity of the proposed system was proven as a case of use in the Urban Lab Málaga, as explained in Section 7.
Figure 1 shows the social parking schematic design.

General Architecture
Some of the factors that we must consider when designing the system architecture are the following:


The operational database contains all the data required for the functioning of the system: users, parking lots, spots, vehicles, fees, etc.This was designed as a subset of the parking general ontology (see later in Section 6), in order not to change the basic data structure if new parking methods are added in the future.


Business logic includes all of the operative functions of the parking system, that is, check in and check out, user and vehicle management, parking spot management, fines, and billing. User interfaces are web applications and mobile applications.They provide specific functions for every user profile.


Communication between client applications and the kernel of the system take place throughout a web service layer in the shape of API REST.This includes check in, check out, payment creation, bill creation, parking spot search, parking check, fine creation, and fine cancellation. Management operations that involve massive procedures use batch processes.These operations are credit card payment, email bill sending, and review and automatic spot release.

General Architecture
Some of the factors that we must consider when designing the system architecture are the following: • The operational database contains all the data required for the functioning of the system: users, parking lots, spots, vehicles, fees, etc.This was designed as a subset of the parking general ontology (see later in Section 6), in order not to change the basic data structure if new parking methods are added in the future.

•
Business logic includes all of the operative functions of the parking system, that is, check in and check out, user and vehicle management, parking spot management, fines, and billing.

•
User interfaces are web applications and mobile applications.They provide specific functions for every user profile.

•
Communication between client applications and the kernel of the system take place throughout a web service layer in the shape of API REST.This includes check in, check out, payment creation, bill creation, parking spot search, parking check, fine creation, and fine cancellation.
• Management operations that involve massive procedures use batch processes.These operations are credit card payment, email bill sending, and review and automatic spot release.

•
The datawarehouse of the business intelligence system logs the occupation data of every parking lot included in the platform.Other information that can affect occupation such as weather reports, traffic information, or existing events is also collected.

•
The data analysis of KPI defines the occupation patterns.Combining them with real-time information, it is possible to make short and long-term predictions.
Figure 2 shows the system architecture.


The datawarehouse of the business intelligence system logs the occupation data of every parking lot included in the platform.Other information that can affect occupation such as weather reports, traffic information, or existing events is also collected.


The data analysis of KPI defines the occupation patterns.Combining them with real-time information, it is possible to make short and long-term predictions.
Figure 2 shows the system architecture.

Technical Design
The system was executed on a server.This server also hosts the system database and the connector that manages web queries.The system is implemented as a Java app, using the Spring framework, while the database uses MySQL.Connector implementation is based on JSON, Restlets, and SSL.The development of the system was oriented to minimize channel traffic and increase the speed of transmission.The combination of all of these technologies also allows for a remarkable rise in efficiency and security.
The ionic framework was chosen for the development of client applications.This allows the development of mobile device apps, using web tools as HTML5, CSS3, and Javascript.These are hybrid applications and may work with IOS and Android devices.
To build the control panel, the OBI (Oracle Business Intelligence) tool was used.The control panel utilizes a specific data warehouse, which loads data from the central database.However, these data were adapted for their exploitation for a BI system.Databases also stored the historical data series and the occupation patterns of different parking slots.

Forecast Algorithm Design
As introduced in previous sections, the problem of finding parking in a city is one of the main concerns of a driver when traveling to a destination.This concern can significantly condition the planned route, modifying it or increasing the trip cost.In the process of determining parking trends, two different dynamics come into play.On one hand, the number of free parking spots in an area is subject to a slow rate of variability.This variability is due to local regulations.On the other hand, the demand for parking areas is a faster dynamic, being subject to many factors that must be considered: weather conditions, day of the week, time of year, local calendar, important events, and unexpected situations like works or floods.Moreover, we must add the increasing trend in the number of vehicles in relation to the population of a city.As an immediate consequence of the combination of these two dynamics, a random distribution of the availability of parking spots is obtained.The knowledge of

Technical Design
The system was executed on a server.This server also hosts the system database and the connector that manages web queries.The system is implemented as a Java app, using the Spring framework, while the database uses MySQL.Connector implementation is based on JSON, Restlets, and SSL.The development of the system was oriented to minimize channel traffic and increase the speed of transmission.The combination of all of these technologies also allows for a remarkable rise in efficiency and security.
The ionic framework was chosen for the development of client applications.This allows the development of mobile device apps, using web tools as HTML5, CSS3, and Javascript.These are hybrid applications and may work with IOS and Android devices.
To build the control panel, the OBI (Oracle Business Intelligence) tool was used.The control panel utilizes a specific data warehouse, which loads data from the central database.However, these data were adapted for their exploitation for a BI system.Databases also stored the historical data series and the occupation patterns of different parking slots.

Forecast Algorithm Design
As introduced in previous sections, the problem of finding parking in a city is one of the main concerns of a driver when traveling to a destination.This concern can significantly condition the planned route, modifying it or increasing the trip cost.In the process of determining parking trends, two different dynamics come into play.On one hand, the number of free parking spots in an area is subject to a slow rate of variability.This variability is due to local regulations.On the other hand, the demand for parking areas is a faster dynamic, being subject to many factors that must be considered: weather conditions, day of the week, time of year, local calendar, important events, and unexpected situations like works or floods.Moreover, we must add the increasing trend in the number of vehicles in relation to the population of a city.As an immediate consequence of the combination of these two dynamics, a random distribution of the availability of parking spots is obtained.The knowledge of this distribution is of vital importance to reduce both parking search times and the situations arising from this search such as bottlenecks and the increase in energy consumption and pollution levels.
In Section 2, several approaches to a solution were mentioned [15][16][17][18].These approaches involve the deployment of additional hardware over available parking areas, which makes them difficult to implement.Rajabioun and Ioannou proposed an algorithm, since parking availability is a stochastic process [34].Wu et al. presented an algorithm for parking probability estimation [35].Both papers did not consider some of the variables above-mentioned such as the weather or the time of year.However, we assumed part of their notations and definitions.
Our proposal also assumed a basic information infrastructure in the parking areas, where only the number of free spots is available in real time.However, this information is temporary and has less value the further away the destination is.That is, if someone wants to find a parking spot in a destination, he or she may know of its availability at the departure time, but not at the arrival time.Therefore, the trip time should be considered as well as the application of the usual contending mechanisms.This fact highlights the problem of determining available parking spots as a stochastic process, where the number of spots is a random variable, which is also a function of the trip time.
As such, we propose a forecast algorithm to estimate the number of free parking spots in a parking slot.We defined the following variables as: PL n is the number of free spots in parking lot n.

•
L n is the location of parking lot n.
T 0,i is the trip time from 0 to i. • P(T 0,i ) represents the probability that parking lot i has free spots after time T 0,i An example of a trip searching for a parking spot is shown in Figure 3. Every parking lot n in the trip is associated with a GPS location, L n ; a trip time, T 0,n , which is computed with a GPS navigation system, according to the context of the execution of the forecast (distance, road type, and traffic state); the number of free spots within a parking lot, PL n ; and the probability of finding a free parking slot, P(T 0,i ).This probability is obtained by statistically considering the historical data.Its evaluation is associated with a Gaussian distribution with a mean and standard deviation that are time dependent.Next, a case of study is considered to show the procedure to obtain P(T 0,i ).this distribution is of vital importance to reduce both parking search times and the situations arising from this search such as bottlenecks and the increase in energy consumption and pollution levels.In Section 2, several approaches to a solution were mentioned [15][16][17][18].These approaches involve the deployment of additional hardware over available parking areas, which makes them difficult to implement.Rajabioun and Ioannou proposed an algorithm, since parking availability is a stochastic process [34].Wu et al. presented an algorithm for parking probability estimation [35].Both papers did not consider some of the variables above-mentioned such as the weather or the time of year.However, we assumed part of their notations and definitions.
Our proposal also assumed a basic information infrastructure in the parking areas, where only the number of free spots is available in real time.However, this information is temporary and has less value the further away the destination is.That is, if someone wants to find a parking spot in a destination, he or she may know of its availability at the departure time, but not at the arrival time.Therefore, the trip time should be considered as well as the application of the usual contending mechanisms.This fact highlights the problem of determining available parking spots as a stochastic process, where the number of spots is a random variable, which is also a function of the trip time.
As such, we propose a forecast algorithm to estimate the number of free parking spots in a parking slot.We defined the following variables as:


PLn is the number of free spots in parking lot n.


Ln is the location of parking lot n.  L0 is the starting position of car C.  T0,i is the trip time from 0 to i.  P(T0,i) represents the probability that parking lot i has free spots after time T0,i An example of a trip searching for a parking spot is shown in Figure 3. Every parking lot  in the trip is associated with a GPS location,   ; a trip time,  0, , which is computed with a GPS navigation system, according to the context of the execution of the forecast (distance, road type, and traffic state); the number of free spots within a parking lot,   ; and the probability of finding a free parking slot, ( 0, ).This probability is obtained by statistically considering the historical data.Its evaluation is associated with a Gaussian distribution with a mean and standard deviation that are time dependent.Next, a case of study is considered to show the procedure to obtain ( 0, ).Thus, the number of free parking slots in a parking lot PLn may be calculated by employing Equation (1).Thus, the number of free parking slots in a parking lot PL n may be calculated by employing Equation (1). where PL H is the number of free spots in parking lot n, according to the historical pattern.

•
PL RT is the current number of free spots in parking lot n (in real time).

•
PL RT-H is the difference between the current number of free spots in parking lot n (in real time) and the number of free spots according to the historical pattern.

•
W W is the weight for the weather conditions.• W E is the weight for the local events.• W LC is the weight for the local calendar.• W T is the weight for the traffic conditions.W T does not deal with the current traffic condition, but with the importance of traffic conditions in the historical data for a parking lot.• F C is the current factor (expected arrival time).This factor determines the importance of the current value in comparison with the historical value.F C is a time dependent variable.The older the free parking slots forecast is, the closer to zero F C is.
Every weight is evaluated in the range [0, 1].A value of 0 means that the associated factor (weather conditions, local events, local calendar, and traffic conditions) has no influence over the historical data, while a value of 1 means that the historical data is heavily influenced by this factor.For example, if we consider that the weather conditions have a high influence on the parking lot under evaluation, a realistic value could be 0.9.
To determine the value of these factors, we proceeded to the analysis of historical data of real parking lots.The city selected for analysis was Zaragoza (Spain).We chose Zaragoza because it has a public service data publication platform with easy-to-integrate interfaces with automated information extraction systems.This city has a population of 664,938 inhabitants [36], thus we can generalize the results to any medium sized city.The parking data are among those selected on the platform [37].Four-month data were used for training or analysis, while data from six weeks were used to verify the forecast algorithm.Verification is explained in subsection B in this section.In this way, we analyzed parking data from September 2017 to January 2018.
The process of obtaining the occupation patterns of a parking lot was based on the characterization of the daily occupation of each parking lot using data mining techniques.This way, historical information was synthesized in daily patterns.The following factors were considered to classify the different patterns:

•
Working days versus weekends (Saturdays and Sundays) and holidays.
As a data mining tool for the analysis of historical data, the IBM SPSS Modeler application was used.As an example of the analysis, we present the results obtained on working days and compared them with the ones obtained on weekends and holidays.The Christmas period was excluded.Figure 4 shows these patterns as raw data, while in Figure 5, data are merged following the criterion of obtaining the mean and the standard deviation as well as the maximum and minimum values.
an example of the analysis, we present the results obtained on working days and compare th the ones obtained on weekends and holidays.The Christmas period was excluded.Figu these patterns as raw data, while in Figure 5, data are merged following the criterion g the mean and the standard deviation as well as the maximum and minimum values.dying the different days separately, the results showed that the behavior of the availabilit working days did not differ significantly between the different days of the week (Monday Wednesday, Thursday, and Friday).This is shown in Figure 4, which contains the pattern the working days.As seen in Figure 4, the studied parking lot was nearly empty at nigh re were two peaks of occupation, especially in the evening.Looking at the graphics, we ar ee the type of area we studied.In this case, it was a commercial area.Therefore, it wa d that only a pattern chart was needed to specify the parking availability behavior o days.The standard deviation measured the dispersion of the availability in the same ten Studying the different days separately, the results showed that the behavior of the availability curve of working days did not differ significantly between the different days of the week (Monday, Tuesday, Wednesday, Thursday, and Friday).This is shown in Figure 4, which contains the patterns for all of the working days.As seen in Figure 4, the studied parking lot was nearly empty at night, while there were two peaks of occupation, especially in the evening.Looking at the graphics, we are able to see the type of area we studied.In this case, it was a commercial area.Therefore, it was concluded that only a pattern chart was needed to specify the parking availability behavior on working days.The standard deviation measured the dispersion of the availability in the same ten-minute fraction.As seen in Figure 5, the standard deviation was small.Figures 6 and 7 represent patterns and merged data for weekends and holidays.The standard deviation was much higher on weekends, especially in the afternoon.This fact reflects the greater difficulty of a forecast on weekends, contrary to the more routine working days.
while there were two peaks of occupation, especially in the evening.Looking at the graphics, we are able to see the type of area we studied.In this case, it was a commercial area.Therefore, it was concluded that only a pattern chart was needed to specify the parking availability behavior on working days.The standard deviation measured the dispersion of the availability in the same tenminute fraction.As seen in Figure 5, the standard deviation was small.
Figures 6 and 7 represent patterns and merged data for weekends and holidays.The standard deviation was much higher on weekends, especially in the afternoon.This fact reflects the greater difficulty of a forecast on weekends, contrary to the more routine working days.As above-mentioned, Sundays, holidays, days with special events, and days with adverse weather conditions were also studied in eight different parking lots across the city of Zaragoza.In this way, we could determine the weights defined in Equation ( 1) and test our approach.Results are shown below in Section 5.2.

Algorithm Verification
With the aim of verifying our forecast algorithm, we checked real parking occupation for six weeks from April 2018 to May 2018.There was a holiday season (from 5 April to 8 April) and one holiday (1 May).There were also 15 rainy days [38].We considered the mean percentage error (MPE) as a measure of the accuracy of our forecast algorithm.MPE is defined as shown in Equation ( 2), where at is the actual value; ft is the forecast; and n is the number of times the variable has been forecasted [39].
Moreover, the obtained results are shown in Table 1.As above-mentioned, Sundays, holidays, days with special events, and days with adverse weather conditions were also studied in eight different parking lots across the city of Zaragoza.In this way, we could determine the weights defined in Equation ( 1) and test our approach.Results are shown below in Section 5.2.

Algorithm Verification
With the aim of verifying our forecast algorithm, we checked real parking occupation for six weeks from April 2018 to May 2018.There was a holiday season (from 5 April to 8 April) and one holiday (1 May).There were also 15 rainy days [38].We considered the mean percentage error (MPE) as a measure of the accuracy of our forecast algorithm.MPE is defined as shown in Equation ( 2), where a t is the actual value; f t is the forecast; and n is the number of times the variable has been forecasted [39].
Moreover, the obtained results are shown in Table 1.The algorithm showed some good results in working days and weekends.An example of the forecast in a working day in parking lot #1 is shown in Figure 8.

Ontology Design
This section describes the design of an ontology.The ontology defines all the features that are related to parking including a generic scheme of characterization of parking lots, how they are utilized, and the extrinsic factors that affect occupation.This way, the system can easily be extended to include parking lots that follow different models (traditional sensors, blue zone, parking barrier, parking meters, etc.) and can be applied to any city in the world.
To model this ontology, the generic rules defined in Section 3.3 were followed, particularly applying them for parking lots.These rules establish a set of steps that make up a clear and concise methodology to define, first, the design of the ontology, and then its development and evolution.These steps are shown in Figure 9 and described below.
Step 4. Index terms Step 1. Design setting Step 2. Structure design Step 3. Technology selection Step 5.

Classes and hierarchy
Step 6. Class properties

Ontology development and evolution
Figure 9. Methodology for the design on the ontology.
Step 1. Domain setting.The initial step when we design any ontology is to define the ontology domain.In our case, the ontology domain is the management of the parking system.

Ontology Design
This section describes the design of an ontology.The ontology defines all the features that are related to parking including a generic scheme of characterization of parking lots, how they are utilized, and the extrinsic factors that affect occupation.This way, the system can easily be extended to include parking lots that follow different models (traditional sensors, blue zone, parking barrier, parking meters, etc.) and can be applied to any city in the world.
To model this ontology, the generic rules defined in Section 3.3 were followed, particularly applying them for parking lots.These rules establish a set of steps that make up a clear and concise methodology to define, first, the design of the ontology, and then its development and evolution.These steps are shown in Figure 9 and described below.

Ontology Design
This section describes the design of an ontology.The ontology defines all the features that are related to parking including a generic scheme of characterization of parking lots, how they are utilized, and the extrinsic factors that affect occupation.This way, the system can easily be extended to include parking lots that follow different models (traditional sensors, blue zone, parking barrier, parking meters, etc.) and can be applied to any city in the world.
To model this ontology, the generic rules defined in Section 3.3 were followed, particularly applying them for parking lots.These rules establish a set of steps that make up a clear and concise methodology to define, first, the design of the ontology, and then its development and evolution.These steps are shown in Figure 9 and described below.
Step 4. Index terms Step 1. Design setting Step 2. Structure design Step 3. Technology selection Step 5.

Classes and hierarchy
Step 6. Class properties

Ontology development and evolution
Figure 9. Methodology for the design on the ontology.
Step 1. Domain setting.The initial step when we design any ontology is to define the ontology domain.In our case, the ontology domain is the management of the parking system.
Step 2. Structure design.The semantic resources provided by the OWL specification are used, with special emphasis on the following recommendations: Step 1. Domain setting.The initial step when we design any ontology is to define the ontology domain.In our case, the ontology domain is the management of the parking system.
Step 2. Structure design.The semantic resources provided by the OWL specification are used, with special emphasis on the following recommendations:

•
Class specialization.For a better classification of domain elements, classes are grouped into a hierarchic system.

•
Multiple inheritances are supported, unlike certain object-oriented languages like Java.This is an option allowed by OWL, which can provide greater semantics to the model.

•
Individuals, not classes, are defined as far as possible for those entities that can be unique individuals.

•
The definition of equivalent derived classes can simplify the process of classification using reasoners.
Step 3. Technology selection.OWL and Protegé are the most widespread language and software tools [40] and have therefore been selected as the most appropriate for the development of the ontological model of social parking data types.Furthermore, RDF is considered as a complementary language to OWL, SPARQL, and Apache JENA as query languages, and HermiT Reasoner as a reasoning engine.
Step 4. Index terms.Includes a summary of the concepts that are related to the ontology domain without establishing relationships between them.Most important terms are parking lot (as a space for car parking), type of area, sensing type, context, and occupation.
Step 5. Classes and hierarchy.Terms are classified and included in a hierarchic structure.
Step 6. Class properties.step gets inside the classification, identifying how properties define classes, and defining new classes according to their properties.
Following these steps, the parking ontology is defined.It models the information that is used in a parking spot, from the characterization and categorization of parking lots to the external environmental and contextual factors that can affect occupancy levels.The ontology collects and classifies all sources of historical information.All of these sources are analyzed to obtain the occupancy patterns of parking lots.Real-time data sources are combined with the obtained patterns to predict availability in the short and medium term.Looking ahead, we tried to design a flexible ontology in the case new relevant information is added.
Figure 10 shows the most important concepts for the ontology: Characterization, which defines and classifies parking lots; Context, which is external to parking lots, but has an influence on occupation; and OccupancyMeasurement.


The definition of equivalent derived classes can simplify the process of classification using reasoners.
Step 3. Technology selection.OWL and Protegé are the most widespread language and software tools [40] and have therefore been selected as the most appropriate for the development of the ontological model of social parking data types.Furthermore, RDF is considered as a complementary language to OWL, SPARQL, and Apache JENA as query languages, and HermiT Reasoner as a reasoning engine.
Step 4. Index terms.Includes a summary of the concepts that are related to the ontology domain without establishing relationships between them.Most important terms are parking lot (as a space for car parking), type of area, sensing type, context, and occupation.
Step 5. Classes and hierarchy.Terms are classified and included in a hierarchic structure.
Step 6. Class properties.This step gets inside the classification, identifying how properties define classes, and defining new classes according to their properties.Following these steps, the parking ontology is defined.It models the information that is used in a parking spot, from the characterization and categorization of parking lots to the external environmental and contextual factors that can affect occupancy levels.The ontology collects and classifies all sources of historical information.All of these sources are analyzed to obtain the occupancy patterns of parking lots.Real-time data sources are combined with the obtained patterns to predict availability in the short and medium term.Looking ahead, we tried to design a flexible ontology in the case new relevant information is added.
Figure 10 shows the most important concepts for the ontology: Characterization, which defines and classifies parking lots; Context, which is external to parking lots, but has an influence on occupation; and OccupancyMeasurement.The characterization class is subdivided into different subclasses, and subclasses are split in more subclasses.For instance, the subclass Car Park is split in On Road and Off Road.Other features deal with the fact that parking spots should have one Entrance, at least, or the fact that parking spots cover Streets and may use Ticket Machines based on the criteria of rate, maximum stay, and minimum and maximum costs imposed by its Regulation Area.Regardless of the type of parking, all of them are made of parking slots (ParkingBay), that is, divisions, delimited or not, within a parking area.The location Area is also a relevant factor in the characterization of car parking, as the predominant activity of the zone decisively influences the occupancy patterns of the parking lot.The characterization class is subdivided into different subclasses, and subclasses are split in more subclasses.For instance, the subclass Car Park is split in On Road and Off Road.Other features deal with the fact that parking spots should have one Entrance, at least, or the fact that parking spots cover Streets and may use Ticket Machines based on the criteria of rate, maximum stay, and minimum and maximum costs imposed by its Regulation Area.Regardless of the type of parking, all of them are made of parking slots (ParkingBay), that is, divisions, delimited or not, within a parking area.
The location Area is also a relevant factor in the characterization of car parking, as the predominant activity of the zone decisively influences the occupancy patterns of the parking lot.
All of these concepts must also be represented, as shown in Figure 11.Depending on their use, parking spaces can be classified into several categories: reserved for disabled; for electric vehicles, usually equipped with mechanisms to charge the battery, and with limited stay; loading and unloading; reserved for subscribers (Subscriber); with shared use between subscribers and visitors; and finally, common use spots (Free).
According to the area, some different non-excluding areas were identified: Residential; Commercial; Industrial; Touristic; Transport; University; Hospital; and Entertainment.
Blue zone on-road parking lots provide information through the data obtained in Ticket Machines.The information gathered includes the date and time of issue, the period of validity, and, if necessary, the complaint date.The occupation measurement obtained from these data is an estimation, as many factors can affect occupation.For example, spots may be occupied by residents, who do not need tickets, vehicles can be irregularly parked, complaints may not be canceled, etc.Likewise, off-road parking provides more or less information depending on the degree of sensorization.
Last, the Context class deals with the aspects that are not related to parking lots, but have quite a direct influence in occupation patterns.
In particular, the Events associated with parking in an Area must be considered, for example, a concert in the congress hall.The weather also has a great impact on the use of parking.For instance, a covered parking lot may have a higher occupation on rainy days.The MeteoMeasurements class represents the meteorological conditions (wind, rain, and temperature) in an area.Traffic density is another factor to consider.The TrafficMeasurement class reflects the density of traffic measured in an area.In addition, the concept of a local calendar (Calendar) was added to the ontology to reflect the influence of periodic variable factors in the occupation such as working or non-working days.

Validation of Social Parking
As discussed in Section 3, a set of applications were implemented for the validation of the system.These applications allowed the testing of all the functions of the parking system.A client mobile application allows users with iOS and Android phones to use social parking features.The application has the following functions:


Creation of user account, login, and logout.


Vehicle maintenance (allows a user to park with several different vehicles). Parking (Check-in) and Release parking (Check-out).This allows a user to read a parking spot OCR (optical character recognition) or enter data manually. Viewing parking history.


Requesting a parking invoice (the user receives a PDF format invoice by email).


Finding parking lots near a destination.There is a map containing the parking lots and the number of parking spots that are available at any time.


Calling the phone navigation application for guidance to the selected parking lot.
The designed client mobile application is shown in Figure 12.Depending on their use, parking spaces can be classified into several categories: reserved for disabled; for electric vehicles, usually equipped with mechanisms to charge the battery, and with limited stay; loading and unloading; reserved for subscribers (Subscriber); with shared use between subscribers and visitors; and finally, common use spots (Free).
According to the area, some different non-excluding areas were identified: Residential; Commercial; Industrial; Touristic; Transport; University; Hospital; and Entertainment.
Blue zone on-road parking lots provide information through the data obtained in Ticket Machines.The information gathered includes the date and time of issue, the period of validity, and, if necessary, the complaint date.The occupation measurement obtained from these data is an estimation, as many factors can affect occupation.For example, spots may be occupied by residents, who do not need tickets, vehicles can be irregularly parked, complaints may not be canceled, etc.Likewise, off-road parking provides more or less information depending on the degree of sensorization.
Last, the Context class deals with the aspects that are not related to parking lots, but have quite a direct influence in occupation patterns.
In particular, the Events associated with parking in an Area must be considered, for example, a concert in the congress hall.The weather also has a great impact on the use of parking.For instance, a covered parking lot may have a higher occupation on rainy days.The MeteoMeasurements class represents the meteorological conditions (wind, rain, and temperature) in an area.Traffic density is another factor to consider.The TrafficMeasurement class reflects the density of traffic measured in an area.In addition, the concept of a local calendar (Calendar) was added to the ontology to reflect the influence of periodic variable factors in the occupation such as working or non-working days.

Validation of Social Parking
As discussed in Section 3, a set of applications were implemented for the validation of the system.These applications allowed the testing of all the functions of the parking system.A client mobile application allows users with iOS and Android phones to use social parking features.The application has the following functions:

•
Creation of user account, login, and logout.

•
Vehicle maintenance (allows a user to park with several different vehicles).

•
Parking (Check-in) and Release parking (Check-out).This allows a user to read a parking spot OCR (optical character recognition) or enter data manually.

•
Viewing parking history.

•
Requesting a parking invoice (the user receives a PDF format invoice by email).
• Finding parking lots near a destination.There is a map containing the parking lots and the number of parking spots that are available at any time.

•
Calling the phone navigation application for guidance to the selected parking lot.
The designed client mobile application is shown in Figure 12.A controller mobile application driver allows parking lot controllers with iOS and Android phones to control the parking lots in social parking.The application has the following functions:


Login and logout in the application.


It allows a user to read a parking spot or car license OCR or enter data manually.


Checking and generating a fine in the system in case the vehicle should not be parked in some parking spot. Cancellation of fines.
The designed controller mobile application is shown in Figure 13.Web responsive applications were also designed.They allow the use of social parking for A controller mobile application driver allows parking lot controllers with iOS and Android phones to control the parking lots in social parking.The application has the following functions:

•
Login and logout in the application.

•
It allows a user to read a parking spot or car license OCR or enter data manually.

•
Checking and generating a fine in the system in case the vehicle should not be parked in some parking spot.

•
Cancellation of fines.
The designed controller mobile application is shown in Figure 13.A controller mobile application driver allows parking lot controllers with iOS and Android phones to control the parking lots in social parking.The application has the following functions:

•
Login and logout in the application.

•
It allows a user to read a parking spot or car license OCR or enter data manually.

•
Checking and generating a fine in the system in case the vehicle should not be parked in some parking spot.

•
Cancellation of fines.
The designed controller mobile application is shown in Figure 13.Web responsive applications were also designed.They allow the use of social parking for customers who do not own devices with iOS and Android systems, or for controllers by means of tablets.In addition, a web responsive application for the administration of the system was Web responsive applications were also designed.They allow the use of social parking for customers who do not own devices with iOS and Android systems, or for controllers by means of tablets.In addition, a web responsive application for the administration of the system was implemented.
Some tests for the validation of social parking were carried out in three experimental parking lots in Urban Lab Málaga.Urban Lab Málaga was designed so that companies and universities could have advanced technological infrastructure resources as well as a physical and logical environment to produce prototypes and for the performance of validation tests [41].The choice of the city of Malaga was due to the existence of an urban laboratory in which to test our system.Another reason for its choice was its medium size, similar to Zaragoza, the city that we had previously validated the forecast algorithm.Málaga has a population of 569,002 inhabitants [36].Figure 14 shows the parking lots on a map, while Figure 15 shows the parking spot identification in detail.Malaga was due to the existence of an urban laboratory in which to test our system.Another reason for its choice was its medium size, similar to Zaragoza, the city that we had previously validated the forecast algorithm.Málaga has a population of 569,002 inhabitants [36].Figure 14 shows the parking lots on a map, while Figure 15 shows the parking spot identification in detail.During the validation, the ease and speed of the check-in and check-out processes were tested.Special attention was paid to the OCR capture of parking spot codes.We considered the option of loading it this way to make the process as agile as possible, both for the drivers and for the zone controllers.The tests were carried out using an Android smartphone (Huawei P8) with a 2 GHz octacore Kirin 930 processor.A camera equipped with a Sony 13-megapixel RGBW sensor was available in the smartphone.The tests were performed on clear days, with the sun in the zenithal position.A 4G cellular network was used.
The test procedure was done according to the following steps: First, after the driver parked the car, he/she started the app.Second, the driver took a picture of the parking spot code, launching the OCR process.Last, both identifiers were uploaded to a server.Several drivers carried out the tests, taking between 10 and 15 seconds for the whole process.Comparing this procedure with the traditional one based on parking meters, we estimated that social parking saved about 90% of the Malaga was due to the existence of an urban laboratory in which to test our system.Another reason for its choice was its medium size, similar to Zaragoza, the city that we had previously validated the forecast algorithm.Málaga has a population of 569,002 inhabitants [36].Figure 14 shows the parking lots on a map, while Figure 15 shows the parking spot identification in detail.During the validation, the ease and speed of the check-in and check-out processes were tested.Special attention was paid to the OCR capture of parking spot codes.We considered the option of loading it this way to make the process as agile as possible, both for the drivers and for the zone controllers.The tests were carried out using an Android smartphone (Huawei P8) with a 2 GHz octacore Kirin 930 processor.A camera equipped with a Sony 13-megapixel RGBW sensor was available in the smartphone.The tests were performed on clear days, with the sun in the zenithal position.A 4G cellular network was used.
The test procedure was done according to the following steps: First, after the driver parked the car, he/she started the app.Second, the driver took a picture of the parking spot code, launching the OCR process.Last, both identifiers were uploaded to a server.Several drivers carried out the tests, taking between 10 and 15 seconds for the whole process.Comparing this procedure with the traditional one based on parking meters, we estimated that social parking saved about 90% of the time.During the validation, the ease and speed of the check-in and check-out processes were tested.Special attention was paid to the OCR capture of parking spot codes.We considered the option of loading it this way to make the process as agile as possible, both for the drivers and for the zone controllers.The tests were carried out using an Android smartphone (Huawei P8) with a 2 GHz octa-core Kirin 930 processor.A camera equipped with a Sony 13-megapixel RGBW sensor was available in the smartphone.The tests were performed on clear days, with the sun in the zenithal position.A 4G cellular network was used.

Discussion
The test procedure was done according to the following steps: First, after the driver parked the car, he/she started the app.Second, the driver took a picture of the parking spot code, launching the OCR process.Last, both identifiers were uploaded to a server.Several drivers carried out the tests, taking between 10 and 15 seconds for the whole process.Comparing this procedure with the traditional one based on parking meters, we estimated that social parking saved about 90% of the time.

Discussion
Nowadays, there are many PGI systems that have been developed around the world with different approaches.One of the most used paradigms is based on the sensorization of parking spots to obtain real-time exact occupation information.The main problem of this type of system is the high cost of the initial investment in the installation of the devices, in addition to the subsequent costs of the maintenance and conservation of the sensor network.For these reasons, the sensorization of parking spots is usually limited to relatively reduced parking areas.These are more common in off-road parking lots, where maintenance is simpler, since the network is not exposed to traffic, weather conditions, vandalism, etc.
Our proposal is based on the concept of citizens as sensors.Since physical measuring devices are not necessary, the cost of deploying and maintaining the system is considerably reduced.This fact allows the coverage to be extended to a much larger number of spots, regardless of their location and characteristics.
Social parking has two main objectives: the estimation of the number of free spots in a parking lot, and the standardization of the collected information.
We designed a forecast algorithm to estimate the number of free parking spots in a parking slot.We had to consider the differences between working and non-working days, holiday periods, special events, and the influence of meteorological conditions on parking habits.To verify our algorithm, we used some publicly available historical parking data in the city of Zaragoza, a medium-sized city, and checked our forecasts using newly acquired data.
On the other hand, an ontology that defines a generic parking model was designed.This included an accurate characterization of parking lots, and external factors that influence their occupation.The use of ontology as the basis for the data model allows the system to be directly applicable to any type of parking and to any city in the world.Additionally, social parking is designed to be compatible with the FIWARE platform.This way, the system can be integrated with FIWARE and other open platforms and easily implemented in smart city environments that follow European standards.In addition, the solution is not only limited to providing information in real time on parking areas, but it employs data mining techniques and predictive analysis to offer citizens and city managers short, medium, and long term forecasts on the probabilities of the occupation of parking lots.This fact allows citizens to plan their trips in advance and enables managers to anticipate the needs that arise in terms of parking.
Finally, a set of applications was implemented for the validation of the system.Some tests for the validation of social parking were carried out in three experimental parking lots in Urban Lab Málaga, another medium-sized city.Urban Lab is a space for urban innovation and the development of ideas and technological projects, equipped with an urban laboratory to experiment with projects related to smart cities, among other technologies.A 90% time-saving was achieved with respect to traditional parking meters.This fact confirms the great potential of this solution, at least in medium-sized cities.
Thus, the citizens as sensors paradigm reveals an ideal solution for the parking guidance information problem, reducing costs significantly, and allowing a rapid expansion of controlled parking areas.

Limitations of the Study
Although we have carefully reviewed all aspects of the paper, we are aware that the study has two important limitations.We refer to them below.
First of all, the citizens or drivers were used as sensors in the study.How can we technically guarantee this fact?The answer is the use of gamification techniques.The objective of the gamification strategy is to obtain the commitment of the users.Thus, gamification mechanisms reward the correct use of the system.The target audience is the users of the SocialParking platform.This service could be provided through an application for mobile devices or a web portal.Gamification could be used for:

•
The correct use of the parking model: coherent check-in and check-out operations without large temporal gaps or non-formal events like entering or leaving parking spots without informing the application.

•
The regular and consistent use of the system: having several vehicles registered or using the system more than once a day are desired goals.
The gamification strategy of SocialParking should use the most common gamification mechanisms: points, aversion to loss, and operant conditioning.The execution of any of the stimulating actions may be rewarded instantly with an increase in the user's point counter (positive reinforcement), which is thought to add tangible rewards to the gamification system such as reduced rates.
The second main limitation of the study is the answer to an obvious question: how would the system perform in a real SocialParking scenario rather than an urban laboratory?This is a question that can only be answered when social parking is effectively implemented.We are waiting for this scenario as a future line of our research.

Figure 3 .
Figure 3. Trip to search for a parking spot (city of Sevilla).

Figure 3 .
Figure 3. Trip to search for a parking spot (city of Sevilla).

Figure 4 .
Figure 4. Parking patterns for working days in parking lot #1 in the city of Zaragoza.

Figure 4 . 1 Figure 5 .
Figure 4. Parking patterns for working days in parking lot #1 in the city of Zaragoza.ty 2019, 11, x FOR PEER REVIEW 9 of 1

Figure 5 .
Figure 5. Merged data for working days in parking lot #1 in the city of Zaragoza.

Figure 6 .
Figure 6.Parking patterns for weekends and holidays in parking lot #1 in the city of Zaragoza.

Figure 6 .
Figure 6.Parking patterns for weekends and holidays in parking lot #1 in the city of Zaragoza.Sustainability 2019, 11, x FOR PEER REVIEW 10 of 19

Figure 7 .
Figure 7. Merged data for weekends and holidays in parking lot #1 in the city of Zaragoza.

Figure 7 .
Figure 7. Merged data for weekends and holidays in parking lot #1 in the city of Zaragoza.

Figure 8 .
Figure 8. Parking lot #1 real occupation vs. forecast in a working day.

Figure 9 .
Figure 9. Methodology for the design on the ontology.

Table 1 .
Forecast algorithm results.MPE is the mean percentage error.