No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xep-0350.xml 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE xep SYSTEM 'xep.dtd' [
  3. <!ENTITY % ents SYSTEM 'xep.ent'>
  4. %ents;
  5. ]>
  6. <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
  7. <xep>
  8. <header>
  9. <title>Data Forms Geolocation Element</title>
  10. <abstract>This specification defines an XMPP protocol extension for including geolocation data in XEP-0004 data forms.</abstract>
  11. &LEGALNOTICE;
  12. <number>0350</number>
  13. <status>Deferred</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <dependencies>
  17. <spec>XMPP Core</spec>
  18. <spec>XEP-0004</spec>
  19. <spec>XEP-0080</spec>
  20. <spec>XEP-0122</spec>
  21. </dependencies>
  22. <supersedes/>
  23. <supersededby/>
  24. <shortname>geolocation-element</shortname>
  25. <schemaloc>
  26. <url>http://www.xmpp.org/schemas/geolocation-element.xsd</url>
  27. </schemaloc>
  28. <author>
  29. <firstname>Michael</firstname>
  30. <surname>Laukner</surname>
  31. <email>laukner@gmail.com</email>
  32. <jid>laukner@jabber.org</jid>
  33. </author>
  34. <revision>
  35. <version>0.2</version>
  36. <date>2017-09-11</date>
  37. <initials>XEP Editor (jwi)</initials>
  38. <remark>Defer due to lack of activity.</remark>
  39. </revision>
  40. <revision>
  41. <version>0.1</version>
  42. <date>2014-07-03</date>
  43. <initials>editor (mam)</initials>
  44. <remark>
  45. <p>Initial published version approved by the XMPP Council.</p>
  46. </remark>
  47. </revision>
  48. <revision>
  49. <version>0.0.3</version>
  50. <date>2014-06-28</date>
  51. <initials>ml</initials>
  52. <remark>
  53. <p>Updated version, added 'geo:' datatypes to support 'text-single' use case.</p>
  54. </remark>
  55. </revision>
  56. <revision>
  57. <version>0.0.2</version>
  58. <date>2014-06-25</date>
  59. <initials>ml</initials>
  60. <remark>
  61. <p>Updated version, added XEP-0122 'geo:' datatypes.</p>
  62. </remark>
  63. </revision>
  64. <revision>
  65. <version>0.0.1</version>
  66. <date>2014-06-11</date>
  67. <initials>ml</initials>
  68. <remark>
  69. <p>Initial version, borrowing from XEP-0221.</p>
  70. </remark>
  71. </revision>
  72. </header>
  73. <section1 topic='Introduction' anchor='intro'>
  74. <p>In certain protocols that make use of &xep0004;, it can be helpful to include geolocation data. One example of such a "using protocol" is &xep0346;. This document defines a method for including geolocation data in a <cite>Data Form</cite> for something you manage and want to publish. This XEP leaves it open to developers how such a &lt;geoloc/&gt; form element will be rendered; possibilities might include editing Latitude and Longitude manually or through a rendered map.</p>
  75. <p>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 &REGISTRAR; 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.</p>
  76. </section1>
  77. <section1 topic='Requirements' anchor='requirements'>
  78. <p>This proposal addresses the following requirements:</p>
  79. <ul>
  80. <li>Integrate geolocation data with XEP-0004.</li>
  81. <li>Allow a potential receiver (rather than the sender) to validate geolocation data.</li>
  82. </ul>
  83. </section1>
  84. <section1 topic='Integrate Geolocation Element with XEP-0004' anchor='geolocation'>
  85. <p>The root element for geolocation data is &lt;geoloc/&gt; as defined in &xep0080;. The information is structured by means of a &lt;geoloc/&gt; element that is qualified by the 'http://jabber.org/protocol/geoloc' namespace. The &lt;geo/&gt; element MUST be contained within a &lt;field/&gt; element qualified by the 'jabber:x:data' namespace.</p>
  86. <p>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.</p>
  87. <example caption='Inclusion in Data Form'><![CDATA[<x xmlns='jabber:x:data' type='form'>
  88. [ ... ]
  89. <field var='location'>
  90. <geoloc xmlns="http://jabber.org/protocol/geoloc">
  91. <text>Venice, Italy</text>
  92. <locality>Venice</locality>
  93. <country>Italy</country>
  94. <lat>45.44</lat>
  95. <lon>12.33</lon>
  96. </geoloc>
  97. </field>
  98. [ ... ]
  99. </x>]]></example>
  100. </section1>
  101. <section1 topic='Allow Receiver to Valdidate Geolocation Data' anchor='validation'>
  102. <p>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 &lt;x xmlns='jabber:x:data'/&gt; element:</p>
  103. <p>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.</p>
  104. <example caption='Validation of Geolocation Data'><![CDATA[<x xmlns='jabber:x:data'
  105. xmlns:geo= http://jabber.org/protocol/geoloc'
  106. xmlns:xdv='http://jabber.org/protocols/xdata-validate'
  107. type='form'>
  108. <title>Sample Location Form</title>
  109. <instructions>
  110. Please provide information for the following location fields...
  111. </instructions>
  112. <field type='text-single' var='name' label='Event Name'/>
  113. <field type='text-single' var='time' label='Event Date/Time'>
  114. <xdv:validate datatype='xs:dateTime'>
  115. <basic/>
  116. </xdv:validate>
  117. </field>
  118. <field type='text-single' var='latitude' label='Latitude'>
  119. <xdv:validate datatype='geo:lat'>
  120. <basic/>
  121. </xdv:validate>
  122. </field>
  123. <field type='text-single' var='longitude' label='Longitude'>
  124. <xdv:validate datatype='geo:lon'>
  125. <basic/>
  126. </xdv:validate>
  127. </field>
  128. </x>]]></example>
  129. <section2 topic='Location Datatypes for Data Forms' anchor='location_fields'>
  130. <p>The integration with Data Forms is accomplished via the datatypes specified in &xep0122;. 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.</p>
  131. </section2>
  132. </section1>
  133. <section1 topic='Security Considerations' anchor='security'>
  134. <p>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 &lt;accuracy /> element SHOULD NOT be included.</p>
  135. </section1>
  136. <section1 topic='IANA Considerations' anchor='iana'>
  137. <p>This document requires no interaction with the &IANA;.</p>
  138. </section1>
  139. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  140. <section2 topic='Protocol Namespaces' anchor='ns'>
  141. <p>
  142. The &REGISTRAR; already includes 'http://jabber.org/protocol/geoloc' in its registry of protocol namespaces (see &NAMESPACES;).
  143. </p>
  144. </section2>
  145. <section2 topic='Location Fields and Data Form Validation Datatypes' anchor='registrar.geo.xep'>
  146. <p>The XMPP Registrar includes 'geo:' in its registry of Data Forms Validation Datatype Prefixes.</p>
  147. <p>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:</p>
  148. <code caption='Latitude Validation Datatype Registry Submission'><![CDATA[
  149. <datatype>
  150. <name>geo:lat</name>
  151. <desc>Datatype for publishing the latitude of a geographic location</desc>
  152. <doc>XEP-0080</doc>
  153. </datatype>
  154. ]]></code>
  155. <example caption='Validation of a XEP-0080 Latitude Field'><![CDATA[
  156. <field type='text-single' var='latitude' label='Latitude'>
  157. <xdv:validate datatype='geo:lat'>
  158. <range min='-90'
  159. max='90'/>
  160. </xdv:validate>
  161. <value>45.44</value>
  162. </field>]]></example>
  163. <code caption='Longitude Validation Datatype Registry Submission'><![CDATA[
  164. <datatype>
  165. <name>geo:lon</name>
  166. <desc>Datatype for publishing the longitude of a geographic location</desc>
  167. <doc>XEP-0080</doc>
  168. </datatype>
  169. ]]></code>
  170. <example caption='Validation of XEP-0080 Longitude Field'><![CDATA[
  171. <field type='text-single' var='longitude' label='Longitude'>
  172. <xdv:validate datatype='geo:lon'>
  173. <range min='-180'
  174. max='180'/>
  175. </xdv:validate>
  176. <value>12.33</value>
  177. </field>]]></example>
  178. </section2>
  179. <section2 topic='Text Field and Data Form Validation Datatypes' anchor='registrar.geo.text'>
  180. <p>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.</p>
  181. <code caption='DMS Data Forms Validation Datatype Registry Submission'><![CDATA[
  182. <datatype>
  183. <name>geo:dms</name>
  184. <desc>Datatype for publishing a degrees, minutes, and seconds (DMS) location</desc>
  185. <doc>Degree Minutes and Seconds, 'http://en.wikipedia.org/wiki/Geographic_coordinate_system'.</doc>
  186. </datatype>
  187. ]]></code>
  188. <example caption='Validation of a DMS Location Field'><![CDATA[
  189. <field type='text-single' var='dms_location'>
  190. <xdv:validate datatype='geo:dms'/>
  191. <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>
  192. </xdv:validate>
  193. <value>52d18'24.4775"N 0d52'44.0625"W</value>
  194. </field>]]></example>
  195. <code caption='MGRS Data Forms Validation Datatype Registry Submission'><![CDATA[
  196. <datatype>
  197. <name>geo:mgrs</name>
  198. <desc>Datatype for publishing a MGRS location</desc>
  199. <doc>Military Grid Reference System, 'http://en.wikipedia.org/wiki/Military_grid_reference_system'.</doc>
  200. </datatype>
  201. ]]></code>
  202. <example caption='Validation of a MGRS Location Field'><![CDATA[
  203. <field type='text-single' var='mgrs_location'>
  204. <xdv:validate datatype='geo:mgrs'/>
  205. <regex>\\d{1,2}[A-Za-z]\\s*[A-Za-z]{2}\\s*\\d{1,5}\\s*\\d{1,5}</regex>
  206. </xdv:validate>
  207. <value>38SMB4484</value>
  208. </field>]]></example>
  209. </section2>
  210. </section1>
  211. <section1 topic='XML Schema' anchor='schema'>
  212. <p>As this document only defines semantics for existing protocol, additional schemas are not required.</p>
  213. </section1>
  214. </xep>