1 Introduction

Diets and physical activity play a crucial role for a long and healthy life. Best practices are available in guidelines and expert recommendations regarding healthy lifestyle that people should adopt for maintaining their physical and mental well being. This way, they will be able to prevent cognitive decline, obesity, disability, and death from major chronic diseases: diabetes, cardiovascular disease, and several forms of cancer, just to mention a few. However, engaging people in developing and maintaining healthier patterns of living is a challenging task.

ICT-based persuasion systems can be effective tools to persuade and motivate people to change their behavior. Such systems are able to collect and reason on user’s data gathered from personal devices, off-the-shelf wearable sensors, and external sources (e.g., electronic health-care records). By exploiting these data, persuasive systems can generate effective personalized recommendations by adapting the message generator in response to the modification of the environment and the user status. To carry out this task, a persuasion tool must rely on a considerable amount of knowledge from different domains (e.g. user attitudes, preferences and environmental conditions, etc.) for suggesting the behavior to adopt and for justifying such suggestions. Examples are food content and nutrients, physical activities accompanied by information concerning their categorization and effort, user attitudes and preferences, linguistic knowledge, and smart environment information (places, weather, etc.). As we may notice, these systems can greatly benefit from the adoption of an ontological approach to model knowledge, ensuring disambiguation of terms and formal definition of concepts and relations of the domains of discourse, which the system can exploit for reasoning purposes.

In this paper, we present the first version of the PerKApp ontology aiming to describe food properties and to support the construction of intelligent interfaces allowing domain experts to model monitoring rules for recommending healthier life styles. The ontology is part of the several knowledge bases modeled in the PerKApp project [1], which aims to provide a full-fledged platform supporting the monitoring of citizens and patients lifestyles and the provision of real-time feedback through persuasive context-based messages when the need for an intervention is detected.

Section 2 provides a brief overview of the main ontologies concerning the food domain. In Sect. 3, we present the PerKApp project. Then, in Sect. 4 the PerKApp ontology is described, while, in Sect. 5, we show how the ontology is used within the PerKApp architecture. Finally, Sect. 6 concludes the paper.

2 Related Work

Literature about food ontologies is not new and some works already provided useful artifacts. In this section, we briefly resume the most relevant work in this direction.

In [2] the authors describe food intake patterns identified by applying new food categories. New food groups were formed using a systematic approach involving the consideration of (i) nutrient composition and energy density, (ii) current scientific evidence of health benefits, and (iii) culinary use of each food. In this way the researchers identified 17 food groups.

Regarding the use of ontologies, in [3] it is presented a process for a rapid prototyping of a food ontology oriented to the nutritional and health care domain that is used to share existing knowledge. The aim of this ontology is to present a complete description of food with nutritional information, type, nutrients, and the recommended daily or weekly quantity to be consumed in a healthy diet for people with diabetes. The main steps of this process consist in: (i) identifying the domain and its rules; (ii) finding nouns used in common language for generic food; (iii) defining relations among food and properties and, also, among different foods (i.e. it does not exist any difference between two apples). The described ontology contains 177 classes, 53 properties of foods, and 632 relations.

The contribution presented in [4] discusses the design and development of a food-oriented ontology-driven system (FOODS), used for food or menu planning in a restaurant, clinic/hospital, or at home. FOODS comprises (i) a food ontology, (ii) an expert system using such an ontology and some knowledge about cooking methods and prices, and (iii) a user interface suitable for users with different levels of expertise.

Other works use ontologies for delivering personalized and customized information. The work presented in [5] focuses on the integration of different domain ontologies, like food, health, and nutrition, in order to help personalized information systems to retrieve food and health recommendations based on the user’s health conditions and food preferences.

Finally, in [6] there are described the design steps, the working mechanism, and the case of use of the Ontology-Driven Mobile Safe Food Consumption System (FoodWiki) using semantic matching. The system is designed to evaluate commercial packaged food products and suggesting the selected product’s appropriateness to food consumers according to their health conditions or intolerance. The Food Ontology Knowledge Base (FOKB) is also presented: it contains four main classes, 58 sub-classes, 15 object type properties and 17 sub-object type properties, 12 data type properties, 1530 individuals with annotation type properties, and 210 semantic rules.

The principal novelty of the presented ontology consists in providing a knowledge schema that is able not only to describe detailed information about foods, but also to support reasoning activities on users’ behaviors and the creation of smart interfaces for creating rules for monitoring users.

3 The PerKApp Project

The PerKApp projectFootnote 1 aims to merge the advantages of using diverse knowledge representation and reasoning techniques with rich persuasive natural language generation approaches. It is composed of two parts:

  1. 1

    An application for personal devices, able to collect data from the user (e.g., food intake), wearable sensors (e.g., fitness trackers), and contextual data (e.g., the weather, the proximity of fitness facilities) and to notify persuasive and motivational messages by exploiting different representation mechanisms: textual, speech, video, and graphical alerts.

  2. 2

    A core persuasive component that combines data and knowledge to generate effective persuasive messages customized to the user needs, attitudes and preferences, conveyed through multiple communication channels and modalities, dynamically selected exploiting contextual information (e.g., user’s location and activity).

Three main concepts drive the message generation process:

  • external event: an event that occurs in the real world acting as trigger for the system (e.g., a timer, a user eating too much food or performing too low in physical activity).

  • communicative goal: the top most intention of the system that drives its planning (e.g., diverting from an actual unhealthy behavior).

  • persuasive goal: goals within the persuasion engine activated according to the top communicative goal, and representing partial “plans” to fulfill it.

The persuasion engine combines different knowledge bases for inferring the right content, type, and timing of the messages sent to users. In particular, the full-set of the exploited knowledge contains:

  • “static” domain knowledge: i.e., the knowledge describing the objects of the domain of interest and their relationships, such as the food ontology presented here.

  • The “dynamic” user model, i.e., the knowledge about users that may change over time as a consequence of external events (e.g., the health status) or system’s actions (e.g., after the adoption of suggested behaviors).

  • “environment” information concerning the context and the environment around users: city maps, information about sport facilities, areas for physical activities, etc.

  • The “linguistic” model: i.e., the knowledge about the linguistic terms (noun, verbs, adjectives, etc.) and phrases more adapt for the domain of intervention, augmented with information about evocative qualities of such terms (e.g., sentiment bearing words, adjectives that represent level of intensity in physical activity).

4 The PerKApp Ontology

The development of the PerKApp ontology followed the need of providing a knowledge artifact able not only to provide a representation of domains concerning healthier lifestyle, but, also, to support further activities like, for example, remote medical monitoring. As we discussed in Sect. 2, ontologies available in domains connected with wellness and health lifestyle have been designed with different aims. For example, ontologies concerning sport activities are created with a focus on classifying data without connecting each activity with potential problems or benefits associated with the health status of a user. Similarly happened for ontologies concerning foods.

In the PerKApp project, we decided to model an ontology with a focus on the connection between diet and physical behavior with people health. The development of our ontology has been driven by the following main questions:

  • Which information are needed for having a detailed description of each food?

  • Which concepts are necessary for supporting the design of rules allowing user monitoring?

  • Which data have to be provided by users for allowing reasoning tasks?

At this stage, the ontology has not been connected with fundamental ontologies like DOLCE [7]. The reason is that this first version of the ontology will be extended for covering further domains that will be of interest for the PerKApp project. Thus, the alignment task has been postpone as future work.

Figure 1 shows a general overview of the ontology with the main concepts.

Below, we distinguished concepts in three main categories and we provided the semantic meaning of the most important entities.

Fig. 1.
figure 1

Overview of the PerKApp ontology.

4.1 Diet-Oriented Concepts

These concepts are used for classifying foods and for describing, in detail, their composition. According to project aims, modeling only the category of each food and its calories is not enough. Thus, what we need is to model all possible information connected with food compositions. The main concepts belonging to this category are the following.

“Food”. Trivially, this is the root concept of all foods contained into the ontology. As specifications of the concept “Food”, we defined three main sub-concepts: “Basic Food”, “Composed Food”, and “Dressing”. With “Basic Food”, we intended to model foods that are described within the resources we adopted for creating the ontology. For all entities of type “Basic Food”, we are able to provide a full description of their properties, as described later. While, the “Composed Food” concept represents entities, like dishes, that are composed by two or more concepts of type “Basic Food”. The “Dressing” concept is exploited for modeling different dressings and toppings commonly available. This type of concepts has been thought for easing user monitoring activities. This distinction allows to map common-sense dishes that can be provided by users, as “Pasta alla Carbonara”, to the set of basic foods accompanied with nutrition information.

Concerning the “Basic Food” concept, many specifications have been defined. The reader may consult them into the ontology. Here, we only want to mention that many of the modeled categories have been created for facilitating the user monitoring task. For example, by grouping foods under the concept “Fats and Oils”, it is easy for a dietitian to define a rule for monitoring the quantity of fatty foods consumed by a user.

“Nutrient”. The “Nutrient” concept allows to describe fine-grained properties of each food. This concept and its sub concepts are very useful for designing monitoring rules. Indeed, based on the user profile, an expert may decide to define a fine-grained monitoring on specific nutrients. For instance, users with cardiological issues should limit the consumption of fat foods, or people having calcium shortage should consume specific foods, etc.

Within our ontology, nutrients have been then classified among a set of sub-concepts: “Carbs”, “Protein”, “Lipids”, “Vitamin”, and “Mineral”. This way, it is possible to monitor also groups of nutrients instead of single ones.

“Timespan” and “Meal”. The last diet-oriented concepts concern timing information that can be exploited for different monitoring purposes. For example, when a domain expert creates a rule, he/she might decide to mark such a rule as valid only for a specific moment during the day, or as a check for a given period of time. By considering the diet purpose of the ontology, specific moments during a single day are described by the concept “Meal” that identifies the most common moments when people eat.

Instead, concerning specific time period, we defined the concept “Timespan”. Such a concept is instantiated with individuals defined through the interface provided to domain experts. The “Timespan” concept is in relation with the datatype property “duration” allowing to specify the number of seconds for which a specific timespan subsists.

4.2 Rule-Support Concepts

This set of concepts has been designed for supporting reasoning activities and for tracking potential rule violations caused by users.

The concept “Rule” represents the rules defined by domain experts through the platform interface. In the current version of the ontology, instances of this concept are represented by a string composed by a set of atomic logical clauses.

The second concept, “Violation”, is exploited for instantiating user’s violations with respect to each rule. Such a class is defined with restrictions as following:

figure a

Beside their use in reasoning activities, violation instances may be used by external services for data aggregation purposes.

4.3 User Information

Users are represented in the ontology for linking purposes only. Indeed, users’ personal data are managed by external organizations, e.g., hospital institution in the case of users under medical control. Within the ontology, we modeled only the “User” concept that is used as a bridge between ontology data and actual user’s information stored in the external resources. Such a concept has only a datatype property containing the unique identifier of the user within the external resources. Within the ontology, user instances are adopted for associating meals and, eventually, violations to the respective instances.

5 The PerKApp Ontology in Action

The PerKApp project does not aim to just provide yet another ontology and application wellness-related like many others already present on the market. The PerKApp project was born with the main aim of supporting different monitoring activities from sponsoring healthier lifestyles to avoiding chronic diseases and preventing onset of pathologies. Below, we will describe the role of the PerKApp ontology for supporting different tasks concerning the development of the full-fledged PerKApp platform.

Definition of Rules Schemata. As introduced above, one of the objectives on the PerKApp project is to monitor eating habits of users in order to prevent different type of pathologies and chronic diseases. Such a monitoring activity is performed by implementing within the platform a machinery for defining dietary rules. Rules definition is performed by domain experts supported by easy interfaces allowing the exploitation of ontological concepts for defining both simple and complex rules.

Designed rules combined with information provided by users can be used for performing reasoning on the populated knowledge base. Results of the reasoning activity can then be exploited for carrying out further actions with the aim of redirecting users’ behaviors to better lifestyles.

Ontology Enrichment for Persuasion. In Natural Language Generation (NLG) usually two levels can be identified: strategic and tactical [8]. It should be noted that most systems and approaches in NLG are based on descriptive tasks, focusing on texts which realize a single, often informative, communicative goal, as opposed to persuasive NLG where the communicative goal is usually surmounted by reasoning about the persuadee’s behavior modification. Persuasive features can have an impact on both strategic and tactical levels since the effectiveness of a message can be enhanced by appropriate content selection, text planning and linguistic choices. Within PerKApp the ontology design has been driven by the needs of “persuasive” NLP reasoning.

For example at the strategic level, diverting a user from eating unhealthy foods often requires suggesting viable alternatives. Alternatives can be either found reasoning on nutrients or by encoding more abstract concepts as taste. So, for example, given a food \(F_1\), we can found a substitute food \(F_2\) that has similar nutrients, minus the unhealthy ones. Another direction might be the adoption of a “\(similar\_to\)” relation given by taste similarity. This way, it would be able to find a food \(F_2\) that is connected to \(F_1\) on the basis of criteria different from a mere data similarity.

APIs Service. Finally, the PerKApp ontology is exposed as a web service available on the PerKApp project websiteFootnote 2. Currently, it supports three methods described below. Here, we reported only the description of each method, while, details concerning output data structures are reported on the project website.

“/GetFoodList”: This method returns the list of foods contained within the ontology with their labels.

“/SingleFoodData”: This method returns all information associated with a specific food. The method supports two parameters:

  • food (mandatory): the “id” of the food the user wants to retrieve;

  • quantity (optional): the quantity, expressed in grams, that has to be used by the service for computing the amount of nutrients contained in the requested food. Default value is 100.

“/CheckMeal”: The last method currently implemented allows to compute the amount of calories and nutrients consumed in a given meal. This method expects two mandatory parameters:

  • mealFoods: a string listing food ids separated by “;”.

  • mealFoodsQuantity: a string of numbers indicating, for each of the food listed within the “mealFoods” parameter, the amount of grams consumed. Also for this method, the separator between numbers is “;”. Number placed at position n in this parameter corresponds to the quantity of the n-th food listed within the “mealFoods” parameter.

6 Conclusions and Future Work

In this paper, we presented the first version of the PerKApp ontology and its role in the PerKApp platform. Concepts modeled into the ontology will not have only descriptive purposes, but they will also act as support for further activities concerning the monitoring and the persuasion of patients and citizens for pursuing healthier lifestyles.

Future work on the ontology will concern the integration of further domains (e.g. the physical activity one) and the linking with existing environmental ontologies (e.g. locations, weather, etc.) that, in smart contexts, would support the development of more intelligent platforms.