Abstract: | This specification defines an XMPP protocol extension for including geolocation data in XEP-0004 data forms. |
Author: | Michael Laukner |
Copyright: | © 1999 – 2017 XMPP Standards Foundation. SEE LEGAL NOTICES. |
Status: | Experimental |
Type: | Standards Track |
Version: | 0.1 |
Last Updated: | 2014-07-03 |
WARNING: This Standards-Track document is Experimental. Publication as an XMPP Extension Protocol does not imply approval of this proposal by the XMPP Standards Foundation. Implementation of the protocol described herein is encouraged in exploratory implementations, but production systems are advised to carefully consider whether it is appropriate to deploy implementations of this protocol before it advances to a status of Draft.
1. Introduction
2. Requirements
3. Integrate Geolocation Element with XEP-0004
4. Allow Receiver to Valdidate Geolocation Data
4.1. Location Datatypes for Data Forms
5. Security Considerations
6. IANA Considerations
7. XMPP Registrar Considerations
7.1. Protocol Namespaces
7.2. Location Fields and Data Form Validation Datatypes
7.3. Text Field and Data Form Validation Datatypes
8. XML Schema
Appendices
A: Document Information
B: Author Information
C: Legal Notices
D: Relation to XMPP
E: Discussion Venue
F: Requirements Conformance
G: Notes
H: Revision History
In certain protocols that make use of Data Forms (XEP-0004) [1], it can be helpful to include geolocation data. One example of such a "using protocol" is Form Discovery and Publishing (XEP-0346) [2]. This document defines a method for including geolocation data in a Data Form for something you manage and want to publish. This XEP leaves it open to developers how such a <geoloc/> form element will be rendered; possibilities might include editing Latitude and Longitude manually or through a rendered map.
There may also be the need to gather location data from both humans (using a GUI format) and computer processes (using a pre-defined but flexible format). This document defines a flexible mechanism for the XMPP Registrar [3] to standardize geographical location field names in data forms, thus enabling XMPP clients to process location fields in forms while giving protocol authors a way to specify additional location data types for non-GUI processors to determine the semantic meanings of a location field.
This proposal addresses the following requirements:
The root element for geolocation data is <geoloc/> as defined in User Geolocation (XEP-0080) [4]. The information is structured by means of a <geoloc/> element that is qualified by the 'http://jabber.org/protocol/geoloc' namespace. The <geo/> element MUST be contained within a <field/> element qualified by the 'jabber:x:data' namespace.
The following example is provided only for the purpose of illustration; consult the specifications for using protocols (e.g., XEP-0080) to see canonical examples.
<x xmlns='jabber:x:data' type='form'> [ ... ] <field var='location'> <geoloc xmlns="http://jabber.org/protocol/geoloc"> <text>Venice, Italy</text> <locality>Venice</locality> <country>Italy</country> <lat>45.44</lat> <lon>12.33</lon> </geoloc> </field> [ ... ] </x>
All elements associated with location fields MUST be qualified by the 'http://jabber.org/protocol/geoloc' namespace. The use of namespace prefixes is RECOMMENDED for large forms, to reduce the data size. To maintain the highest level of compatibility, implementations sending the form using prefixes SHOULD use the namespace prefix "geo:", and SHOULD declare the namespace prefix mapping in the ancestor <x xmlns='jabber:x:data'/> element:
The following example is provided only for the purpose of illustration; consult the specifications for using protocols (e.g. XEP-0080, XEP-0122) to see canonical examples.
<x xmlns='jabber:x:data' xmlns:geo= http://jabber.org/protocol/geoloc' xmlns:xdv='http://jabber.org/protocols/xdata-validate' type='form'> <title>Sample Location Form</title> <instructions> Please provide information for the following location fields... </instructions> <field type='text-single' var='name' label='Event Name'/> <field type='text-single' var='time' label='Event Date/Time'> <xdv:validate datatype='xs:dateTime'> <basic/> </xdv:validate> </field> <field type='text-single' var='latitude' label='Latitude'> <xdv:validate datatype='geo:lat'> <basic/> </xdv:validate> </field> <field type='text-single' var='longitude' label='Longitude'> <xdv:validate datatype='geo:lon'> <basic/> </xdv:validate> </field> </x>
The integration with Data Forms is accomplished via the datatypes specified in Data Forms Validation (XEP-0122) [5]. Each datatype is specific to the profile desired. The sender MUST use the 'geo:' datatypes as specified in XEP-0122. When submitting a form, a field's value(s) MUST be validated by the receiving entity based on the 'geo:' datatype identifier(s). Also, the submitter MUST provide a 'geo:' element for each location element within the data form. If a form-submitting entity receives a field type it does not understand, the 'text-single' field type from XEP-0004 MUST be assumed.
It is imperative to control access to location information, at least by default. Imagine that a stalker got unauthorized access to this information, with enough accuracy and timeliness to be able to find the target person. This scenario could lead to loss of life, so please take access control checks seriously. If an error is deliberately added to a location, the error SHOULD be the same for all receivers, to minimize the likelihood of triangulation. In the case of deliberate error, the <accuracy /> element SHOULD NOT be included.
This document requires no interaction with the the Internet Assigned Numbers Authority (IANA) [6].
The XMPP Registrar [3] already includes 'http://jabber.org/protocol/geoloc' in its registry of protocol namespaces (see <https://xmpp.org/registrar/namespaces.html>).
The XMPP Registrar includes 'geo:' in its registry of Data Forms Validation Datatype Prefixes.
Normally, each geographic format that wishes to be considered for use with Data Forms MUST register its own datatype qualified by the "geo:" prefix. However, this document provides an initial seed, based on the currently assumed formats. The following datatypes shall be registered for use with Data Forms Validation:
<datatype> <name>geo:lat</name> <desc>Datatype for publishing the latitude of a geographic location</desc> <doc>XEP-0080</doc> </datatype>
<field type='text-single' var='latitude' label='Latitude'> <xdv:validate datatype='geo:lat'> <range min='-90' max='90'/> </xdv:validate> <value>45.44</value> </field>
<datatype> <name>geo:lon</name> <desc>Datatype for publishing the longitude of a geographic location</desc> <doc>XEP-0080</doc> </datatype>
<field type='text-single' var='longitude' label='Longitude'> <xdv:validate datatype='geo:lon'> <range min='-180' max='180'/> </xdv:validate> <value>12.33</value> </field>
The XMPP Registrar MAY include 'geo:' datatypes in its registry of Data Forms Validation Datatypes, which can be used with the 'text-single' field type from XEP-0004.
<datatype> <name>geo:dms</name> <desc>Datatype for publishing a degrees, minutes, and seconds (DMS) location</desc> <doc>Degree Minutes and Seconds, 'http://en.wikipedia.org/wiki/Geographic_coordinate_system'.</doc> </datatype>
<field type='text-single' var='dms_location'> <xdv:validate datatype='geo:dms'/> <regex>([-|\\+]?\\d{1,3}[d|D|\u00B0|\\s](\\s*\\d{1,2}['|\u2019|\\s])?(\\s*\\d{1,2}[\"|\u201d])?\\s*[N|n|S|s]?)?(\\s*|,|,\\s*)?([-|\\+]?\\d+?(\\.\\d+?)??\\s*[E|e|W|w]??)</regex> </xdv:validate> <value>52d18'24.4775"N 0d52'44.0625"W</value> </field>
<datatype> <name>geo:mgrs</name> <desc>Datatype for publishing a MGRS location</desc> <doc>Military Grid Reference System, 'http://en.wikipedia.org/wiki/Military_grid_reference_system'.</doc> </datatype>
<field type='text-single' var='mgrs_location'> <xdv:validate datatype='geo:mgrs'/> <regex>\\d{1,2}[A-Za-z]\\s*[A-Za-z]{2}\\s*\\d{1,5}\\s*\\d{1,5}</regex> </xdv:validate> <value>38SMB4484</value> </field>
As this document only defines semantics for existing protocol, additional schemas are not required.
Series: XEP
Number: 0350
Publisher: XMPP Standards Foundation
Status:
Experimental
Type:
Standards Track
Version: 0.1
Last Updated: 2014-07-03
Approving Body: XMPP Council
Dependencies: XMPP Core, XEP-0004, XEP-0080, XEP-0122
Supersedes: None
Superseded By: None
Short Name: geolocation-element
Schema: <http://www.xmpp.org/schemas/geolocation-element.xsd>
Source Control:
HTML
This document in other formats:
XML
PDF
Email:
laukner@gmail.com
JabberID:
laukner@jabber.org
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards 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 document 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 primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.
Discussion on other xmpp.org discussion lists might also be appropriate; see <http://xmpp.org/about/discuss.shtml> for a complete list.
Errata can be sent to <editor@xmpp.org>.
The following requirements 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".
1. XEP-0004: Data Forms <https://xmpp.org/extensions/xep-0004.html>.
2. XEP-0346: Form Discovery and Publishing <https://xmpp.org/extensions/xep-0346.html>.
3. The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see <https://xmpp.org/registrar/>.
4. XEP-0080: User Geolocation <https://xmpp.org/extensions/xep-0080.html>.
5. XEP-0122: Data Forms Validation <https://xmpp.org/extensions/xep-0122.html>.
6. 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/>.
Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/
Initial published version approved by the XMPP Council.
(editor (mam))Updated version, added 'geo:' datatypes to support 'text-single' use case.
(ml)Updated version, added XEP-0122 'geo:' datatypes.
(ml)Initial version, borrowing from XEP-0221.
(ml)END