ibspan.tss.um.learning
Class EventsPreprocessor

java.lang.Object
  extended by ibspan.tss.um.learning.EventsPreprocessor

public class EventsPreprocessor
extends Object

This class is used to process a pack of new events, prepare necessary information for learning and put them into LearningTask.

The difference between clicked concepts and clicked individuals, mentioned in methods below is that clicked concepts are only URI references of objects, which were clicked (or rated), and individuals are fully described resourcers of these concepts. Descriptions of these individuals can be obtained only by asking RestaurantServiceAgent. This information serves as base for extending context of the given events. Therefore we obtain knowledge about properties of concept a user is interested in, which could draw as to find the reasons for which the user clicked such concepts.

Author:
Maciej Gawinecki
See Also:
LearningTask, ContinuousLearning, LearningAlgorithm

Constructor Summary
EventsPreprocessor(OntModel mDomain)
          Constructs EventsPreprocessor.
 
Method Summary
 List<ExtendedEvent> extendContext(List<Event> events)
          Extends the context of the given events on the base of description of those individuals (e.g. a restaurant), which were clicked or rated by the user and on the base of expected properties of an individual (e.g. a restaurant), user defined in search query
 Set<String> getClickedConcepts(List<Event> events)
          Returns set of concepts which were cliked or rated by a user in the given events.
 Set<String> getObjectedConcepts(List<ExtendedEvent> events)
          Returns list of concept URI references, which were objected in the given events.
 Set<Integer> getPlayingUsers(List<Event> events)
          Returns set of users which acted in the given events.
 void setClickedIndividualsModel(OntModel individuals)
          Informs this processor about individuals which were clicked by user user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventsPreprocessor

public EventsPreprocessor(OntModel mDomain)
Constructs EventsPreprocessor.

Parameters:
mDomain - is model of domain ontology.
Method Detail

setClickedIndividualsModel

public void setClickedIndividualsModel(OntModel individuals)
Informs this processor about individuals which were clicked by user user. Necessary for extending context of events.

Parameters:
individuals - is model of individuals (e.g. restaurants).
See Also:
extendContext(List)

getClickedConcepts

public Set<String> getClickedConcepts(List<Event> events)
Returns set of concepts which were cliked or rated by a user in the given events.

Parameters:
events - are events to be retrieved
Returns:
URI references of concept

getObjectedConcepts

public Set<String> getObjectedConcepts(List<ExtendedEvent> events)
Returns list of concept URI references, which were objected in the given events.

Parameters:
events - are events to retrieve
Returns:
list of URI references of found objected concepts

getPlayingUsers

public Set<Integer> getPlayingUsers(List<Event> events)
Returns set of users which acted in the given events.

Parameters:
events - is list of events
Returns:
set of users IDs

extendContext

public List<ExtendedEvent> extendContext(List<Event> events)
                                  throws UnknownIndividualsException
Extends the context of the given events on the base of description of those individuals (e.g. a restaurant), which were clicked or rated by the user and on the base of expected properties of an individual (e.g. a restaurant), user defined in search query

Parameters:
events - to be extends
Returns:
events with extended context
Throws:
UnknownIndividualsException - when EventProcessor was not informed about model of individuals.