SIMPLE WG J. Urpalainen Internet-Draft Nokia Intended status: Informational March 5, 2007 Expires: September 6, 2007 Combined Presence Schemas Utilizing RELAX NG draft-urpalainen-simple-presence-relaxng-03 Status of this Memo By submitting this Internet-Draft, each author represents that any applicable patent or other IPR claims of which he or she is aware have been or will be disclosed, and any of which he or she becomes aware will be disclosed, in accordance with Section 6 of BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet- Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt. The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html. This Internet-Draft will expire on September 6, 2007. Copyright Notice Copyright (C) The IETF Trust (2007). Abstract This memo describes a batch of Presence Information Data Format (PIDF) and its extension schemas written with the RELAX NG schema language. Unlike with the current W3C XML Schema language it is possible to write reasonable forwards and backwards compatible presence combination schemas. These RELAX NG schemas are stricter than the W3C Schemas and thus the instance documents that validate with these schemas follow the intended content model more closely. Especially, these schemas are targeted to actual implementations in Urpalainen Expires September 6, 2007 [Page 1] Internet-Draft Presence RELAX NG schemas March 2007 order to decrease interoperability problems. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 2. Conventions . . . . . . . . . . . . . . . . . . . . . . . . . 3 3. Overview of the Presence RELAX NG Schemas . . . . . . . . . . 4 4. PIDF schema . . . . . . . . . . . . . . . . . . . . . . . . . 5 5. DataModel schema . . . . . . . . . . . . . . . . . . . . . . . 8 6. RPID schema . . . . . . . . . . . . . . . . . . . . . . . . . 11 7. CIPID schema . . . . . . . . . . . . . . . . . . . . . . . . . 28 8. CAPS schema . . . . . . . . . . . . . . . . . . . . . . . . . 31 9. Location Types schema . . . . . . . . . . . . . . . . . . . . 43 10. Timed Status schema . . . . . . . . . . . . . . . . . . . . . 46 11. An example instance document . . . . . . . . . . . . . . . . . 48 12. Security considerations . . . . . . . . . . . . . . . . . . . 51 13. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 51 14. References . . . . . . . . . . . . . . . . . . . . . . . . . . 51 14.1. Normative references . . . . . . . . . . . . . . . . . . 51 14.2. Informative references . . . . . . . . . . . . . . . . . 52 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 52 Intellectual Property and Copyright Statements . . . . . . . . . . 53 Urpalainen Expires September 6, 2007 [Page 2] Internet-Draft Presence RELAX NG schemas March 2007 1. Introduction Within a Common Presence Profile (CPP) [13] compatible presence system presence data is represented using the Extensible Markup Language (XML) [2] based Presence Information Data Format (PIDF) [6]. The PIDF format describes the baseline of the presence instance documents and currently many extensions have been described: e.g. DataModel [7], RPID [8], CIPID [10], CAPS [12], LocationTypes [11] and TimedStatus [9]. The content model of these XML documents is described primarily with the W3C XML Schema language [3]. While the W3C XML Schema language has an extensive amount of impressive properties, for example the versioning support is still lacking. That is, it is impossible write reasonable forwards and backwards compatible schemas because of the "Unique Particle Attribution" constraint described in Appendix H of the recommendation [3] and because wildcard definitions aren't flexible enough. Therefore, all the presence extension schemas can not extend PIDF so that e.g. positions for the new elements could be defined within the extension schema so that wildcard definitions would still exist. On the contrary, with the RELAX NG [5] schema language it is possible to write a reasonable combination of schemas where the positioning of extensions while retaining wildcard definitions can easily be done. In other words, these RELAX NG schemas are strict about extension positions, it is not possible to put extension elements into "wrong" locations. This memo describes a batch of these schemas which try to be as compatible as possible with the current presence W3C XML schemas. The set includes schemas for PIDF, DataModel, RPID, CIPID, CAPS and LocationTypes. These schemas are more restrictive than the corresponding W3C XML Schemas, i.e. if instance documents validate according to these schemas they should also validate with the W3C XML Schemas, too. These schemas are provided as informative to applications who wish to utilize RELAX NG as a validation tool. 2. Conventions In this document, the key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" are to be interpreted as described in RFC 2119 [1] and indicate requirement levels for compliant implementations. The following terms are used in this document: Urpalainen Expires September 6, 2007 [Page 3] Internet-Draft Presence RELAX NG schemas March 2007 Forwards and backwards compatible schema: Backwards compatibility means that existing instance documents can be used also by updated new consumers and forwards compatibility means that newer instance documents can also be used by existing consumers. Ambiguous schema: A schema is said to be ambiguous when a document may be valid when its contents match multiple different pattern alternatives. Deterministic schema: At each point, when matching an instance document against a schema, the schema processor has at most one possible choice. Wildcards in schemas: In W3C XML Schemas and definitions are wildcards. They can be used to provide extensibility to the XML instance documents. RELAX NG provides a very versatile though somewhat verbose model for wildcards with and rules. 3. Overview of the Presence RELAX NG Schemas All schemas written with the RELAX NG schema language are based on patterns. The W3C Schema datatypes [4] are used to constrain the element and attribute content in these schemas. The model for these schemas is based on the chronological order of appearance of these schemas, i.e. the PIDF schema is the baseline schema and the DataModel schema includes it by adding some extensions. Then the RPID schema includes the DataModel schema and defines new extensions, etc. When an implementation wants to validate an instance document it just has to provide a single schema e.g. a RPID reference to the validator as that schema will include all the others. Extension points, i.e. where wildcards are used in W3C XML Schemas, are described by adding two definitions to these schemas: an extension definition with content and a wildcard definition. The former is added because it is then easy to extend that point by using combine="interleave" rule. The wildcard definition MUST be redefined in extension schemas if deterministic schemas are required. The schemas presented in this memo are deterministic and unambiguous although it is not a general requirement of the RELAX NG schema language. The ability to easily redefine extension points helps when an application does not have any extensions beyond e.g. RPID and DataModel: Urpalainen Expires September 6, 2007 [Page 4] Internet-Draft Presence RELAX NG schemas March 2007 Without touching the PIDF, DataModel or RPID schemas all the wildcard extensions have been practically removed. Similarly, if "rpid.rng" is replaced with "prescaps.rng" and "anyRPID" with "anyCaps" the combined schema will rule out all the wildcard extensions while retaining the other element and attribute definitions within the PIDF, DataModel, RPID, CIPID and CAPS schemas. Wildcards in these RELAX NG schemas do not strictly follow the "##other" namespace rules of the W3C Schema versions. Instead a conservative and simple deterministic model were just chosen where wildcard except rules are redefined by just adding new namespace definitions onto the list. 4. PIDF schema The RELAX NG version of the PIDF [6] schema. Hereafter it is called with "pidf.rng" as if it were represented as an equivalent filesystem object. Urpalainen Expires September 6, 2007 [Page 5] Internet-Draft Presence RELAX NG schemas March 2007 open closed 0(.[0-9]{0,3})?|1(.0{0,3})? Urpalainen Expires September 6, 2007 [Page 6] Internet-Draft Presence RELAX NG schemas March 2007 Urpalainen Expires September 6, 2007 [Page 7] Internet-Draft Presence RELAX NG schemas March 2007 lang This is the only schema that defines a document root element. The "anyPIDF" wildcard definition rules out elements from the PIDF namespace and also elements that don't have any namespace attached. The "PresenceExtension", "StatusExtension" and "TupleExtension" definitions are empty extension points which can be used with combine="interleave" references within the extension schemas. 5. DataModel schema The RELAX NG version of the DataModel [7] schema, "data-model.rng": Urpalainen Expires September 6, 2007 [Page 8] Internet-Draft Presence RELAX NG schemas March 2007 Urpalainen Expires September 6, 2007 [Page 9] Internet-Draft Presence RELAX NG schemas March 2007 Urpalainen Expires September 6, 2007 [Page 10] Internet-Draft Presence RELAX NG schemas March 2007 lang The DataModel schema includes "pidf.rng" and the "anyPIDF" wildcard definition is redefined with "anyDataModel". The "PersonExtension" and "DeviceExtension" definitions are empty extension points. 6. RPID schema The RELAX NG version of the RPID [8] schema, "rpid.rng": Urpalainen Expires September 6, 2007 [Page 12] Internet-Draft Presence RELAX NG schemas March 2007 Urpalainen Expires September 6, 2007 [Page 13] Internet-Draft Presence RELAX NG schemas March 2007 Urpalainen Expires September 6, 2007 [Page 14] Internet-Draft Presence RELAX NG schemas March 2007 Urpalainen Expires September 6, 2007 [Page 15] Internet-Draft Presence RELAX NG schemas March 2007 Urpalainen Expires September 6, 2007 [Page 16] Internet-Draft Presence RELAX NG schemas March 2007 from until id Urpalainen Expires September 6, 2007 [Page 17] Internet-Draft Presence RELAX NG schemas March 2007 Urpalainen Expires September 6, 2007 [Page 18] Internet-Draft Presence RELAX NG schemas March 2007 Urpalainen Expires September 6, 2007 [Page 19] Internet-Draft Presence RELAX NG schemas March 2007 Urpalainen Expires September 6, 2007 [Page 20] Internet-Draft Presence RELAX NG schemas March 2007 Urpalainen Expires September 6, 2007 [Page 21] Internet-Draft Presence RELAX NG schemas March 2007 Urpalainen Expires September 6, 2007 [Page 22] Internet-Draft Presence RELAX NG schemas March 2007 Urpalainen Expires September 6, 2007 [Page 23] Internet-Draft Presence RELAX NG schemas March 2007 Urpalainen Expires September 6, 2007 [Page 24] Internet-Draft Presence RELAX NG schemas March 2007 Urpalainen Expires September 6, 2007 [Page 25] Internet-Draft Presence RELAX NG schemas March 2007 Urpalainen Expires September 6, 2007 [Page 26] Internet-Draft Presence RELAX NG schemas March 2007 description from until id active idle idle-threshold last-input Urpalainen Expires September 6, 2007 [Page 27] Internet-Draft Presence RELAX NG schemas March 2007 id lang The RPID schema includes "data-model.rng" and the "anyDataModel" wildcard definition is redefined with "anyRPID". There are many XXX"Extension" definitions. 7. CIPID schema The RELAX NG version of the CIPID [10] schema, "cipid.rng": Urpalainen Expires September 6, 2007 [Page 29] Internet-Draft Presence RELAX NG schemas March 2007 lang The CIPID schema includes "rpid.rng" and the "anyRPID" wildcard definition is redefined with "anyCIPID". Urpalainen Expires September 6, 2007 [Page 30] Internet-Draft Presence RELAX NG schemas March 2007 8. CAPS schema The RELAX NG version of the CAPS [12] schema, "prescaps.rng": Urpalainen Expires September 6, 2007 [Page 31] Internet-Draft Presence RELAX NG schemas March 2007 Urpalainen Expires September 6, 2007 [Page 32] Internet-Draft Presence RELAX NG schemas March 2007 Urpalainen Expires September 6, 2007 [Page 33] Internet-Draft Presence RELAX NG schemas March 2007 Urpalainen Expires September 6, 2007 [Page 34] Internet-Draft Presence RELAX NG schemas March 2007 Urpalainen Expires September 6, 2007 [Page 35] Internet-Draft Presence RELAX NG schemas March 2007 Urpalainen Expires September 6, 2007 [Page 36] Internet-Draft Presence RELAX NG schemas March 2007 Urpalainen Expires September 6, 2007 [Page 37] Internet-Draft Presence RELAX NG schemas March 2007 Urpalainen Expires September 6, 2007 [Page 38] Internet-Draft Presence RELAX NG schemas March 2007 Urpalainen Expires September 6, 2007 [Page 39] Internet-Draft Presence RELAX NG schemas March 2007 Urpalainen Expires September 6, 2007 [Page 40] Internet-Draft Presence RELAX NG schemas March 2007 Urpalainen Expires September 6, 2007 [Page 41] Internet-Draft Presence RELAX NG schemas March 2007 Urpalainen Expires September 6, 2007 [Page 42] Internet-Draft Presence RELAX NG schemas March 2007 The "anyCIPID" wildcard definition is redefined with "anyCaps". 9. Location Types schema The RELAX NG version of the LocationTypes [11] schema, "lt.rng": Urpalainen Expires September 6, 2007 [Page 43] Internet-Draft Presence RELAX NG schemas March 2007 Urpalainen Expires September 6, 2007 [Page 44] Internet-Draft Presence RELAX NG schemas March 2007 lang Urpalainen Expires September 6, 2007 [Page 45] Internet-Draft Presence RELAX NG schemas March 2007 The "anyCaps" wildcard definition is redefined with "anyLocationTypes". 10. Timed Status schema The RELAX NG version of the TimedStatus [8] schema, "ts.rng": open closed Urpalainen Expires September 6, 2007 [Page 46] Internet-Draft Presence RELAX NG schemas March 2007 lang Urpalainen Expires September 6, 2007 [Page 47] Internet-Draft Presence RELAX NG schemas March 2007 11. An example instance document An example instance document: open urn:device:0003ba4811e3 true Example service 1 Urpalainen Expires September 6, 2007 [Page 48] Internet-Draft Presence RELAX NG schemas March 2007 sip false im:someone@mobile.example.net Don't Disturb Please! Ne derangez pas, s'il vous plait 2001-10-27T16:49:29Z open mailto:secretary@example.com open urn:x-mac:0003ba4811e3 email http://www.example.com/mailbox.png mailto:someone@example.com I'll be in Tokyo next week idle Urpalainen Expires September 6, 2007 [Page 49] Internet-Draft Presence RELAX NG schemas March 2007 urn:device:0003ba4811e3 PC Far away Don't Disturb Please! hoepoen hoepoen calendar bowling league http://www.example.com/playing.gif -240 http://example.com/~someone/card.vcd http://example.com/~someone http://example.com/~someone/icon.gif http://example.com/~someone/gml-map.xml http://example.com/~someone/whoosh.wav 2005-05-30T16:09:44+05:00 This instance document can be validated with the described PIDF, PIDF+DataModel, PIDF+DataModel+RPID, PIDF+DataModel+RPID+CIPID, PIDF+ DataModel+RPID+CIPID+CAPS, PIDF+DataModel+RPID+CIPID+CAPS+ LocationTypes or PIDF+DataModel+RPID+CIPID+CAPS+LocationTypes+ TimedStatus schemas. The wildcard definitions can be disabled when using e.g. the CAPS schema as there are no "private" extensions. Likewise a simple basic PIDF instance document can be validated with all of these schema combinations. This shows how forwards and backwards compatible schemas work in practice, only the level of scrutiny changes. Urpalainen Expires September 6, 2007 [Page 50] Internet-Draft Presence RELAX NG schemas March 2007 It is worth noting that the ordering of the extension child elements of the element can interchange. This applies to the element extensions as well. The "interleave" definition allows unordered content. 12. Security considerations Information transported within these documents can be highly sensitive. All the security considerations described in PIDF and extension documents applies to this as well. 13. Acknowledgments The author would like to thank Aki Niemi, Pekka Pessi and Eva-Maria Leppanen for their valuable comments. 14. References 14.1. Normative references [1] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [2] "Extensible Markup Language (XML) 1.0 (Fourth Edition)", W3C Recommendation REC-xml-20060816 , August 2006. [3] "XML Schema Part 1: Structures Second Edition", W3C Recommendation REC-xmlschema-1-20041028 , October 2004. [4] "XML Schema Part 2: Datatypes Second Edition", W3C Recommendation PER-xmlschema-2-20040318 , October 2004. [5] "RELAX NG Specification", Committee Specification 3 , December 2001. [6] Sugano, H., "CPIM presence information data format", RFC 3863, May 2003. [7] Rosenberg, J., "A Data Model for Presence", RFC 4479, July 2006. [8] Schulzrinne, H., Gurbani, V., Kyzivat, P., and J. Rosenberg, "RPID: Rich Presence Extensions to the Presence Information Data Format (PIDF)", RFC 4480, December 2005. Urpalainen Expires September 6, 2007 [Page 51] Internet-Draft Presence RELAX NG schemas March 2007 [9] Schulzrinne, H., "Timed Presence Extensions to the Presence Information Data Format (PIDF) to Indicate Status Information for Past and Future Time Intervals", RFC 4481, July 2006. [10] Schulzrinne, H., "CIPID: Contact Information in Presence Information Data Format", RFC 4482, July 2006. [11] Schulzrinne, H. and H. Tschofenig, "Location Types Registry", RFC 4589, July 2006. [12] Lonnfors, M. and K. Kiss, "User Agent Capability Extension to Presence Information Data Format (PIDF)", draft-ietf-simple-prescaps-ext-06 (work in progress), January 2006. 14.2. Informative references [13] Peterson, J., "Common Profile for Presence (CPP)", RFC 3859. Author's Address Jari Urpalainen Nokia Itamerenkatu 11-13 Helsinki 00180 Finland Phone: +358 7180 37686 Email: jari.urpalainen@nokia.com Urpalainen Expires September 6, 2007 [Page 52] Internet-Draft Presence RELAX NG schemas March 2007 Full Copyright Statement Copyright (C) The IETF Trust (2007). This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights. This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Intellectual Property The IETF takes no position regarding the validity or scope of any Intellectual Property Rights or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; nor does it represent that it has made any independent effort to identify any such rights. Information on the procedures with respect to rights in RFC documents can be found in BCP 78 and BCP 79. Copies of IPR disclosures made to the IETF Secretariat and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this specification can be obtained from the IETF on-line IPR repository at http://www.ietf.org/ipr. The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology that may be required to implement this standard. Please address the information to the IETF at ietf-ipr@ietf.org. Acknowledgment Funding for the RFC Editor function is provided by the IETF Administrative Support Activity (IASA). Urpalainen Expires September 6, 2007 [Page 53]