\chapter{Roadie: Mobile Semantic Tourism Routes}\label{chap:roadie}
{

\begin{quote}
\textit{Roadie is a mobile application for the planning and the recommendation of tourism routes in cities. Recommendation is achieved profiling users in a semi-automatic way via social network analysis and profile curation, and by monitoring user activity analysing data coming from devices' physical sensors. Routes consist of several POIs (Point Of Interests) that can be automatically or manually enriched with geo-events and geo-services obtained dynamically from the web, categorised and suggested using semantic analysis.
\footnote{The work presented in this chapter has been published as \dquote{Roadie: Mobile Semantic Tourism Routes} in \textit{Proc.~of IEEE International Conference on Multimedia \& Expo (ICME) - Demo Session, 2015}~\cite{ferracani2015roadie}.}
}
\end{quote}

Roadie\footnote{Video available at http://vimeo.com/miccunifi/roadie or downloadable from http://bit.ly/1o3V1cY} is a mobile-based application with two main goals: 1) to provide accurate recommendations of city itineraries enriched with thematic suggestions based on user profiling, 2) to let the user manually create and edit his/her personalised tours through the city.  The main contribution of the application is to provide a multi-dimensional contextual approach\cite{gav2013} for recommendation. In fact Roadie combines user profiling on social networks, location-awareness, semantic analysis and activity recognition by sensing in order to improve the personalisation and the recommendation of city tours in mobile electronic guide systems.


\section{The system}
Roadie has been developed in Java as a native mobile application using the Android SDK. The backend is written in PHP. All the data are stored in a MySQL database. The system (Fig.~\ref{fig:schema}) is composed by four core modules which are respectively in charge of: 1) grabbing POIs, venues and events, 2) categorising data in realtime, 3) profiling users, 4) recommending routes.

\begin{figure}[!htb]

\centering
\includegraphics[width=0.48\textwidth]{figs/system.png}
\caption{Roadie System Architecture.}
\label{fig:schema}
\end{figure}

\subsection{Data Collection}
Roadie uses two types of geo-localised data: static data, which doesn't need to be updated frequently, such as POIs and venues, and dynamic data, mainly constituted by events, which change continuously in time. POIs are city attractions retrieved querying the MediaWiki API\footnote{http://bit.ly/RywgdI}. For each POI a textual abstract, a representative image, and place categories (e.g. church, museum, palace, etc.) are collected. GeoNames API\footnote{http://www.geonames.org/} is exploited in order to get POI's latitude and longitude. Venues are places in the city which can offer visitors commodities, leisure and entertainment services, such as shops, restaurants, nightclubs etc. These data are obtained using Foursquare API. Roadie uses events to enrich the visitor experience in the city. Events are characterised by having an exact start time and duration and are retrieved daily by the grabbing module from two sources: the OpenData (for this demo we used data published by the municipality of Florence, IT), and the Eventful API\footnote{http://opendata.comune.fi.it/, http://api.eventful.com/}. The first is an institutional source which provides especially art exhibitions and events, the latter instead is user-generated and concerns, for the most, musical events and shows.

\subsection{User profiling}
Roadie builds a model of the user profile of interests exploiting user information from the Facebook Graph API through Facebook Login. User interests are extracted by analysing the categories of Facebook pages for which the user expressed a `like'. Additional basic demographic data such as age, gender and residence are also collected. In order to assign profiles to users that are not able or reluctant to connect their Facebook profile, we adopt an inference method based only on the demographic infos. Given the user $u$, Roadie looks for similar registered users and gets a subset of users S${_u}$. From S${_u}$, the most frequent categories of interest are extracted and assigned to the interest profile of  $u$.

\subsubsection{Monitoring user activity}
Roadie exploits also physical sensors available in mobile devices in order to observe user behaviours and to refine his/her profile model. We identify two possible meaningful activities for the tourism domain: 1) speed of user's movements between geographic positions is monitored in order to estimate running/jogging activity, 2) altitude peaks are analysed by a probabilistic model to assess a user preference for climbing or panoramic views. An asynchronous thread processes data from sensors even when the mobile application is in background, allowing a continuous monitoring of the user movements. To minimise battery consumption, data are sampled and processed every 60 seconds. Furthermore, the thread is stopped in case of a low battery level (less than 25 \%). Activities, when detected, are associated with corresponding categories in the knowledge-base and in user profiles as summarised in table \ref{tab:activities}.

\begin{table}
\centering
\caption{User actives and related detected interest}

\begin{tabular}{| p{2cm} | p{3.6cm} | p{1.7cm} |} \hline
\textbf{Activity} & \textbf{Analyzed data} & \textbf{Extracted  interest}\\  \hline
Running & Speed from GPS data& Sport \\ \hline
Sightseeing & Peaks in Altitude & Lookout\\ \hline
\end{tabular}
\label{tab:activities}
\end{table}

\subsubsection{Categorisation of resources and Recommendation}

The categorisation module is responsible to classify all the resources coming from the grabbing module and to compute a semantic similarity between user preferences and resources to be suggested. Roadie adopts a taxonomy of 19 macro-categories that has been manually defined in order to exhaustively represent both user interests and venues/events. Since data are continuously updated from heterogeneous sources (e.g. events from Eventful, user interests from Facebook, venues and places from Foursquare), uncategorised or labeled with different categories, Roadie analyses textual information in order to map these data according to the system's taxonomy. A max similarity score is computed between each item $c$ of the taxonomy and a provided or inferred resource category $r$  using the function $\mathrm{sim}(c, r)  \in [0, 1]$. The correlation is estimated using a semantic text similarity technique\cite{han2012umbc}. The method is based on distributional similarity and Latent Semantic Analysis (LSA), further complemented and improved with semantic relations extracted from WordNet\footnote{https://wordnet.princeton.edu/}. 
Recommendation of routes is based on several factors: context inference, profile of interest computed analysing social network data, user activities detected from device sensors. Given the user location, the recommended routes are built through the MapQuest Route Service\footnote{http://mapq.st/1jAVgeL} trying to maximise the ratio between the number of attractions to visit and the available time. Venues, places and events with the highest semantic similarity to the user profile of interests are categorised and suggested, ordered by distance from the user.

 \vspace{-10pt}
\section{The application}
Roadie is a native mobile application developed in java using the Android SDK. The interface is composed by four main views: 1) recommended routes, 2) route creation, 3) profile and 4) saved routes. Roadie features Facebook Login as well as app registration. The profile view shows demographic data and all the automatically detected interests. These can be edited adding or removing items from the system taxonomy. The recommended routes view provides a scrollable list by which the user can select different thematic itineraries on the basis of his/her interests. For example, if the system detected sport and literature as the main user interests, the recommended route is enriched with sport or public readings events going on at the moment in the city. All the routes are presented on interactive maps provided by the OpenStreetMap\footnote{http://www.openstreetmap.org/} service exploiting MapQuest web mapping features. Recommended routes can be edited manually directly on the map or users can utilise the route creation view to plan their visit from scratch. To this end Roadie provides smart suggestions mechanisms which offers an unified perspective for tourist attractions and contextual services. First of all, it proposes POIs taking into account user position. Each time the user selects a POI the system suggests other possible POIs nearby. Otherwise he/she can search for one. Once the route has been defined, it can be enriched with venues and events relevant with user interests and POIs he/she has planned to visit. Imagine a use case scenario where a user is building a route that will take him from the Florence Cathedral through the Uffizi Gallery and then to Piazzale Michelangelo in Florence, IT. If the system detected that sport and food are among user interests, he/she will be suggested the nearest restaurant to the Uffizi Gallery for lunch or to take part in a running race scheduled for that day and starting from Piazzale Michelangelo. The sport interest may have been manually added by the user, inferred from Facebook data analysis or detected by Roadie monitoring data from the user smartphone sensors, assuming that the user is a regular jogger.