=Paper= {{Paper |id=Vol-549/paper-3 |storemode=property |title=WellnessRules: The Activity Rule Responder |pdfUrl=https://ceur-ws.org/Vol-549/paper3.pdf |volume=Vol-549 |authors=Taylor Michael Osmun,Benjamin Larry Craig,and Harold Boley |dblpUrl=https://dblp.org/rec/conf/ruleml/OsmunCB09 }} ==WellnessRules: The Activity Rule Responder== https://ceur-ws.org/Vol-549/paper3.pdf
    WellnessRules: The Activity Rule Responder

        Taylor Michael Osmun, Benjamin Larry Craig, and Harold Boley

      Institute for Information Technology National Research Council of Canada
                          Fredericton, NB, E3B 9W4, Canada



       Abstract. Rule Responder is an intelligent multi-agent infrastructure
       for collaborative teams and virtual communities. Within these commu-
       nities, each participant can be assisted by a semi-automated agent which
       utilizes rules to respond to messages posed by users. Each Rule Respon-
       der instantiation uses three different kinds of agents: An Organizational
       Agent (OA), Personal Agents (PAs), and External Agents (EAs). This
       paper describes the implemented Rule Responder instantiation to Well-
       nessRules, supporting online-interactive wellness communities. In Well-
       nessRules, Rule Responder’s OA, using the Prova engine, acts as the
       manager of the community, the PAs execute participants’ local wellness
       rules, and the EAs facilitate Web-based interaction between participants
       and Rule Responder. Each PA is implemented as a Java servlet which
       can execute both the OO jDREW and Euler engines for POSL and N3
       representations of knowledge bases, respectively.


1     Introduction
With an ever-increasing emphasis on exercise and diet for individuals around
the world, it becomes necessary to find new and innovative means to provide
support for these wellness-related practices. WellnessRules (WR) is a new use
case implemented with Rule Responder (RR) with the intention of forming an
online-interactive wellness community. The goal of this system is the following.
As in Friend of a Friend (FOAF), people can choose a (community-unique) nick-
name and create semantic profiles about themselves, specifically their wellness
practices, for their own planning and to network with other people supported by
a system that ‘understands’ those profiles [BOC09]. These wellness profiles can
currently be written as either POSL or N3 rules, which are handled by the en-
gines OO jDREW and Euler, respectively. Users are then able to send messages
to WellnessRules, in the form of general or specific queries which use a RuleML
subset for interchange. Profile rules may specify when a participant is able to
perform a certain activity (e.g. Walking or Running), depending on the weather
forecast, season, and time of day. Queries can be posed to these community pro-
files, and various activity groups of participants be formed. A number of sample
queries is provided via the WellnessRules website1 . Such a query is delegated
from the OA to the relevant PA. This PA then selects the wellness profile(s)
of the appropriate participant(s), containing their preferences with regards to
1
    www.ruleml.org/WellnessRules/RuleResponder/
2       Taylor Osmun, Benjamin Craig, and Harold Boley

activity and nutrition. Finally, this knowledge is used to answer the query and
send it back to the OA. The above website features live query-answer pairs.


2     Overview of Rule Responder
Rule Responder’s architecture realizes a system of Organizational Agents (OAs)
and Personal Agents (PAs), accessed by External Agents (EAs), on top of an
Enterprise Service Bus (ESB) communication middleware [Cra08]. Using a hub
and spoke architecture style, each OA is able to communicate with every PA in
its organization, which in turn allows the user access to the relevant knowledge
base. In this implementation of Rule Responder, there exists a single OA with as
many PAs as needed. An EA, or user of this system, interacts via a Web-based
GUI, which uses the HTTP protocol to send and receive messages (in this case,
using the WellnessRules website [WRW]). The OA is the delegator of messages
sent to the organization. Using a role assignment matrix (implemented by an
OWL ontology) and a Prova knowledge base, it assesses the incoming message,
and determines the appropriate PA for its destination. The rule-based PAs rep-
resent, as their ‘dynamic profiles’, all of the participating human members of the
virtual organization modeled by Rule Responder [Cra08]. The communication
middleware used by Rule Responder is an efficient and open source ESB called
Mule; it acts as the the link between Rule Responder and the user. It allows
connection through various protocols such as JMS, HTTP, and SOAP, which in
turn permits the communication between many sorts of software such as web-
pages, servlets, and rule engines. The role of the EA is to interact with this
communication middleware through the API (in the form of a website), which
will transfer the message to and from various parts of Rule Responder.


3     Implementation of Distributed WellnessRules Using
      Rule Responder
Through Rule Responder’s system of PAs, OAs, and EAs, WellnessRules’ well-
ness community will be fully realized. WellnessRules extends the hub and spoke
architecture of Rule Responder such that an OA not only accesses responsible
PAs, but also the PAs select (wellness) profiles of participants in the community
(see Fig. 1).
    So, although WellnessRules is similar to other systems which use Rule Re-
sponder, there are major differences and advancements. SymposiumPlanner2 ,
an earlier instantiation of Rule Responder, uses the same hub and spoke archi-
tecture. The main difference is that the current SymposiumPlanner assists only
symposium chairs (not normal participants), while the current WellnessRules
only supports normal participants (later also supporting wellness coaches). A
slight deviation from the initial concept of RR is the addition of categories for
PAs: the OA has the option of either accessing Activity or Nutrition PAs, which
2
    www.ruleml.org/RuleML-2009/RuleResponder
                               WellnessRules: The Activity Rule Responder        3




                  Fig. 1. WellnessRules EA/OA/PA architecture.


makes finding the appropriate agent more efficient. Of course, each agent has a
well-defined role in WellnessRules, which is as follows.
    The OA is the moderator of the wellness community; it has knowledge of
which PAs are responsible for specific activities or nutritional preferences in
the community. The PAs themselves are differentiated through Activity and
Nutrition topics. For example, an Activity Group PA may be responsible for
multiple activities (e.g. Walking and Running), or may be more selective and
cover only a single activity (e.g. Skating). Finally, the EA is represented through
the WellnessRules website [WRW], which can be viewed in appendix B. Through
this interface, the user is able to type their query (represented in RuleML format)
and send it through the ESB to the OA by hitting the ‘Send Message’ button.
In addition to this, sample queries are provided, which can be used as templates
where certain values may be modified to make them specific to the user (e.g. a
profile ID).


4   Example Usage of WellnessRules

The following is an example usage of the WellnessRules system, which covers
the process from the user issuing a query, to the obtained end result. Using the
previously shown Web interface, participants issue queries in RuleML format to
the OA of the wellness community. The following is a small RuleML example of
such a query:
4       Taylor Osmun, Benjamin Craig, and Harold Boley

     
          myActivity
          ProfileID
          Running
          InOut
          1
          5
          StartTime
          EndTime
          Location
          Duration
          FitnessLevel
    

   The relation name of the query is myActivity, with variables ProfileID,
InOut, StartTime, EndTime, Location, Duration, and FitnessLevel (to be
bound by the query). The constants provided are Running, and the integers
1 and 5. In English, this query can be summarized as the following question
to the wellness community: Is anyone interested in general Running (indoors
or outdoors), with one to five people, for any (start and end) time, location,
duration, and fitness level?
   This query is passed to the OA, which uses its Prova knowledge base3 , to
handle it via the following reaction rule:

processMessage(XID,From,Primitive,
   myActivity(ProfileID,Activity,InOut,MinRSVP,MaxRSVP,
              StartTime,EndTime,Location,Duration,FitnessLevel)) :-

    The myActivity argument in the rule represents the query that was ex-
plained earlier, while the remaining information is given via the full query found
in appendix A.1. Prova then looks up the responsible PA for the query which is
found through the OWL ontology, located on the Web4 . The agent in question
is the PA named ‘wellnessRules Running’, which is responsible for all Running
activities. This agent is defined via a Java servlet, which will receive an HTTP
message through the ESB (Mule), and via its various methods, retrieve all rele-
vant information for Running. This process involves selecting the required profile
knowledge bases (in this case, those which pertain to Running activities within
the wellness community), and issuing the query to either OO jDREW (for POSL
files) or Euler (for N3 files). Example knowledge bases for p0001 are represented
in both POSL5 and N36 online. The answers of all PAs are collected and sent
back through the ESB to the OA, which then sends them back to the web-
site/user. A sample of such an answer is the following, with the full version
being found in appendix A.2:
3
  http://ruleml.org/WellnessRules/files/WellnessRules-Responder.prova
4
  www.ruleml.org/WellnessRules/files/WellnessRules.owl
5
  http://ruleml.org/WellnessRules/PA/p0001.posl
6
  http://ruleml.org/WellnessRules/PA/p0001.n3
                               WellnessRules: The Activity Rule Responder       5

    
          myActivity
          p0001
          Running
          in
          1
          5
          2009-06-10T10:15:00
          2009-06-10T11:15:00
          joesGym
          P10M
          5
    

    Even a single PA can provide multiple answers, but we will consider the above
one in particular. This answer tells the user that participant p0001 is interested
in going for an indoor run at Joe’s Gym between the times of 10:15 and 11:15
on June 10th, for 10 minutes, which will have a difficulty/fitness level of 5.
The answer was inferred via Euler’s execution on p0001’s N3 knowledge base,
while answers for other participants may be obtained by OO jDREW through
knowledge bases written in POSL. The WellnessRules architecture thus makes
users independent from any specific language such as POSL or N3.


5    Conclusion
Rule Responder has been used to implement a number of use cases, including
the RuleML-2007/2008/2009 symposium organization and the W3C Health and
Life Science (HCLS) [Cra08]. With the new system, WellnessRules, Rule Re-
sponder’s usefulness has been realized even further. Through it, WellnessRules
has the ability to support an online-interactive community, which will assist par-
ticipants in reaching their healthy-lifestyle goals. This is done via an extended
hub and spoke architecture of the agent-oriented Rule Responder system, allow-
ing WellnessRules to connect participants in the community. We plan to further
improve WellnessRules, e.g. by adding more supported rule languages and/or
engines and a full-fledged graphical user interface.


References
[BOC09] Harold Boley, Taylor Michael Osmun, and Benjamin Larry Craig. Wellness-
        Rules: A Web 3.0 Case Study in RuleML-Based Prolog-N3 Profile Interoper-
        ation. 2009.
[Cra08] Benjamin Larry Craig. Deploying a Distributed Symposium Planner Through
        Rule Responder. 2008.
[KBs]   http://www.ruleml.org/WellnessRules/PA.
[WRW] http://www.ruleml.org/WellnessRules/RuleResponder.
6      Taylor Osmun, Benjamin Craig, and Harold Boley

A     Sample Query and Result
The below sample query and result are full listings, corresponding to the paper-
specific example.

A.1   Full Example RuleML/XML Query
Sample queries are provided online through the EA http interface at the Well-
nessRules website [WRW].


 
   
      WellnessRules
   
   
      esb
   
   
      User
   
   
      
         myActivity
         ProfileID
         Running
         InOut
         1
         5
         StartTime
         EndTime
         Location
         Duration
         FitnessLevel
      
   
 

                              WellnessRules: The Activity Rule Responder     7

A.2   Full Example RuleML/XML Solution

This is one of the results that are generated online through the EA http inter-
face at the WellnessRules website [WRW], answered using both POSL and N3
knowledge bases[KBs].





   
      
         RuleResponder@iitfrdextdev01.iit-iti.priv236
      
   
      esb
   
   
      RuleResponder
   
   
      
         myActivity
         p0001
         Running
         in
         1
         5
         2009-06-10T10:15:00
         2009-06-10T11:15:00
         joesGym
         P10M
         5
    
   
   

8      Taylor Osmun, Benjamin Craig, and Harold Boley

B    WellnessRules Interface: Website

The below website [WRW] is the main interface for user interaction with Well-
nessRules.