SIMPLE WG J. Urpalainen Internet-Draft Nokia Research Center Expires: January 16, 2006 July 15, 2005 Combined Presence Schemas Utilizing RELAX NG draft-urpalainen-simple-presence-relaxng-00 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 January 16, 2006. Copyright Notice Copyright (C) The Internet Society (2005). Abstract This memo describes a batch of Presence Information Data Format (PIDF) and its extension schemas written with the RELAX NG schema language. With the current W3C XML Schema language it is impossible to write forward and backward compatible presence combination schemas because of lacking versioning support. These RELAX NG combination 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 Urpalainen Expires January 16, 2006 [Page 1] Internet-Draft Presence RELAX NG schemas July 2005 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 . . . . . . . . . . . . . . . . . . . . . . . . 29 8. Devcaps schema . . . . . . . . . . . . . . . . . . . . . . . 31 9. Servcaps schema . . . . . . . . . . . . . . . . . . . . . . 34 10. An example instance document . . . . . . . . . . . . . . . . 44 11. Security considerations . . . . . . . . . . . . . . . . . . 47 12. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . 47 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 47 13.1 Normative references . . . . . . . . . . . . . . . . . . 47 13.2 Informative references . . . . . . . . . . . . . . . . . 48 Author's Address . . . . . . . . . . . . . . . . . . . . . . 48 Intellectual Property and Copyright Statements . . . . . . . 50 Urpalainen Expires January 16, 2006 [Page 2] Internet-Draft Presence RELAX NG schemas July 2005 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) [8]. The PIDF format describes the baseline of the instance documents and currently many extensions to it are being described: e.g. DataModel [9], RPID [10], CIPID [11] and CAPS [12]. The content model of these XML documents is described primarily by the W3C XML Schemas [5]. 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 forward and backward compatible schemas because of the "Unique Particle Attribution" constraint described in Appendix H of the recommendation [5] and because wildcard definitions aren't flexible enough. Therefore, all the presence extension documents 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. The W3C XML Schema Working Group is going to fix this versioning issue in the upcoming 1.1 version. Until that happens implementations can utilize RELAX NG [7] for validations of presence documents once relevant RELAX NG schemas exist. 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 and CAPS. As these schemas are more restrictive than the corresponding W3C XML Schemas, if instance documents validate according to these schemas they should also validate with the W3C XML Schemas too. While it might be tempting to start a dispute whether IETF/SIMPLE should adopt the RELAX NG schemas over the W3C XML Schemas, the purpose is just to produce a reasonable set of schemas which can be used in real implementations, i.e. to decrease interoperability problems. Also full comparisons of these tools are out of the scope of this document. Currently RELAX NG just fits better for this purpose where a reasonable combination of schemas is required, i.e. the positioning of extensions while retaining wildcard definitions can easily be done. 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 January 16, 2006 [Page 3] Internet-Draft Presence RELAX NG schemas July 2005 Forward and backward 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 [6] 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 all the 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. This ordering is somewhat arbitrary as many of these extensions are at this stage "work-in-progress". 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 Urpalainen Expires January 16, 2006 [Page 4] Internet-Draft Presence RELAX NG schemas July 2005 DataModel: Without touching the PIDF, DataModel or RPID schemas all the wildcard extensions have been practically removed. Similarly, if "rpid.rng" is replaced with "devcaps.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. This would be a more important feature if wildcards in these RELAX NG schemas were strictly aligned with the W3C Schema versions, i.e. if they would fully follow the "##other" namespace rule. However, it was not considered worth the effort to define all those different wildcard definitions but instead use this conservative and simple deterministic model 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 [8] schema. Hereafter it is called with "pidf.rng" as if it were represented as an equivalent filesystem object. Urpalainen Expires January 16, 2006 [Page 5] Internet-Draft Presence RELAX NG schemas July 2005 open closed 0(.[0-9]{0,3})?|1(.0{0,3})? Urpalainen Expires January 16, 2006 [Page 6] Internet-Draft Presence RELAX NG schemas July 2005 Urpalainen Expires January 16, 2006 [Page 7] Internet-Draft Presence RELAX NG schemas July 2005 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 [9] schema, "data-model.rng": Urpalainen Expires January 16, 2006 [Page 9] Internet-Draft Presence RELAX NG schemas July 2005 Urpalainen Expires January 16, 2006 [Page 10] Internet-Draft Presence RELAX NG schemas July 2005 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 [10] schema, "rpid.rng": Urpalainen Expires January 16, 2006 [Page 11] Internet-Draft Presence RELAX NG schemas July 2005 Urpalainen Expires January 16, 2006 [Page 12] Internet-Draft Presence RELAX NG schemas July 2005 Urpalainen Expires January 16, 2006 [Page 13] Internet-Draft Presence RELAX NG schemas July 2005 Urpalainen Expires January 16, 2006 [Page 14] Internet-Draft Presence RELAX NG schemas July 2005 Urpalainen Expires January 16, 2006 [Page 15] Internet-Draft Presence RELAX NG schemas July 2005 Urpalainen Expires January 16, 2006 [Page 16] Internet-Draft Presence RELAX NG schemas July 2005 from until id Urpalainen Expires January 16, 2006 [Page 17] Internet-Draft Presence RELAX NG schemas July 2005 Urpalainen Expires January 16, 2006 [Page 18] Internet-Draft Presence RELAX NG schemas July 2005 Urpalainen Expires January 16, 2006 [Page 19] Internet-Draft Presence RELAX NG schemas July 2005 Urpalainen Expires January 16, 2006 [Page 20] Internet-Draft Presence RELAX NG schemas July 2005 Urpalainen Expires January 16, 2006 [Page 21] Internet-Draft Presence RELAX NG schemas July 2005 Urpalainen Expires January 16, 2006 [Page 22] Internet-Draft Presence RELAX NG schemas July 2005 Urpalainen Expires January 16, 2006 [Page 23] Internet-Draft Presence RELAX NG schemas July 2005 Urpalainen Expires January 16, 2006 [Page 24] Internet-Draft Presence RELAX NG schemas July 2005 Urpalainen Expires January 16, 2006 [Page 25] Internet-Draft Presence RELAX NG schemas July 2005 Urpalainen Expires January 16, 2006 [Page 26] Internet-Draft Presence RELAX NG schemas July 2005 description from until id Urpalainen Expires January 16, 2006 [Page 27] Internet-Draft Presence RELAX NG schemas July 2005 active idle idle-threshold last-input id Urpalainen Expires January 16, 2006 [Page 28] Internet-Draft Presence RELAX NG schemas July 2005 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 [11] schema, "cipid.rng": Urpalainen Expires January 16, 2006 [Page 29] Internet-Draft Presence RELAX NG schemas July 2005 Urpalainen Expires January 16, 2006 [Page 30] Internet-Draft Presence RELAX NG schemas July 2005 The CIPID schema includes "rpid.rng" and the "anyRPID" wildcard definition is redefined with "anyCIPID". 8. Devcaps schema The RELAX NG version of the Devcaps [12] schema, "devcaps.rng": Urpalainen Expires January 16, 2006 [Page 31] Internet-Draft Presence RELAX NG schemas July 2005 Urpalainen Expires January 16, 2006 [Page 32] Internet-Draft Presence RELAX NG schemas July 2005 Urpalainen Expires January 16, 2006 [Page 33] Internet-Draft Presence RELAX NG schemas July 2005 The Devcaps schema includes "cipid.rng" and "servcaps.rng". The "anyCIPID" wildcard definition is redefined with "anyCaps". 9. Servcaps schema The RELAX NG version of the Servcaps [12] schema, "servcaps.rng": Urpalainen Expires January 16, 2006 [Page 34] Internet-Draft Presence RELAX NG schemas July 2005 Urpalainen Expires January 16, 2006 [Page 35] Internet-Draft Presence RELAX NG schemas July 2005 Urpalainen Expires January 16, 2006 [Page 36] Internet-Draft Presence RELAX NG schemas July 2005 Urpalainen Expires January 16, 2006 [Page 37] Internet-Draft Presence RELAX NG schemas July 2005 Urpalainen Expires January 16, 2006 [Page 38] Internet-Draft Presence RELAX NG schemas July 2005 Urpalainen Expires January 16, 2006 [Page 39] Internet-Draft Presence RELAX NG schemas July 2005 Urpalainen Expires January 16, 2006 [Page 40] Internet-Draft Presence RELAX NG schemas July 2005 Urpalainen Expires January 16, 2006 [Page 41] Internet-Draft Presence RELAX NG schemas July 2005 Urpalainen Expires January 16, 2006 [Page 42] Internet-Draft Presence RELAX NG schemas July 2005 Urpalainen Expires January 16, 2006 [Page 43] Internet-Draft Presence RELAX NG schemas July 2005 This Servcaps schema was included by "devcaps.rng". 10. An example instance document An example instance document: open urn:device:0003ba4811e3 Urpalainen Expires January 16, 2006 [Page 44] Internet-Draft Presence RELAX NG schemas July 2005 true Example service true 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 Urpalainen Expires January 16, 2006 [Page 45] Internet-Draft Presence RELAX NG schemas July 2005 open urn:x-mac:0003ba4811e3 email http://www.example.com/mailbox.png mailto:someone@example.com I'll be in Tokyo next week urn:device:0003ba4811e3 PC idle 2005-05-30T16:09:44+05:00 Far away calendar bowling league http://www.example.com/playing.gif -240 Urpalainen Expires January 16, 2006 [Page 46] Internet-Draft Presence RELAX NG schemas July 2005 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 This instance document can be validated with the described PIDF, PIDF+DataModel, PIDF+DataModel+RPID, PIDF+DataModel+RPID+CIPID or PIDF+DataModel+RPID+CIPID+CAPS schemas. The wildcard definitions can be disabled when using 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 forward and backward 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. 11. 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. 12. Acknowledgments The author would like to thank Aki Niemi, Pekka Pessi and Eva-Maria Leppanen for their valuable comments. 13. References 13.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 (Third Edition)", W3C Recommendation REC-xml-20040204 , February 2004. [3] "Canonical XML 1.0", W3C Recommendation REC-xml-c14n-20010315 , March 2001. [4] "Namespaces in XML", W3C Recommendation REC-xml-names- Urpalainen Expires January 16, 2006 [Page 47] Internet-Draft Presence RELAX NG schemas July 2005 19990114 , January 1999. [5] "XML Schema Part 1: Structures Second Edition", W3C Recommendation REC-xmlschema-1-20041028 , October 2004. [6] "XML Schema Part 2: Datatypes Second Edition", W3C Recommendation REC-xmlschema-2-20041028 , October 2004. [7] "RELAX NG Specification", Committee Specification 3 , December 2001. [8] Sugano, H., "CPIM presence information data format", RFC 3863, May 2003. [9] Rosenberg, J., "A Data Model for Presence", draft-ietf-simple-presence-data-model-02 (work in progress), February 2005. [10] Schulzrinne, H., Gurbani, V., Kyzivat, P., and J. Rosenberg, "RPID: Rich Presence Extensions to the Presence Information Data Format (PIDF)", draft-ietf-simple-rpid-07 (work in progress), June 2005. [11] Schulzrinne, H., "CIPID: Contact Information in Presence Information Data Format", draft-ietf-simple-cipid-05 (work in progress), June 2005. [12] Lonnfors, M. and K. Kiss, "User Agent Capability Extension to Presence Information Data Format (PIDF)", draft-ietf-simple-prescaps-ext-04 (work in progress), June 2005. 13.2 Informative references [13] Peterson, J., "Common Profile for Presence (CPP)", RFC 3859, August 2004. Urpalainen Expires January 16, 2006 [Page 48] Internet-Draft Presence RELAX NG schemas July 2005 Author's Address Jari Urpalainen Nokia Research Center Itamerenkatu 11-13 Helsinki 00180 Finland Phone: +358 7180 37686 Email: jari.urpalainen@nokia.com Urpalainen Expires January 16, 2006 [Page 49] Internet-Draft Presence RELAX NG schemas July 2005 Intellectual Property Statement 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. Disclaimer of Validity 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 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. Copyright Statement Copyright (C) The Internet Society (2005). 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. Acknowledgment Funding for the RFC Editor function is currently provided by the Internet Society. Urpalainen Expires January 16, 2006 [Page 50]