Keywords

1 Introduction and Motivation

The emotions raised by our own needs accompany our everyday life and, like it or not, have a strong influence on our choices and decisions. Emotional Intelligence (EI) is the capacity to recognize, manage, and use emotions to properly guide our own reasoning and actions. In other words, it is the ability to identify the right emotions and adopt them to adapt our actions and behavior, according to the context and environments [9]. It has been proved that EI is associated to high levels of job performance, mental health, and decision making. Therefore, during recent years, EI has been increasingly developed in both professional and social contexts.

In the context of Information Systems, how to cope with emotions during exploratory data analyses has not been investigated yet. In this preliminary work, we adopt the EI approach to explore the interplay between data, emotions, and actions, thus lying the foundations for an emotional approach to data querying. Indeed, seeing the results of a query on a dataset may trigger an emotion, which in turn can lead to a decision and/or an action.

Example 1

Consider a user, say Kathy, who has to decide whether to move or not from the city where she lives, say A, to a new one, say B. To make up her mind, Kathy compares the two cities from two points of view: the average salary and the crime rate. Checking some open databases available, Kathy discovers that —contrary to her belief— the average salary in B is higher than the one in A, which surprises her. On the other hand, the crime rate in B is quite high, which raises fear in her. Combining surprise and fear gives rise to alarm, an emotion that implies an active response. The action Kathy can take is to examine additional factors, e.g., the quality of life, before taking her final decision. Importantly, this action comes from a correct recognition of Kathy’s emotions. Had surprise not been recognized, Kathy’s behaviour would have been exclusively dominated by fear, in which case she would probably have been paralyzed and unable to make a decision.

The framework we propose to keep emotions into account when querying data relies on an Action-User-Domain-Emotion (AUDE, in Latin “dare”) model that includes four layers: (i) an emotion layer (EL) that defines and connects emotions based on a classification drawn from affective science; (ii) a domain layer (DL) that characterizes the data that may trigger emotions via a set of queries; (iii) a user layer (UL) that connects the two by expressing the emotions of each single user as related to the query results (s)he sees; and (iv) an action layer (AL) that maps the emotions triggered by query results into actions consistently with the guidelines of EI. The overall picture is sketched in Fig. 1. In what follows, for the sake of readability, we adopt Datalog rules as a comprehensive way to formalize all the layers (following the syntax of Soufflé: https://souffle-lang.github.io/index.html).

Fig. 1.
figure 1

The AUDE model

Example 2

Considering again the example above, the EL expresses alarm as the combination of surprise and fear [16]; the DL includes the queries on the average salary and the crime rate in each city; the UL associates user’s emotions to query results, e.g., low average salary makes Kathy angry, high crime rate makes her fearful; the AL associates emotions to possible actions, e.g., stand by in case of alarm, or pursue your goal in case of excitement. A formalization of what stated above can be as follows:

$$\begin{aligned} evaluateQualityOfLife()\leftarrow & {} alarm()\\ alarm()\leftarrow & {} surprise(), fear() \\ surprise()\leftarrow & {} avgSalary(x,'A' ), avgSalary(y,'B' ), y>x \\ fear()\leftarrow & {} crimeRate(x,'B' ), x>70 \\ avgSalary(x,city)\leftarrow & {} employee(\_,\_,city), x=avg ~s : employee(\_,s,city) \end{aligned}$$
Fig. 2.
figure 2

Emotional intelligence vs. business intelligence

An interesting application scenario we envision for our emotional framework is that of Business Intelligence (BI), which gives computational support to users in exploring and analyzing data. Main citizens of BI systems are Data Warehouses (DWs) and OLAP tools, the latter enabling analyses of huge volumes of data stored in the former according to the multidimensional model. In order to support decision-makers in developing OLAP sessions when exploring data, several approaches for recommending OLAP queries have been devised (e.g., [4, 15]). These approaches recommend new queries based on those formulated during the past or current sessions, usually relying on some query similarity metrics and in some cases considering the query interestingness [8]. However, none of these works take into account the complexity of the emotions that may arise during an analysis session.

In this scenario we propose to draw a parallel between the fulfillment of a goal, assessed by a key performance indicator (KPI), and the satisfaction of a need. As shown in Fig. 2, needs are often represented in the form of a pyramid [14]; on the other hand, KPIs can be distinguished into strategic, tactical, and operational [11], determining a pyramidal classification that closely resembles the one of needs. Satisfying a goal/need will likely trigger a positive emotion, while the failure of a goal/need may trigger a negative emotion. In turn, depending on the emotion, the user will take an action, which in the BI application will consist of asking a new OLAP query of checking a new KPI. Specifically, we suggest to apply our framework to BI as follows: (i) for the EL, we refer to Plutchik’s wheel of emotions [16]; (ii) the DL is expressed as a tree of KPIs following the approach proposed in [13]; (iii) the UL specifies how (i.e., through which emotion in the EL) each user will react to the evaluation of each KPI in the DL; (iv) the AL follows the guidelines of EI to map each combination of a KPI in the DL and an emotion in the EL into an action, i.e., a new OLAP query to be formulated or a different KPI to be evaluated.

The paper outline is as follows. Section 2 discusses related work. Section 3 introduces the EI model and showcases it on a BI scenario. Section 4 concludes the paper and outlines research avenues.

2 Related Work

There have been several efforts in the literature to classify emotions in affective science so as to distinguish or contrast one emotion from another. Two main approaches have been pursued to this end. In dimensional models, such as the vector model and the circumplex model, emotions are conceptualized by defining where they lie in two or three dimensions, e.g., valence and arousal [18]. Conversely, in discrete emotion theory, people are thought to have an innate set of basic emotions, which can be distinguished by an individual’s facial expression and biological processes, and are cross-culturally recognizable [2, 5]. For instance, Ekman identified anger, disgust, fear, happiness, sadness, and surprise based on the corresponding facial expressions [6]. In Plutchik’s wheel of emotions, eight emotions are distinguished, namely, joy, trust, fear, surprise, sadness, disgust, anger, and anticipation [16]. Emotions can have different degrees (e.g., serenity and ecstasy are, respectively, a mild and an intense form of joy), and have opposites (e.g., sadness is the opposite of joy). The author also theorized twenty-four primary, secondary, and tertiary dyads, i.e., feelings composed of two emotions.

As to KPIs, in [13] they are defined as metrics for evaluating goals in the context of BI and decision making. A KPI consists of an aggregate query, a target value to be achieved, and one or more thresholds that discriminate between good and bad performance. In turn, goals are frequently used in the design of BI systems to represent and engineer the users’ requirements.

Finally, there has been many works on guiding users analyzing large datasets. Discovery-Driven Exploration (DDE) of data cubes [21], pioneered by Sunita Sarawagi [19, 20, 22] proposed techniques for interactively browsing interesting cells in a data cube. DDE was essentially motivated by explaining unexpected data (e.g., notable discrepancies) in the result of a cube query, to be explained by generalization (rolling-up, to check whether the discrepancy follows a general trend) [22] or by detailing (drilling-down, to understand what causes the discrepancy) [19]. DDE can be seen as a particular case of Exploratory Data Analysis (EDA), the general notoriously tedious task of interactively analyzing datasets to gain insights [10], that has attracted a lot of attention recently [3, 7, 12, 23]. In any case, all those works assume that the exploration is limited to the use of dedicated primitives (e.g., classical OLAP or SQL operations), and even though user profiles incorporating preferences [1] or intentions [4] may be used, to the best of our knowledge, none of them account for the user’s emotions when querying.

3 The AUDE Model

In this section we describe the different layers of our model, with specific reference to the BI application scenario outlined in Sect. 1.

3.1 Modeling Emotions

The EL models human emotions. To this end, in this paper we use Plutchik’s model [16] (although any other model could be used instead). Plutchik formulated ten postulates among which there is a small number of basic, primary emotions (joy, trust, fear, surprise, sadness, disgust, anger, and anticipation); all other emotions are mixed or derivative states occurring as combinations, mixtures, or compounds of the primary emotions. Primary emotions are hypothetical constructs whose properties and characteristics can only be inferred from various kinds of evidence, and they can be conceptualized in terms of pairs of polar opposites. Primary emotions can be of three intensity degrees (mild, basic, and intense); for example, distraction is a mild form of surprise, and rage is an intense form of anger. Twenty-eight secondary emotions are derived by combining each primary emotion with the others. They can be modeled as Boolean queries, for instance:

$$\begin{aligned} love()\leftarrow & {} trust(), joy() \end{aligned}$$
(1)
$$\begin{aligned} curiosity()\leftarrow & {} trust(), surprise() \end{aligned}$$
(2)

3.2 Modeling Domains

The DL describes parts of the dataset susceptible to trigger emotions. In general, emotions are triggered by events of daily life, and correspond to the satisfaction (or not) of human needs. As already mentioned, the seminal work of Maslow [14] represents needs organized in a pyramid. On the bottom of the pyramid there are human basic survival needs, such as eating and sleeping, followed by safety needs, related for instance to health and employment. The two next layers include needs related to love and belonging (e.g., friendship and family) and to esteem (e.g., respect and freedom). On the top level are individual accomplishment needs related to achieving one’s full potential, which also includes creative activities. Noticeably, it is recognized that having a gradual bottom-top satisfaction of needs is the only successful way.

In our BI application scenario, The DL contains the definitions of KPIs. A KPI is a numerical metric used to monitor the achievement of a business goal; it consists of a query (typically, an aggregate one), a target value to be achieved, and one or more thresholds that discriminate between good and bad performance [13]. To represent KPIs we adapt the Business Intelligence Model of [13], which connects KPIs (triangles) to goals (ovals); goals can be AND- or OR- decomposed into subgoals. If a goal is a conjunction of subgoals, then they all must succeed for the goal to succeed; if it is defined as a disjunction of subgoals, then at least one of them must succeed. In this work we will assume for simplicity that each (sub)goal is connected to exactly one KPI.

Fig. 3.
figure 3

The Business Intelligence Model for an e-commerce company

Example 3

Consider the Business Intelligence Model for an e-commerce company shown in Fig. 3, focused on the Increase revenue strategic goal. This goal can be achieved either by broadening the customer base or by increasing the customers’ loyalty. At the tactical level, increasing the customers’ loyalty is declined into increasing the customers’ satisfaction; this, in turn, is obtained at the operational level by improving the design and reliability of products. Each goal is related to a KPI; for instance, the customer retention rate is used to check if the customers’ loyalty has increased. Here are some examples of how this Business Intelligence Model can be coded on a simplified database schema that represents sales and clicks for the e-commerce site:

$$\begin{aligned}&SALE(IPaddress, date, time, revenue, specialOfferYN)\\&CLICK(IPaddress,date,time) \end{aligned}$$

Three goals are expressed as Boolean queries and the associated KPIs are expressed as aggregation queries (the rules for computing dailyClicks, \(totalVisitors\), \(percSaleViaSpecOff\), and totalCustomers are omitted for brevity):

$$\begin{aligned} LaunchAdvCamp()\leftarrow & {} numbClicks(x), x>1000 \end{aligned}$$
(3)
$$\begin{aligned} numbClicks(x)\leftarrow & {} x = avg~c: dailyClicks(date,c),lastWeekDays(date) \end{aligned}$$
(4)
$$\begin{aligned} goodNumbClicks()\leftarrow & {} numbClicks(x), x>2000\end{aligned}$$
(5)
$$\begin{aligned} goodPPVSO()\leftarrow & {} percSaleViaSpecOff(x), x>0.3 \end{aligned}$$
(6)
$$\begin{aligned} GetNewCustomers()\leftarrow & {} custConvRate(x), x>0.3 \end{aligned}$$
(7)
$$\begin{aligned} custConvRate(s/c)\leftarrow & {} totalVisitors(c), totalCustomers(s) \end{aligned}$$
(8)

Some explanation of the most complex rules: rule (4) computes the number of clicks KPI as the average number of daily click during last week; rule (8) computes the customer conversion rate as the ratio between the number of customers and that of visitors during last week.

3.3 Modeling Users

The UL lets users express their emotions when considering data characterization made in the domain layer. It is also responsible for describing the emotions intensity. Importantly, this layer is user-dependent, which means that all thresholds are the user’s own ones.

Example 4

With reference to Example 3, a possible user’s emotional behavior could be the following:

$$\begin{aligned} joy()\leftarrow & {} goodNumbClicks()\end{aligned}$$
(9)
$$\begin{aligned} joy()\leftarrow & {} goodPPVSO()\end{aligned}$$
(10)
$$\begin{aligned} trust()\leftarrow & {} LaunchAdvCamp()\end{aligned}$$
(11)
$$\begin{aligned} trust()\leftarrow & {} GetNewCustomers() \end{aligned}$$
(12)

3.4 Modeling Actions

The AL models the actions to be taken when an emotion is triggered.

All emotions lead to one or another impulse to act (or not to act). According to Ronsenberg [17], the process involving emotions is: (i) recognize the emotion, (ii) identify the need beyond the emotion, (iii) trigger an adequate action. Taking into account the connections between emotions and actions discussed in [9], we propose some rules for emotion-based triggering of actions in the BI application scenario. Let k be the KPI which just triggered the emotion:

  • Joy. The user has presumably satisfied the goal G associated to k, and her mental state prepares her to face new goals. According to Maslow’s work, which postulates that basic needs should be fulfilled first, this should be done by climbing up the goal tree. Thus, the action triggered is to evaluate the KPI related to \(G'\), supergoal of G.

  • Anger. The user has presumably found that the goal G associated to k is not satisfied. This emotion needs an immediate action. Again based on Maslow’s work, the suggestion is to move towards more basic needs. Thus, the action triggered is to evaluate the KPI related to \(G'\), a subgoal of G.

  • Love. The user is in a calm state which encourages further exploration. Thus, the action triggered is to evaluate the KPI related to a sibling goal of k.

  • Curiosity. The user wants to know more, thus, the action triggered is a roll-up of the query associated to k.

  • Trust. The user is confident with the data she just saw, thus, the action triggered is a drill-down of the query associated to k.

  • Surprise. The user has seen unexpected data and wants to get more information about the events; thus, the action triggered is a slice-and-dice of the query associated to k.

  • Sadness. In this case, trying to satisfy other needs is not convenient. The action triggered is to move to a different goal tree or, if this is not available, stop the analytical session.

Example 5

Even the rules of the AL can be expressed in Datalog, for instance:

$$\begin{aligned} checkSiblingKPI()\leftarrow & {} love()\end{aligned}$$
(13)
$$\begin{aligned} checkFatherKPI()\leftarrow & {} joy()\end{aligned}$$
(14)
$$\begin{aligned} drillDown()\leftarrow & {} trust() \end{aligned}$$
(15)
Fig. 4.
figure 4

A simple flow of emotions

3.5 The AUDE Model at Work

In this section we simulate how the different pieces fit together in a simple scenario. The reader can use Fig. 4 as a reference of KPIs, goals, emotions, and actions. Suppose Karen starts by checking the numbClicks(x) KPI, which evaluates to 2500 via rule (4) of the DL. This triggers rules (3) and (5), which makes both LaunchAdvCamp() and goodNumbClicks() true. In turn, this triggers rule (9) and (11) of the UL, so the expected emotions of Karen are joy and trust. These two emotions, together, give rise to love (via rule (1) of the EL). The suggested action for love is to evaluate a sibling KPI (rule (13) of the AL), hence, the \(percSaleViaSpecOff(x)\) KPI is evaluated. Now, let 0.35 be the value of the \(percSaleViaSpecOff(x)\) KPI; this triggers rules (6) of the DL and (10) of the UL, which raises joy in Karen. The suggested action for joy is to evaluate the father KPI (rule (14) of the AL), hence, the custConvRate(x) KPI is evaluated via rule (8) of the DL. Finally, let 0.4 be the customer conversion rate. This triggers rule (7) of the DL, which generates trust in Karen (rule (12) of the UL). The suggested action is a drill-down (rule (15) of the AL), so Karen will for instance drill-down to customers’ age ranges.

4 Conclusions and Open Issues

Studying the interplay between database querying and emotions is challenging, even because it involves complex (and controversial) disciplines such as psychology and sociology. In this paper we made a first attempt in this direction by defining a layered model whose first-class citizens are users, queries, emotions, and actions. The underlying idea is to connect queries to user’s emotions first, then user’s emotions to actions. As an application scenario for our approach we proposed BI, mainly because the specific features of KPI (namely, their connection to goals, their tree-like structure, and their threshold-based definition) allowed us to establish an intuitive connection with emotions and actions. Remarkably, by using Datalog for expressing the model, we delivered a uniform formalization for all layers.

Clearly, the path to efficient and effective emotion-aware querying is still very long. There is a lot of questions that need an answer, among these:

  • In the BI application scenario, the action triggered by an emotion may be an OLAP query instead of a KPI, in which case target values are not defined. Then how to connect values to emotions?

  • The BI scenario provides a clear set of possible actions (either evaluate a KPI or apply an OLAP operator to formulate a query). In a more general setting, like the one described in Example 1, would actions still correspond to queries? If so, how to connect each emotion to a query?

  • Different classifications of emotions have been proposed, some relying on a few primary emotions, some also including a large set of emotion nuances and combinations. While here we chose a very detailed classification, this may be too detailed to be used in practice —and not all emotions will be suited to any domain. How to pick a representative set of emotions to be used given a specific domain?

  • Conflicts are part of the human nature, so contrasting emotions may rise in a user. The classification of emotions we adopted here deals with this by defining secondary emotions such as confusion, which is a mix of surprise and anticipation; however, not all classifications do the same. Adopting a classification that does not explicitly cope with contrasting emotions would require checking the emotional model for conflicts.

  • While Datalog offers a uniform and elegant formalization, it may not be an efficient solution for implementation. Which architecture should be adopted to implement the approach?