JEP-0108: User Activity

This JEP defines a protocol for communicating information about user activities.


NOTICE: This JEP is currently within Last Call or under consideration by the Jabber Council for advancement to the next stage in the JSF standards process. For further details, visit <http://www.jabber.org/council/queue.php>.


JEP Information

Status: Proposed
Type: Standards Track
Number: 0108
Version: 0.4
Last Updated: 2004-09-15
JIG: Standards JIG
Approving Body: Jabber Council
Dependencies: XMPP Core, JEP-0060
Supersedes: None
Superseded By: None
Short Name: activity

Author Information

Ralph Meijer

Email: ralphm@ik.nu
JID: ralphm@ik.nu

Peter Saint-Andre

Email: stpeter@jabber.org
JID: stpeter@jabber.org

Legal Notice

This Jabber Enhancement Proposal is copyright 1999 - 2004 by the Jabber Software Foundation (JSF) and is in full conformance with the JSF's Intellectual Property Rights Policy <http://www.jabber.org/jsf/ipr-policy.php>. This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at <http://www.opencontent.org/openpub/>).

Discussion Venue

The preferred venue for discussion of this document is the Standards-JIG discussion list: <http://mail.jabber.org/mailman/listinfo/standards-jig>.

Relation to XMPP

The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core and XMPP IM specifications contributed by the Jabber Software Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocols defined in this JEP have been developed outside the Internet Standards Process and are to be understood as extensions to XMPP rather than as an evolution, development, or modification of XMPP itself.

Conformance Terms

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.


Table of Contents

1. Introduction
2. Protocol
3. Activity Values
4. Mapping to RPID
5. Internationalization Considerations
6. Security Considerations
7. IANA Considerations
8. Jabber Registrar Considerations
8.1. Protocol Namespaces
9. XML Schema
Notes
Revision History


1. Introduction

This JEP defines an extension mechanism for capturing "extended presence" data about user activities, above and beyond availability as defined in XMPP IM [1] (e.g., the 'away', 'extended away', and 'dnd' values of the <show/> child of the <presence/> stanza).

2. Protocol

Information about user activities is provided by the user and propagated on the network by the user's client. The information is structured by means of an <activity/> element that is qualified by the 'http://jabber.org/protocol/activity' namespace. The activity itself is provided as the XML character data of the REQUIRED <general/> and OPTIONAL <specific> children of the <activity/> element. The user MAY also specify a natural-language description of the activity in the OPTIONAL <text/> child of the <activity/> element.

The <activity/> element SHOULD be communicated by means of Publish-Subscribe [2]. Because activity information is not pure presence information and can change independently of the user's availability, it SHOULD NOT be provided as an extension to <presence/>.

Example 1. User Publishes Activity

<iq type='set' 
    from='juliet@capulet.com/balcony' 
    to='pubsub.shakespeare.lit' 
    id='publish1'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <publish node='generic/juliet-activity'>
      <item id='current'>
        <activity xmlns='http://jabber.org/protocol/activity'>
          <general>relaxing</general>
          <specific>partying</specific>
          <text>My nurse's birthday!</text>
        </activity>
      </item>
    </publish>
  </pubsub>
</iq>
    

The activity is then delivered to all subscribers:

Example 2. Activity is Delivered to All Subscribers

<message 
    from='pubsub.shakespeare.lit' 
    to='romeo@montague.net/orchard'>
  <event xmlns='http://jabber.org/protocol/pubsub#event'>
    <items node='generic/juliet-activity'>
      <item id='current'>
        <activity xmlns='http://jabber.org/protocol/activity'>
          <general>relaxing</general>
          <specific>partying</specific>
          <text>My nurse's birthday!</text>
        </activity>
      </item>
    </items>
  </event>
</message>
.
.
.
    

As mentioned in JEP-0060, the stanza containing the event notification or payload MAY also include 'replyto' data (as specified by the Extended Stanza Addressing [3] protocol) to provide an explicit association between the published data and the user:

Example 3. Event notification with extended stanza addressing

<message 
    from='pubsub.shakespeare.lit' 
    to='romeo@montague.net/orchard'>
  <event xmlns='http://jabber.org/protocol/pubsub#event'>
    <items node='generic/juliet-activity'>
      <item id='current'>
        <activity xmlns='http://jabber.org/protocol/activity'>
          <general>relaxing</general>
          <specific>partying</specific>
          <text>My nurse's birthday!</text>
        </activity>
      </item>
    </items>
  </event>
  <addresses xmlns='http://jabber.org/protocol/address'>
    <address type='replyto' jid='juliet@capulet.com'/>
  </addresses>
</message>
    

3. Activity Values

Each activity has a REQUIRED <general/> category and an OPTIONAL <specific/> instance. One can understand each specifier as '[user] is [activity]' (e.g., 'Juliet is partying'), where the relevant value is the most specific activity provided (e.g., specifically "partying" rather than generally "relaxing"). The optional <text/> element MAY be used to provide further details about the activity.

The activity values defined in this taxonomy are as follows, where the first indentation level is the general category and the second indentation level is the specific instance:

In addition, the <specific/> element can take a value of "other" in order to handle activities not defined herein. [4]

4. Mapping to RPID

The draft-ietf-simple-rpid [5] Internet-Draft published within the IETF's SIMPLE Working Group defines several extensions to the Presence Information Data Format (PIDF) [6] for so-called "rich presence". One such extension is the <activity/> element (see Section 4.2), which "describes what the presentity is currently doing". The following table shows a mapping from the defined RPID activity values to the Jabber values defined herein.

Table 1: RPID-to-Jabber mappings

RPID <activity/> Jabber <general/> Jabber <specific/>
appointment having_appointment --
available [7]
away [8]
busy [9]
holiday inactive scheduled_holiday
in-transit traveling [10]
meal eating [11]
meeting working in_a_meeting
on-the-phone talking on_the_phone
permanent-absence [12]
sleeping inactive sleeping
steering traveling driving
travel traveling on_a_trip
vacation inactive on_vacation

The full range of activities defined herein is considerably richer than that defined in RPID; no mapping to RPID is provided by this specification for activity values that are not present in RPID, and any such mapping is the responsibility of a gateway between the two systems.

5. Internationalization Considerations

The XML character data values of the <general/> and <specific/> elements are not intended to be presented to a human user and thus there is no special reason to include an 'xml:lang' attribute unless the sender includes a <text/> element as well (as explained in RFC 2277 [14], "internationalization is for humans"). It is the responsibility of the receiving application to provide localized text strings associated with the XML character data values defined herein, or some other appropriate presentation (e.g., graphical images that represent the appropriate activities).

6. Security Considerations

Because user activities may be published to a large number of pubsub subscribers, users should take care in approving subscribers and in characterizing their current activities.

7. IANA Considerations

This JEP requires no interaction with the Internet Assigned Numbers Authority (IANA) [15].

8. Jabber Registrar Considerations

8.1 Protocol Namespaces

Upon advancement of this proposal to a status of Draft, the Jabber Registrar [16] shall add the 'http://jabber.org/protocol/activity' namespace to its registry of protocol namespaces.

9. XML Schema

<?xml version='1.0' encoding='UTF-8'?>

<xs:schema
    xmlns:xs='http://www.w3.org/2001/XMLSchema'
    targetNamespace='http://jabber.org/protocol/activity'
    xmlns='http://jabber.org/protocol/activity'
    elementFormDefault='qualified'>

  <xs:element name='activity'>
    <xs:complexType>
      <xs:sequence>
        <xs:element ref='general' minOccurs='1'/>
        <xs:element ref='specific' minOccurs='0'/>
        <xs:element name='text' minOccurs='0' type='xs:string'/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name='general'>
    <xs:simpleType>
      <xs:restriction base='xs:NCName'>
        <xs:enumeration value='doing_chores'/>
        <xs:enumeration value='drinking'/>
        <xs:enumeration value='eating'/>
        <xs:enumeration value='exercising'/>
        <xs:enumeration value='grooming'/>
        <xs:enumeration value='having_appointment'/>
        <xs:enumeration value='inactive'/>
        <xs:enumeration value='relaxing'/>
        <xs:enumeration value='talking'/>
        <xs:enumeration value='traveling'/>
        <xs:enumeration value='working'/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>

  <xs:element name='specific'>
    <xs:simpleType>
      <xs:restriction base='xs:NCName'>
        <xs:enumeration value='at_the_spa'/>
        <xs:enumeration value='brushing_teeth'/>
        <xs:enumeration value='buying_groceries'/>
        <xs:enumeration value='cleaning'/>
        <xs:enumeration value='coding'/>
        <xs:enumeration value='commuting'/>
        <xs:enumeration value='cooking'/>
        <xs:enumeration value='cycling'/>
        <xs:enumeration value='day_off'/>
        <xs:enumeration value='doing_maintenance'/>
        <xs:enumeration value='doing_the_dishes'/>
        <xs:enumeration value='doing_the_laundry'/>
        <xs:enumeration value='driving'/>
        <xs:enumeration value='flying'/>
        <xs:enumeration value='gaming'/>
        <xs:enumeration value='gardening'/>
        <xs:enumeration value='getting_a_haircut'/>
        <xs:enumeration value='going_out'/>
        <xs:enumeration value='hanging_out'/>
        <xs:enumeration value='having_a_beer'/>
        <xs:enumeration value='having_a_snack'/>
        <xs:enumeration value='having_breakfast'/>
        <xs:enumeration value='having_coffee'/>
        <xs:enumeration value='having_dinner'/>
        <xs:enumeration value='having_lunch'/>
        <xs:enumeration value='having_tea'/>
        <xs:enumeration value='hiking'/>
        <xs:enumeration value='in_a_car'/>
        <xs:enumeration value='in_a_meeting'/>
        <xs:enumeration value='in_real_life'/>
        <xs:enumeration value='jogging'/>
        <xs:enumeration value='on_a_bus'/>
        <xs:enumeration value='on_a_plane'/>
        <xs:enumeration value='on_a_train'/>
        <xs:enumeration value='on_a_trip'/>
        <xs:enumeration value='on_the_phone'/>
        <xs:enumeration value='on_vacation'/>
        <xs:enumeration value='other'/>
        <xs:enumeration value='partying'/>
        <xs:enumeration value='playing_sports'/>
        <xs:enumeration value='reading'/>
        <xs:enumeration value='reading'/>
        <xs:enumeration value='rehearsing'/>
        <xs:enumeration value='running'/>
        <xs:enumeration value='running_an_errand'/>
        <xs:enumeration value='scheduled_holiday'/>
        <xs:enumeration value='shaving'/>
        <xs:enumeration value='shopping'/>
        <xs:enumeration value='skiing'/>
        <xs:enumeration value='sleeping'/>
        <xs:enumeration value='socializing'/>
        <xs:enumeration value='studying'/>
        <xs:enumeration value='sunbathing'/>
        <xs:enumeration value='swimming'/>
        <xs:enumeration value='taking_a_bath'/>
        <xs:enumeration value='taking_a_shower'/>
        <xs:enumeration value='walking'/>
        <xs:enumeration value='walking_the_dog'/>
        <xs:enumeration value='watching_tv'/>
        <xs:enumeration value='watching_a_movie'/>
        <xs:enumeration value='working_out'/>
        <xs:enumeration value='writing'/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>

</xs:schema>
  


Notes

1. RFC 3921: Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence <http://www.ietf.org/rfc/rfc3921.txt>.

2. JEP-0060: Publish-Subscribe <http://www.jabber.org/jeps/jep-0060.html>.

3. JEP-0033: Extended Stanza Addressing <http://www.jabber.org/jeps/jep-0033.html>.

4. In the absence of a <text/> element, the recipient is free to draw whatever conclusions he or she may like regarding the nature of the "other" activity. Naturally, emoticons can be provided as the XML character data of the <text/> element. ;-)

5. draft-ietf-simple-rpid <http://www.ietf.org/internet-drafts/draft-ietf-simple-rpid-04.txt>. Work in progress.

6. RFC 3863: Presence Information Data Format (PIDF) <http://www.ietf.org/rfc/rfc3863.txt>.

7. In XMPP, "available" is not an activity, but an availability state captured by means of a <presence/> stanza with no <show/> child (see XMPP IM).

8. In XMPP, "away" is not an activity, but an availability state captured by means of a <presence/> stanza with a <show>away</show> child (see XMPP IM).

9. In XMPP, "busy" is not an activity, but an availability state captured by means of a <presence/> stanza with <show>dnd</show> child (see XMPP IM). Alternatively, the RPID "busy" activity could map to any number of more specific Jabber activities as defined herein.

10. Appropriate specific values in the "traveling" category would be "in_a_car", "on_a_bus", and "on_a_train".

11. The "eating" category can be further specified by "having_a_snack", "having_breakfast", "having_lunch", or "having_dinner".

12. In XMPP, "permanent absence" is not an activity, but instead would be sent to a contact via the <gone/> stanza error (see XMPP Core [13]).

13. RFC 3920: Extensible Messaging and Presence Protocol (XMPP): Core <http://www.ietf.org/rfc/rfc3920.txt>.

14. RFC 2277: IETF Policy on Character Sets and Languages <http://www.ietf.org/rfc/rfc2277.txt>.

15. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.

16. The Jabber Registrar maintains a list of reserved Jabber protocol namespaces as well as registries of parameters used in the context of protocols approved by the Jabber Software Foundation. For further information, see <http://www.jabber.org/registrar/>.


Revision History

Version 0.4 (2004-09-15)

Added internationalization considerations. (psa)

Version 0.3 (2004-04-25)

Corrected several errors; added reference to JEP-0033. (psa)

Version 0.2 (2004-02-19)

Minor text and schema changes; added RPID mapping. (psa)

Version 0.1 (2003-07-22)

Initial version. (rm)


END