Professional Documents
Culture Documents
IST-2004-004182
Public
June 2007 Confidential
Deliverable Number :
Title of Deliverable : UMPS
Nature of Deliverable : Public
Internal Document Number :
Contractual Delivery Date :
Actual Delivery Date :
Contributing WPs :
Version : 1.0
Author(s) : Otilia Kocsis, Elena Vidjiounaite, Maja Stikic, Todor Dimitrov,
Edwin Naroska, Ron Mevissen, Stephan Tobies, Rich
Hanbidge
Abstract
This tutorial teaches how to use the User modeling and profiling service (UMPS). UMPS provides the
methodology to enhance the effectiveness and usability of services and interfaces in order to (a) tailor
information presentation to user and context, (b) reason about user’s future behavior, (c) help the user
to find relevant information, (d) adapt interface features to the user and the context in which it is used,
(e) indicate interface features and information presentation features for their adaptation to a multi-user
environment.
Keyword list
UMPS, user profiling, user preferences, user modeling, stereotypes
Table of Contents
Table of Contents................................................................................................... 2
1 Introduction ..................................................................................................... 3
1.1 Prerequisites..............................................................................................................................3
1.2 How to use this document ........................................................................................................3
3 UMPS................................................................................................................ 5
3.1 UMPS architecture...................................................................................................................6
3.2 Deployment ...............................................................................................................................6
1 Introduction
This document is a tutorial about how to use the User modeling and profiling service (UMPS).
UMPS provides the methodology to enhance the effectiveness and usability of services and
interfaces in order to (a) tailor information presentation to user and context, (b) reason about
user’s future behavior, (c) help the user to find relevant information, (d) adapt interface
features to the user and the context in which it is used, (e) indicate interface features and
information presentation features for their adaptation to a multi-user environment.
The tutorial will teach how to use the tools that come along with UMPS and how to access
user information via the UMPS API.
1.1 Prerequisites
Amigo training blocks typically requires some Amigo related as well as non Amigo related
skills or knowledge. These are given in the following:
Non Amigo related prerequisites:
o The reader should be familiar with either Java or C# to easily follow the
explanations.
o The reader should be familiar with an integrated development environment
(IDE) for the programming language that shall be used. It is suggested to use
either Eclipse 3.2 (or higher) for Java or Visual Studio 2005 for C#.
Amigo related prerequisites: The user should be familiar with the deployment
frameworks. To this end, the Web Services tutorial may be used (see
https://gforge.inria.fr/frs/?group_id=160).
For some general information on the Amigo project please refer to the Amigo project web site
at http://www.hitech-projects.com/euprojects/amigo/index.htm.
3 UMPS
User modeling and profiling service (UMPS) provides the methodology to enhance the
effectiveness and usability of services and interfaces in order to (a) tailor information
presentation to user and context, (b) reason about user’s future behavior, (c) help the user to
find relevant information, (d) adapt interface features to the user and the context in which it is
used, (e) indicate interface features and information presentation features for their adaptation
to a multi-user environment. These goals are achieved by constructing, maintaining and
exploiting user models and profiles, which are explicit representations of individual user’s
preferences. User profile updates will be performed using static and dynamic modeling
methodologies.
The User Modeling and Profiling Service (UMPS) models and maintains user profiles by
means of personalization of content and user interfaces, by combining this information in user
profiles and by keeping histories. It handles multiple user profiles and more complex or
aggregated information and publishes new information. This service enables the applications
to become personalized.
The current trend in user modeling and profiling research has evolved from representation of
groups of users using a certain system in certain conditions, to personalization of these
systems towards individual users preferences and requirements. Personalization applies to
different system components and application domains, but in particular to user interfaces (e.g.,
graphical, gesture, voice-based) and content (e.g., multimedia). Personalization depends on
the initial knowledge of the system about its potential users and the mechanism used to learn
user’s behavior and preferences. But, it also depends heavily on the context in which the
system is used. Therefore the system should be adaptable to the context. In addition, system
behavior and adaptation to multi-user environments must be considered.
Personalization of user interfaces comprises several advantages. It can be used to adapt the
appearance and structure to the user and the user’s way of behaving to provide interfaces that
are more effective and acceptable for all users. Today, adaptation of the appearance is
commonly used in all kinds of graphical user interfaces. The user can choose, for example,
background images, color of menu bars and dialog windows, and sort menu entries into
customized submenus. Normally, this sorting has to be done by the user. But it is also
imaginable that this sorting is done automatically and the user has just to describe the idea of
different submenus (e.g. into this submenu put every multimedia device). This approach would
support flexible systems with dynamical services like the Amigo system. Such flexibility in the
user interface could also allow adaptation of the input recognition part of user-system
interaction acts to help to prevent misinterpretations. For example, a speech interface could be
adapted to the user’s voice and expressions to reduce the error ratio of the subsystems.
Furthermore the information about user behavior can be used to predict future inputs and offer
shortcuts to reach the interaction goal in a more effective way (e.g. less interaction steps).
Personalization of multimedia content implies presentation of different multimedia items (e.g.,
videos, music or news) to different users based on their preferences. For example, one person
likes action movies, and another person does not like violence scenes at all; one person is
interested in news about politics, and another one about football, and so on. However, these
personal preferences depend also on the current situation (context) of the person. There could
be multimedia content which parents do not want to watch in the presence of their children, but
which they would prefer when they are alone; even the person who almost never watches
news about political events most probably will want to see the news about such important
events as the result of a presidential election or a major terrorist attack; generally, the
presentation of the news should be perhaps very short in the morning of a work day and be
more detailed later in the evening, while on weekends the news can already be presented in
more details in the morning. Thus, user models for personalization of multimedia content
3.2 Deployment
An operational user modeling and profiling service should have installed at least the
Reasoning Module and the Static Modeler, the basic components for management and
querying of user profiles. User profiles and the library of stereotypes are stored in an Access
database for the first software version. Reasoning Module and Static Modeler are accessing
the database through a common .NET module (DBInterface). This minimum installation
enables only direct manipulation of user profiles. In order to take advantage of enhanced user
modeling and profiling methodology, the rest of the components should also be installed. In
addition, application and service providers are provided with a Stereotypes Manager module in
order to modify the library of stereotypes.
each key describes an aspect that is related to the stereotype. Further, a “trigger”
defines a term that controls the affiliation of specific individual to a stereotype. Note
that a stereotype may consist or include other stereotypes.
Keys describe a specific aspect of an individual. Keys are associated with a value and
a rating, where the value is an integer between -5 and 5 describing the strength and
direction of the connection between the aspect and the corresponding stereotype.
Here, -5 denotes the strongest negative connection, while +5 denotes the strongest
positive connection. Further, the rating value denotes the confidence with respect to
the value. The rating is between 0 (least confidence) and 1000 (max confidence). In
the manager, keys are displayed with a capital “K”. For example, a vegetarian person
does not eat beef. Hence, the value for beaf would be -5 with confidence (rating) 1000.
“Classes” can be used logically group a set of keys or a set of included classes. As a
result, a class may contain other classes or keys. For example, the class “Preferences”
groups together various kinds of preferences (FoodPreferences,
MultimediaPreferences, etc.).
“Triggers” associate a specific term with a stereotype. For example, the term
“Adult_Person” is associated with the stereotype “Adult”.
4. Right-click the “GAMER” stereotype and choose “Add -> Trigger”. Enter trigger name
“Gamer” and press “Apply”.
5. Right-click the “GAMER” stereotype and choose “Add -> Class”. In the right “Name”
combo box choose “Preferences” and press “Apply”.
6. Right-click the “Preferences” class under the “GAMER” stereotype and choose “Add ->
Class”. Choose the “MultiMediaPrefs” name and press “Apply”.
7. Right-click the “MultiMediaPrefs” class under the “GAMER/Preferences” class and
choose “Add-> Class”. Choose the “GamesPrefs” name and press “Apply”.
As a next step we are going to add a specific variation of a gamer, the “on-line gamer”. To
this end proceed with the following steps:
10. Go to “GAMER” stereotype. Right click with the mouse and choose “Add -
>Stereotype”. In the right side of the GUI, in the “Name” text box enter
“ONLINE_GAMER”. Press the “Apply” button on the bottom-right side of the GUI.
11. Right-click the “ONLINE_GAMER” stereotype and choose “Add -> Trigger”. Enter
trigger name “Online_Gamer” and press “Apply”.
12. Right-click the “ONLINE_GAMER” stereotype and choose “Add -> Class”. In the right
“Name” combo box choose “Preferences” and press “Apply”.
13. Right-click the “Preferences” class under the “ONLINE_GAMER” stereotype and
choose “Add -> Class”. Choose the “MultiMediaPrefs” name and press “Apply”.
14. Right-click the “MultiMediaPrefs” class under the “ONLINE_GAMER/Preferences” class
and choose “Add-> Class”. Choose the “GamesPrefs” name and press “Apply”.
5. Enter to the Client console the userID for the new user profile (here: “Andrew@home”)
and press “Enter”
Figure 4.8. Use of the UMPS test Client to verify the addition of a new profile by selecting “8”.
This will plot a list of existing profiles on the screen:
3. Finally, check whether the value has been saved by retrieving the property as
described in the previous section. This should give the following output:
After the user entered the appropriate ID, his preferences are loaded, and the application
switches to the next page (see below). The leftmost box shows user profile tree, the rightmost
box shows the tree of contexts which the system is able to recognize.
One can click on a “+” sign in order to expand the corresponding part of the tree. The user
preference values are attached only to the leaf nodes of the tree (“leaf node” means a node
which can not be expanded anymore). The default value for user preferences is 0. If the user
preference is unknown, it’s value is shown as 0. For personal details the default value is an
empty string.
The user can change a value of any leaf node. To this end, one selects a node and double-
click it with the mouse. As a result, a box with the prompt “Enter value here” appears and
shows the current preference value. For numeric preferences values the application will also
show upper and lower limits of the preference value.
After a new value has been entered the change must be confirmed by pressing the “Accept
Change” button. As a result, the new value is written to the user profile, and will of course also
appear in the preference tree. However, if the entered numeric value is above the upper or
below the lower limit, the change is not accepted. Note that after the change of the preference
value ha been confirmed, the text box “enter new value” and the button “Accept Change”
disappear, so if the user wants to change another value, he needs to double click on it again.
The user can attach contexts to the value by selecting a leaf node in a context tree and
pressing the “Attach Selected Context” button. The contexts attached are shown in the profile
tree and in the window under the caption “Your preference value is valid in context(s):”(see
Figure 4.12). If there is no context attached, the value is assumed to be always valid (which is
also the default configuration).
The buttons “Delete Setting” and “Add Setting with the same key” allow the user to delete any
leaf node in the user profile tree, or duplicate any leaf node.
When the user presses “Add Setting with the same key” button, the leaf node with the same
key and with the default value is added to the tree. This is useful if different preference values
are needed for different contexts (see below).
The button “Add Setting with the same key” is needed also for entering personal details, e.g.,
the user can enter as many nicknames, names of children or friends as required.
When the user presses “Delete Setting” button, the selected leaf node is removed from the
tree.
Removing some contexts attached to a preference value can be done by selecting the context
in the box labeled “Your preference value is valid in contexts” and by pressing “Remove
Context” button as shown below:
using System.Runtime.InteropServices;
using EMIC.WebServer;
using EMIC.WSDiscovery.Server;
using EMIC.WSDiscovery.Client;
using EMIC.WSAddressing;
using System.Xml;
...
Then, a new namespace is defined that is going to hold our new sample application. Here, the
namespace is named UMPS_Example. Within the new namespace, a class Program is
defined. The class contains three main methods:
A method called findServices which is called in order to find and binde all services that
are needed to access the UMPS database. In detail two services are needed, the user
profile management services and the user profile querying service.
A method getXmlElement which is used to parse the results that are obtained form
querying the preferences database. Note the UMPS services will return an XML
formatted string that must be further analyzed in order to extract all interesting
information from it. Here, we are just interested in extracting the values that are
associated with a specific tag.
The actual main routine which calls findServices and generates some in/output and
initiates the operations with the preferences database.
namespace UMPS_Example
{
public static UMPS_Example.IUserProfileManagement.Service
proxyStaticMod;
In order to look for the two needed services, appropriate probe clients are created and the
corresponding service scopes and services types are defined. Note that scope and type
names are case sensitive.
public bool findServices()
{
ProbeClient pc1 = new ProbeClient();
ProbeClient pc2 = new ProbeClient();
pc1.AddServiceScope(
new EMIC.WSDiscovery.ServiceScope("urn:Amigo"));
pc1.AddServiceType(
new EMIC.WSDiscovery.ServiceType("IUserProfileManagement"));
pc2.AddServiceScope(
new EMIC.WSDiscovery.ServiceScope("urn:Amigo"));
pc2.AddServiceType(
new EMIC.WSDiscovery.ServiceType("IUserProfileQuerrying"));
Thereafter, the lookup process is started. As both services are needed, we loop until both
have been found. Note that each loop iteration will last for 5 seconds. Hence, expect some
delay during program startup.
while (true)
Amigo IST-2004-004182 22/29
June 2007 Confidential
{
Console.WriteLine("Discovering services...");
if (pc1.ProbeMatches.Count == 0) pc1.SendProbe();
if (pc2.ProbeMatches.Count == 0) pc2.SendProbe();
System.Threading.Thread.Sleep(5000);
proxyResMod =
new UMPS_Example.IUserProfileQuerrying.Service();
proxyResMod.Url =
pc2.ProbeMatches[0].FirstXaddr.ToString();
break;
}
}
Console.WriteLine("All required services found!");
return true;
}
If an appropriate set of services have been found, then the corresponding proxies are stored to
the appropriate member variables.
Within the main routine we first call findServices:
static void Main()
{
Program pr = new Program();
if (!pr.findServices())
{
Console.WriteLine("Press <Return> to exit...");
Console.ReadLine();
return;
}
...
Then, the program shall ask for the ID of the user that is going to be processed:
Console.Write("User ID=");
string userID = Console.ReadLine();
Next, we query the current address of the user from the preferences database calling the
getSetting method on the querying service. The method takes two arguments:
The ID of the user that is going to be queried.
A string defining the value to be retrieved. Note that this name is defined like a
directory path name with delimiters “:”. The path name starts with the root node
“PersonalDetails” and a corresponding string is added for each element which is hit
while walking the tree from root the intended leaf node.
Note that the result from getSetting is an XML formatted string that must be further analyzed.
To this end, we use the getXmlElement described above.
Console.WriteLine("Getting address for user " + userID + "...");
string address =
getXmlElement(Program.proxyResMod.getSetting(
userID,"PersonalDetails:Address"),"value");
Console.WriteLine("Address is '" + address + "'!");
Console.WriteLine();
...
To test writing to the database, a new address string is read from the console and stored to
the database. To this end, method setSetting is called on the profile management proxy. Note
that this is a different proxy compared to the one used for the address retrieval operation
above. The call to setSetting takes four arguments:
The ID of the user that is going to be addressed.
A string defining the value to be written. Note that this name is defined like a directory
path name with delimiters “:”. The path name starts with the root node
“PersonalDetails” and a corresponding string is added for each element which is hit
while walking the tree from root the intended leaf node.
The type of the value that is to be set. Here, the type is string.
Finally, the new value that shall be stored to the preferences database.
Console.Write("Enter a new address: ");
string newAddress = Console.ReadLine();
Console.WriteLine("Setting address for user " + userID +
" to '" + newAddress + "'!");
Program.proxyStaticMod.setSetting(userID,
"PersonalDetails:Address", "string", newAddress);
...
Finally, we read back the address field from the database in order to check out whether the
operations was successful:
Console.WriteLine("Reading back address for user " + userID +
"...");
address = getXmlElement(Program.proxyResMod.getSetting(
userID, "PersonalDetails:Address"),"value");
Console.WriteLine("Address is '" + address + "'!");
Console.WriteLine();
...
As a last step, we wait for the user to press “return” in order to exit the program.
using EMIC.WebServer;
Amigo IST-2004-004182 24/29
June 2007 Confidential
using EMIC.WSDiscovery.Server;
using EMIC.WSDiscovery.Client;
using EMIC.WSAddressing;
using System.Xml;
namespace UMPS_Example
{
//static class Program
class Program
{
public static UMPS_Example.IUserProfileManagement.Service
proxyStaticMod;
public static UMPS_Example.IUserProfileQuerrying.Service
proxyResMod;
pc1.AddServiceScope(
new EMIC.WSDiscovery.ServiceScope("urn:Amigo"));
pc1.AddServiceType(
new EMIC.WSDiscovery.ServiceType("IUserProfileManagement"));
pc2.AddServiceScope(
new EMIC.WSDiscovery.ServiceScope("urn:Amigo"));
pc2.AddServiceType(
new EMIC.WSDiscovery.ServiceType("IUserProfileQuerrying"));
while (true)
{
Console.WriteLine("Discovering services...");
if (pc1.ProbeMatches.Count == 0) pc1.SendProbe();
if (pc2.ProbeMatches.Count == 0) pc2.SendProbe();
System.Threading.Thread.Sleep(5000);
proxyResMod =
new UMPS_Example.IUserProfileQuerrying.Service();
proxyResMod.Url =
pc2.ProbeMatches[0].FirstXaddr.ToString();
break;
}
}
Console.WriteLine("All required services found!");
return true;
}
while (reader.Read())
{
if (reader.Name == tag)
{
reader.Read();
string str = reader.ReadContentAsString();
return str;
}
}
return "???";
}
Console.Write("User ID=");
string userID = Console.ReadLine();
After typing in an user ID, the system will query the current address field form the database
and print it to the screen. Enter a new address and press “return”.
Thereafter, the client will set the address in the database, re-read it and print the result to the
screen again.