SIMPLE WG J. Urpalainen Internet-Draft Nokia Intended status: Informational October 9, 2008 Expires: April 12, 2009 Combined Presence Schemas Utilizing RELAX NG draft-urpalainen-simple-presence-relaxng-05 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 April 12, 2009. 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 order to decrease interoperability problems. Urpalainen Expires April 12, 2009 [Page 1] Internet-Draft Presence RELAX NG schemas October 2008 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 . . . . . . . . . . . . . . . . . . . . . . . . . 27 8. CAPS schema . . . . . . . . . . . . . . . . . . . . . . . . . 29 9. Location Types schema . . . . . . . . . . . . . . . . . . . . 41 10. Timed Status schema . . . . . . . . . . . . . . . . . . . . . 44 11. An example instance document . . . . . . . . . . . . . . . . . 45 12. Security considerations . . . . . . . . . . . . . . . . . . . 48 13. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 48 14. References . . . . . . . . . . . . . . . . . . . . . . . . . . 49 14.1. Normative references . . . . . . . . . . . . . . . . . . 49 14.2. Informative references . . . . . . . . . . . . . . . . . 50 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 50 Intellectual Property and Copyright Statements . . . . . . . . . . 51 Urpalainen Expires April 12, 2009 [Page 2] Internet-Draft Presence RELAX NG schemas October 2008 1. Introduction Within a Common Presence Profile (CPP) [RFC3859] compatible presence system presence data is represented using the Extensible Markup Language (XML) [W3C.REC-xml-20060816] based Presence Information Data Format (PIDF) [RFC3863]. The PIDF format describes the baseline of the presence instance documents and currently many extensions have been described: e.g. DataModel [RFC4479], RPID [RFC4480], CIPID [RFC4482], CAPS [RFC5196], LocationTypes [RFC4589] and TimedStatus [RFC4481]. The content model of these XML documents is described primarily with the W3C XML Schema language [W3C.REC-xmlschema-1-20041028]. 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 [W3C.REC-xmlschema-1-20041028] 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 [relaxng] 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 [RFC2119] and indicate requirement levels for compliant implementations. The following terms are used in this document: Urpalainen Expires April 12, 2009 [Page 3] Internet-Draft Presence RELAX NG schemas October 2008 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 the 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 [W3C.REC-xmlschema-2-20041028] are used to constrain the element and attribute content in these schemas. The model for these schemas is based on the approximate 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 other schemas. Extension points, i.e. where wildcards are used in W3C XML Schemas, are described by adding a similar extension definition which can be extended by using the combine="interleave" pattern rule. The wildcard definition MUST be redefined in extension schemas since name classes MUST NOT overlap with the interleave pattern. The schemas presented in this memo are thus deterministic and unambiguous although it is not a general requirement of the RELAX NG schema language. The ability to easily redefine extension points can help to detect implementation errors when an application does not have any extensions beyond e.g. RPID and DataModel elements: Urpalainen Expires April 12, 2009 [Page 4] Internet-Draft Presence RELAX NG schemas October 2008 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 a new namespace definitions onto the new list. 4. PIDF schema The RELAX NG version of the PIDF [RFC3863] schema. Hereafter it is called with "pidf.rng" as if it were represented as an equivalent filesystem object. Urpalainen Expires April 12, 2009 [Page 5] Internet-Draft Presence RELAX NG schemas October 2008 open closed 0(.[0-9]{0,3})?|1(.0{0,3})? Urpalainen Expires April 12, 2009 [Page 6] Internet-Draft Presence RELAX NG schemas October 2008 Urpalainen Expires April 12, 2009 [Page 7] Internet-Draft Presence RELAX NG schemas October 2008 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 unqualified elements. The "PresenceExtension", "StatusExtension" and "TupleExtension" definitions are extension points which can be extended by new element definitions with the combine="interleave" pattern. 5. DataModel schema The RELAX NG version of the DataModel [RFC4479] schema, "data- model.rng": Urpalainen Expires April 12, 2009 [Page 8] Internet-Draft Presence RELAX NG schemas October 2008 Urpalainen Expires April 12, 2009 [Page 9] Internet-Draft Presence RELAX NG schemas October 2008 Urpalainen Expires April 12, 2009 [Page 10] Internet-Draft Presence RELAX NG schemas October 2008 lang The DataModel schema includes "pidf.rng" and the "anyPIDF" wildcard definition is redefined with "anyDataModel". The "PersonExtension" and "DeviceExtension" definitions are DataModel extension points. 6. RPID schema The RELAX NG version of the RPID [RFC4480] schema, "rpid.rng": Urpalainen Expires April 12, 2009 [Page 11] Internet-Draft Presence RELAX NG schemas October 2008 Urpalainen Expires April 12, 2009 [Page 12] Internet-Draft Presence RELAX NG schemas October 2008 Urpalainen Expires April 12, 2009 [Page 13] Internet-Draft Presence RELAX NG schemas October 2008 Urpalainen Expires April 12, 2009 [Page 14] Internet-Draft Presence RELAX NG schemas October 2008 Urpalainen Expires April 12, 2009 [Page 15] Internet-Draft Presence RELAX NG schemas October 2008 from until id Urpalainen Expires April 12, 2009 [Page 16] Internet-Draft Presence RELAX NG schemas October 2008 Urpalainen Expires April 12, 2009 [Page 17] Internet-Draft Presence RELAX NG schemas October 2008 Urpalainen Expires April 12, 2009 [Page 18] Internet-Draft Presence RELAX NG schemas October 2008 Urpalainen Expires April 12, 2009 [Page 19] Internet-Draft Presence RELAX NG schemas October 2008 Urpalainen Expires April 12, 2009 [Page 20] Internet-Draft Presence RELAX NG schemas October 2008 Urpalainen Expires April 12, 2009 [Page 21] Internet-Draft Presence RELAX NG schemas October 2008 Urpalainen Expires April 12, 2009 [Page 22] Internet-Draft Presence RELAX NG schemas October 2008 Urpalainen Expires April 12, 2009 [Page 23] Internet-Draft Presence RELAX NG schemas October 2008 Urpalainen Expires April 12, 2009 [Page 24] Internet-Draft Presence RELAX NG schemas October 2008 description from Urpalainen Expires April 12, 2009 [Page 25] Internet-Draft Presence RELAX NG schemas October 2008 until id active idle idle-threshold last-input id Urpalainen Expires April 12, 2009 [Page 26] Internet-Draft Presence RELAX NG schemas October 2008 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 [RFC4482] schema, "cipid.rng": Urpalainen Expires April 12, 2009 [Page 27] Internet-Draft Presence RELAX NG schemas October 2008 lang Urpalainen Expires April 12, 2009 [Page 28] Internet-Draft Presence RELAX NG schemas October 2008 The CIPID schema includes "rpid.rng" and the "anyRPID" wildcard definition is redefined with "anyCIPID". 8. CAPS schema The RELAX NG version of the CAPS [RFC5196] schema, "prescaps.rng": Urpalainen Expires April 12, 2009 [Page 29] Internet-Draft Presence RELAX NG schemas October 2008 lang Urpalainen Expires April 12, 2009 [Page 30] Internet-Draft Presence RELAX NG schemas October 2008 Urpalainen Expires April 12, 2009 [Page 31] Internet-Draft Presence RELAX NG schemas October 2008 Urpalainen Expires April 12, 2009 [Page 32] Internet-Draft Presence RELAX NG schemas October 2008 Urpalainen Expires April 12, 2009 [Page 33] Internet-Draft Presence RELAX NG schemas October 2008 Urpalainen Expires April 12, 2009 [Page 34] Internet-Draft Presence RELAX NG schemas October 2008 Urpalainen Expires April 12, 2009 [Page 35] Internet-Draft Presence RELAX NG schemas October 2008 Urpalainen Expires April 12, 2009 [Page 36] Internet-Draft Presence RELAX NG schemas October 2008 Urpalainen Expires April 12, 2009 [Page 37] Internet-Draft Presence RELAX NG schemas October 2008 Urpalainen Expires April 12, 2009 [Page 38] Internet-Draft Presence RELAX NG schemas October 2008 Urpalainen Expires April 12, 2009 [Page 39] Internet-Draft Presence RELAX NG schemas October 2008 Urpalainen Expires April 12, 2009 [Page 40] Internet-Draft Presence RELAX NG schemas October 2008 The "anyCIPID" wildcard definition is redefined with "anyCaps". 9. Location Types schema The RELAX NG version of the LocationTypes [RFC4589] schema, "lt.rng": Urpalainen Expires April 12, 2009 [Page 41] Internet-Draft Presence RELAX NG schemas October 2008 Urpalainen Expires April 12, 2009 [Page 42] Internet-Draft Presence RELAX NG schemas October 2008 lang The "anyCaps" wildcard definition is redefined with "anyLocationTypes". Urpalainen Expires April 12, 2009 [Page 43] Internet-Draft Presence RELAX NG schemas October 2008 10. Timed Status schema The RELAX NG version of the TimedStatus [RFC4480] schema, "ts.rng": open closed lang Urpalainen Expires April 12, 2009 [Page 44] Internet-Draft Presence RELAX NG schemas October 2008 11. An example instance document An example instance document: Urpalainen Expires April 12, 2009 [Page 45] Internet-Draft Presence RELAX NG schemas October 2008 open urn:device:0003ba4811e3 true Example service 1 sip false im:someone@mobile.example.net Don't Disturb Please! Ne derangez pas, s'il vous plait 2001-10-27T16:49:29Z open Urpalainen Expires April 12, 2009 [Page 46] Internet-Draft Presence RELAX NG schemas October 2008 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 urn:device:0003ba4811e3 PC Far away Don't Disturb Please! hoepoen hoepoen calendar Urpalainen Expires April 12, 2009 [Page 47] Internet-Draft Presence RELAX NG schemas October 2008 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. 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 Urpalainen Expires April 12, 2009 [Page 48] Internet-Draft Presence RELAX NG schemas October 2008 14.1. Normative references [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [W3C.REC-xml-20060816] Maler, E., Paoli, J., Bray, T., Yergeau, F., and C. Sperberg-McQueen, "Extensible Markup Language (XML) 1.0 (Fourth Edition)", World Wide Web Consortium Recommendation REC-xml-20060816, August 2006, . [W3C.REC-xmlschema-1-20041028] Beech, D., Thompson, H., Maloney, M., and N. Mendelsohn, "XML Schema Part 1: Structures Second Edition", World Wide Web Consortium Recommendation REC-xmlschema-1-20041028, October 2004, . [W3C.REC-xmlschema-2-20041028] Malhotra, A. and P. Biron, "XML Schema Part 2: Datatypes Second Edition", World Wide Web Consortium Recommendation REC-xmlschema-2-20041028, October 2004, . [relaxng] "RELAX NG Specification", Committee Specification 3 , December 2001. [RFC3863] Sugano, H., Fujimoto, S., Klyne, G., Bateman, A., Carr, W., and J. Peterson, "Presence Information Data Format (PIDF)", RFC 3863, August 2004. [RFC4479] Rosenberg, J., "A Data Model for Presence", RFC 4479, July 2006. [RFC4480] Schulzrinne, H., Gurbani, V., Kyzivat, P., and J. Rosenberg, "RPID: Rich Presence Extensions to the Presence Information Data Format (PIDF)", RFC 4480, July 2006. [RFC4481] 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. [RFC4482] Schulzrinne, H., "CIPID: Contact Information for the Presence Information Data Format", RFC 4482, July 2006. [RFC4589] Schulzrinne, H. and H. Tschofenig, "Location Types Urpalainen Expires April 12, 2009 [Page 49] Internet-Draft Presence RELAX NG schemas October 2008 Registry", RFC 4589, July 2006. [RFC5196] Lonnfors, M. and K. Kiss, "Session Initiation Protocol (SIP) User Agent Capability Extension to Presence Information Data Format (PIDF)", RFC 5196, September 2008. 14.2. Informative references [RFC3859] Peterson, J., "Common Profile for Presence (CPP)", RFC 3859, August 2004. Author's Address Jari Urpalainen Nokia Itamerenkatu 11-13 Helsinki 00180 Finland Phone: +358 7180 37686 Email: jari.urpalainen@nokia.com Urpalainen Expires April 12, 2009 [Page 50] Internet-Draft Presence RELAX NG schemas October 2008 Full Copyright Statement Copyright (C) The IETF Trust (2008). 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. Urpalainen Expires April 12, 2009 [Page 51]