This document defines a registry of query components to be used in the context of XMPP IRIs/URIs and also specifies an initial submission of values to that registry.
NOTICE: This Informational JEP defines a best practice or protocol profile that has been approved by the Jabber Council and/or the JSF Board of Directors. Implementations are encouraged and the best practice or protocol profile is appropriate for deployment in production systems.
Status:
Active
Type:
Informational
Number: 0147
Version: 1.1
Last Updated: 2006-06-19
JIG: Standards JIG
Approving Body: Jabber Council
Dependencies: XMPP Core, RFC 4622, JEP-0053
Supersedes: None
Superseded By: None
Short Name: querytypes
Registry:
<http://www.jabber.org/registrar/querytypes.html>
Wiki Page: <http://wiki.jabber.org/index.php/XMPP URI Scheme Query Components (JEP-0147)>
Email:
stpeter@jabber.org
JID:
stpeter@jabber.org
This Jabber Enhancement Proposal is copyright 1999 - 2006 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.shtml>. This material may be distributed only subject to the terms and conditions set forth in the Creative Commons Attribution License (<http://creativecommons.org/licenses/by/2.5/>).
The preferred venue for discussion of this document is the Standards-JIG discussion list: <http://mail.jabber.org/mailman/listinfo/standards-jig>.
Given that this JEP normatively references IETF technologies, discussion on the JSF-IETF list may also be appropriate (see <http://mail.jabber.org/mailman/listinfo/jsf-ietf> for details).
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 3920) and XMPP IM (RFC 3921) 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 protocol defined in this JEP has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.
The following keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".
RFC 4622 [1] defines a Uniform Resource Identifier (URI) scheme for use in forming URIs and Internationalized Resource Identifiers (IRIs) [2] from the addresses of entities that can communicate using the Extensible Messaging and Presence Protocol (see XMPP Core [3]). Such identifiers enable identification of and interaction with XMPP entities by non-native applications such as databases and web browsers.
However, RFC 4622 intentionally leaves the potential values of the query component open-ended, does not provide a list of common "actions" for queries (e.g., send message or join chatroom), and does not specify recommended "key-value" pairs to be used in the context of such actions. Therefore, this document defines a registry of such actions and key-value pairs (to be maintained by the Jabber Registrar [4]) and specifies a set of initial values for that registry.
This document is organized as follows:
Note: The format of the XMPP URI scheme, including the format of the query component, is fully specified and formally defined in RFC 4622; this document does not modify the xmpp URI scheme in any way and assumes that the reader is familiar with all aspects of RFC 4622.
This document inherits terminology from RFC 3986 [5], RFC 3987 [6], and RFC 4622.
The range of actions that might be triggered by interaction with an XMPP entity by means of an XMPP IRI/URI is potentially as wide as the range of extensions to XMPP. This document does not seek to exhaustively define all such potential actions. However, the following actions might be of general interest:
For each such action, the Jabber Registrar maintains a RECOMMENDED "querytype" (this can be thought of as an action name or "verb"; see RFC 4622 for syntax and semantics) as well as an OPTIONAL list of keys to be used in key-value pairs if appropriate.
The querytypes and key-value pairs related to RFC 3920 and RFC 3921 are defined herein; the querytypes and key-value pairs related to protocols defined in the JSF's JEP series are defined in the relevant JEPs.
It may desirable for an XMPP IRI/URI to trigger a specialized interface for sending an XMPP message stanza. The RECOMMENDED querytype for this action is "message". If no key-value pair is provided, interacting with an XMPP IRI/URI that contains a querytype of "message" SHOULD trigger an interface that enables the user to input the text of an XMPP message and other relevant parameters (e.g., a message subject or XHTML-IM [14] markup).
xmpp:romeo@montague.net?message
A query component whose querytype is "message" MAY specify various key-value pairs. The following three keys are associated with the child elements of the <message/> stanza specified in the XML schema for the 'jabber:client' namespace as defined in XMPP IM [15]:
In addition, the following three keys are associated with the attributes of the <message/> stanza specified in the XML schema for the 'jabber:client' namespace (the 'to' attribute is unnecessary, since it is provided by the XMPP address included in the IRI/URI):
Other keys MAY be registered with the Jabber Registrar but are not specified herein.
xmpp:romeo@montague.net?message;subject=Test%20Message;body=Here%27s%20a%20test%20message
<message to='romeo@montague.net'> <subject>Test Message</subject> <body>Here's a test message.</body> </message>
The 'jabber:iq:roster' namespace provides a mechanism for managing an XMPP roster (also called a "contact list"). This namespace is defined in RFC 3921. The registered querytype for adding items to the roster or editing items in the roster is "roster" (effectively there is no difference between adding and editing). An XMPP IRI/URI containing a "roster" querytype MAY also include at most one "name" key whose value maps to the 'name' attribute of the <item/> element within the 'jabber:iq:roster' namespace, and MAY contain one "group" key whose value maps to the character data of the <group/> child element of <item/>.
xmpp:romeo@montague.net?roster
<iq type='set'> <query xmlns='jabber:iq:roster'> <item jid='romeo@montague.net'/> </query> </iq>
xmpp:romeo@montague.net?roster;name=Romeo%20Montague
<iq type='set'> <query xmlns='jabber:iq:roster'> <item jid='romeo@montague.net' name='Romeo Montague'/> </query> </iq>
xmpp:romeo@montague.net?roster;name=Romeo%20Montague;group=Friends
<iq type='set'> <query xmlns='jabber:iq:roster'> <item jid='romeo@montague.net' name='Romeo Montague'> <group>Friends</group> </item> </query> </iq>
Note: Methods (if any) for including more than one group are yet to be determined.
The 'jabber:iq:roster' namespace includes a mechanism for removing an XMPP roster item. The registered querytype for removing an item from the roster is "remove".
xmpp:romeo@montague.net?remove
<iq type='set'> <query xmlns='jabber:iq:roster'> <item jid='romeo@montague.net' subscription='remove'/> </query> </iq>
Closely coupled with roster management is presence subscription management. In XMPP, subscription management is handled via special values of the <presence/> stanza, as described in RFC 3921. When an entity subscribes to another entity's presence by means of an XMPP IRI/URI, the invoked XMPP application SHOULD first send a roster add stanza as shown below (this is consistent with the recommendations in RFC 3921).
xmpp:romeo@montague.net?subscribe
<iq type='set'> <query xmlns='jabber:iq:roster'> <item jid='romeo@montague.net'/> </query> </iq> <presence to='romeo@montague.net' type='subscribe'/>
XMPP includes a mechanism for unsubscribing from an entity. The registered querytype for doing so is "unsubscribe".
xmpp:romeo@montague.net?unsubscribe
<presence to='romeo@montague.net' type='unsubscribe'/>
Once an entity is subscribed to the presence of a contact, it is allowed to probe for the contact's current presence if necessary. Although normally this is done by the server on the user's behalf, the client may initiate a probe as well (see RFC 3921). The registered querytype for initiating a presence probe is "probe".
An example of the action and resulting protocol is shown below.
xmpp:romeo@montague.net?probe
<presence to='romeo@montague.net' type='probe'/>
Internationalization considerations for XMPP IRIs/URIs are specified in RFC 4622; the reader is referred to that document for a complete discussion of the relevant issues.
Localization of application-specific data presented to a human user (e.g., as encapsulated in key-value pairs) is the responsibility of the using protocol.
Security considerations for XMPP IRIs/URIs are specified in RFC 4622.
Completion of some of the actions defined herein will cause changes to an entity's account, subscriptions to information, registration with services, communication with other entities, completion of ad-hoc commands, and the like. Naturally, such changes, information, services, and communications are potentially undesirable (e.g., joining a chatroom whose discussion topic is not of interest to, or even patently offensive to, the joining user). The invoked application SHOULD appropriately warn a human user regarding the potential consequences of the action about to be completed.
This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [16]. If in the future the IANA should wish to maintain a registry of XMPP URI/IRI query components, the Jabber Registrar will cooperate with efforts to migrate the registry from the Jabber Registrar to the IANA.
The Jabber Registrar maintains a registry of querytype values (see <http://www.jabber.org/registrar/querytypes.html>).
In order to submit new values to this registry, the registrant must define an XML fragment of the following form and either include it in the relevant Jabber Enhancement Proposal or send it to the email address <registrar@jabber.org>:
<querytype> <name>the name of the querytype (e.g., "pubsub")</name> <proto> the namespace of associated protocol output (e.g., "http://jabber.org/protocol/pubsub") </proto> <desc>a natural-language description of the querytype</desc> <doc>the document in which the querytype is specified</doc> <keys> <key> <name>the name of the key (e.g., "action")</name> <desc>a natural-language description of the key</desc> <values> <value> <name>the name of a value (e.g., "subscribe")</name> <desc>a natural-language description of the value</desc> </value> </values> </key> </keys> </querytype>
Note: Within the <querytype/> element, the <keys/> child element is OPTIONAL; within any given <key/> element, the <values/> child element is also OPTIONAL.
The registrant may register more than one querytype at a time, each contained in a separate <querytype/> element.
The following submission registers parameters related to the XMPP RFCs. For submissions related to XMPP extensions, refer to the relevant JEPs.
<querytype> <name>message</name> <proto>jabber:client</proto> <desc>enables sending of an XMPP message stanza</desc> <doc>JEP-0147</doc> <keys> <key> <name>subject</name> <desc>a subject for the message per the "jabber:client" schema</desc> </key> <key> <name>body</name> <desc>a body for the message per the "jabber:client" schema</desc> </key> <key> <name>thread</name> <desc>a Thread ID for the message per the "jabber:client" schema</desc> </key> <key> <name>from</name> <desc>a from address for the message per the "jabber:client" schema</desc> </key> <key> <name>id</name> <desc>an ID for the message per the "jabber:client" schema</desc> </key> <key> <name>type</name> <desc>the message type per the "jabber:client" schema</desc> <values> <value> <name>chat</name> <desc>a message of type "chat"</desc> </value> <value> <name>groupchat</name> <desc>a message of type "groupchat"</desc> </value> <value> <name>headline</name> <desc>a message of type "headline"</desc> </value> <value> <name>normal</name> <desc>a message of type "normal"</desc> </value> </values> </key> </keys> </querytype> <querytype> <name>probe</name> <proto>jabber:client</proto> <desc>enables probing for a contact's current presence information</desc> <doc>JEP-0147</doc> </querytype> <querytype> <name>remove</name> <proto>jabber:iq:roster</proto> <desc>enables removing a roster item</desc> <doc>JEP-0147</doc> </querytype> <querytype> <name>roster</name> <proto>jabber:iq:roster</proto> <desc>enables adding or editing a roster item</desc> <doc>JEP-0147</doc> <keys> <key> <name>group</name> <desc>the user-assigned group for the roster item</desc> </key> <key> <name>name</name> <desc>the user-assigned name for the roster item</desc> </key> </keys> </querytype> <querytype> <name>subscribe</name> <proto>jabber:client</proto> <desc>enables sending a presence subscription request</desc> <doc>JEP-0147</doc> </querytype> <querytype> <name>unsubscribe</name> <proto>jabber:client</proto> <desc>enables unsubscribing from an entity's presence</desc> <doc>JEP-0147</doc> </querytype>
1. RFC 4622: Internationalized Resource Identifiers (IRIs) and Uniform Resource Identifiers (URIs) for the Extensible Messaging and Presence Protocol (XMPP) <http://www.ietf.org/rfc/rfc4622.txt>.
2. On the difference between IRIs and URIs, see RFC 3987.
3. RFC 3920: Extensible Messaging and Presence Protocol (XMPP): Core <http://www.ietf.org/rfc/rfc3920.txt>.
4. 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/>.
5. RFC 3986: Uniform Resource Identifiers (URI): Generic Syntax <http://www.ietf.org/rfc/rfc3986.txt>.
6. RFC 3987: Internationalized Resource Identifiers (IRIs) <http://www.ietf.org/rfc/rfc3987.txt>.
7. JEP-0030: Service Discovery <http://www.jabber.org/jeps/jep-0030.html>.
8. JEP-0045: Multi-User Chat <http://www.jabber.org/jeps/jep-0045.html>.
9. JEP-0050: Ad-Hoc Commands <http://www.jabber.org/jeps/jep-0050.html>.
10. JEP-0054: vcard-temp <http://www.jabber.org/jeps/jep-0054.html>.
11. JEP-0060: Publish-Subscribe <http://www.jabber.org/jeps/jep-0060.html>.
12. JEP-0077: In-Band Registration <http://www.jabber.org/jeps/jep-0077.html>.
13. JEP-0096: File Transfer <http://www.jabber.org/jeps/jep-0096.html>.
14. JEP-0071: XHTML-IM <http://www.jabber.org/jeps/jep-0071.html>.
15. RFC 3921: Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence <http://www.ietf.org/rfc/rfc3921.txt>.
16. 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/>.
Added actions for roster removal, presence unsubscription, and cancellation of registration; moved querytypes related to XMPP extensions from this document to the relevant JEPs.
(psa)Per a vote of the Jabber Council, advanced to Active.
(psa)Added actions for ad-hoc commands and vCard retrieval; clarified some explanatory text.
(psa)Updated to reflect RFC 4622-03; modified file transfer query operations to handle both send and receive use cases.
(psa)Updated to reflect RFC 4622-01; added file querytype for file transfer.
(psa)Updated to reflect RFC 4622-00.
(psa)Updated to reflect draft-saintandre-xmpp-uri-08 and subsequent XMPP WG discussion; removed use cases for editing roster items, removing roster items, leaving chatrooms, unsubscribing, and unregistering (these make more sense from within a dedicated client); added use case for simultaneously joining a room and inviting other participants; further specified security considerations.
(psa)Updated to reflect draft-saintandre-xmpp-uri-07; specified Service Discovery usage.
(psa)Initial version.
(psa)END