Network Working Group J. Reschke Internet-Draft greenbytes Expires: March 28, 2005 September 27, 2004 Datatypes for WebDAV properties draft-reschke-webdav-property-datatypes-08 Status of this Memo This document is an Internet-Draft and is subject to all provisions of section 3 of RFC 3667. 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 become aware will be disclosed, in accordance with RFC 3668. 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 March 28, 2005. Copyright Notice Copyright (C) The Internet Society (2004). Abstract This specification extends the Web Distributed Authoring Protocol (WebDAV) to support datatyping. Protocol elements are defined to let clients and servers specify the datatype, and to instruct the WebDAV method PROPFIND to return datatype information. Editorial Note (To be removed by RFC Editor before publication) Please send comments to the Distributed Authoring and Versioning Reschke Expires March 28, 2005 [Page 1]
Internet-Draft Datatypes for WebDAV properties September 2004 (WebDAV) working group at <mailto:w3c-dist-auth@w3.org>, which may be joined by sending a message with subject "subscribe" to <mailto:w3c-dist-auth-request@w3.org>. Discussions of the WEBDAV working group are archived at <http://lists.w3.org/Archives/Public/w3c-dist-auth/>. Note that although discussion takes place on the WebDAV working group's mailing list, this is not a working group document. XML versions, latest edits and the issues list for this document are available from <http://greenbytes.de/tech/webdav/ #draft-reschke-webdav-property-datatypes>. Reschke Expires March 28, 2005 [Page 2]
Internet-Draft Datatypes for WebDAV properties September 2004 Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 2. Notational Conventions . . . . . . . . . . . . . . . . . . . . 4 3. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 4. Changes for PROPPATCH method . . . . . . . . . . . . . . . . . 5 4.1 Example for successful PROPPATCH . . . . . . . . . . . . . 6 4.2 Example for failed PROPPATCH . . . . . . . . . . . . . . . 7 4.3 Example for successful PROPPATCH where type information was not preserved . . . . . . . . . . . . . . 9 5. Changes for PROPFIND method . . . . . . . . . . . . . . . . . 9 5.1 Example for PROPFIND/prop . . . . . . . . . . . . . . . . 10 6. Changes for other methods . . . . . . . . . . . . . . . . . . 11 7. Compatibility Considerations . . . . . . . . . . . . . . . . . 11 8. Internationalization Considerations . . . . . . . . . . . . . 12 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 12 10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 12 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 12 11.1 Normative References . . . . . . . . . . . . . . . . . . . . 12 11.2 Informative References . . . . . . . . . . . . . . . . . . . 13 Author's Address . . . . . . . . . . . . . . . . . . . . . . . 13 A. Change Log (to be removed by RFC Editor before publication) . 13 A.1 Since 'draft-reschke-webdav-property-datatypes-00' . . . . 13 A.2 Since 'draft-reschke-webdav-property-datatypes-01' . . . . 13 A.3 Since 'draft-reschke-webdav-property-datatypes-02' . . . . 13 A.4 Since 'draft-reschke-webdav-property-datatypes-03' . . . . 13 A.5 Since 'draft-reschke-webdav-property-datatypes-04' . . . . 14 A.6 Since 'draft-reschke-webdav-property-datatypes-05' . . . . 14 A.7 Since 'draft-reschke-webdav-property-datatypes-06' . . . . 14 A.8 Since 'draft-reschke-webdav-property-datatypes-07' . . . . 14 B. Resolved issues (to be removed by RFC Editor before publication) . . . . . . . . . . . . . . . . . . . . . . . . . 14 B.1 other-method-semantics . . . . . . . . . . . . . . . . . . 14 B.2 1_clarify_scope . . . . . . . . . . . . . . . . . . . . . 14 B.3 7_discovery . . . . . . . . . . . . . . . . . . . . . . . 15 B.4 a_remove_array_example . . . . . . . . . . . . . . . . . . 15 C. Open issues (to be removed by RFC Editor prior to publication) . . . . . . . . . . . . . . . . . . . . . . . . . 15 C.1 edit . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Intellectual Property and Copyright Statements . . . . . . . . 16 Reschke Expires March 28, 2005 [Page 3]
Internet-Draft Datatypes for WebDAV properties September 2004 1. Introduction This specification builds on the infrastructure provided by the WebDAV Distributed Authoring Protocol, adding support for data-typed properties. Although servers must support XML content in property values, it may be desirable to persist values as scalar values when possible, and to expose the data's type when the property value is returned to the client. The client is free to ignore this information, but it may be able to take advantage of it when modifying a property. On the other hand, when setting new properties, it can be desirable to pass data type information along with the value. A server can take advantage of this information to optimize storage and to perform additional parsing (for instance of dates). Servers that support searching can also take advantage of known data types when doing comparisons and sorting. The following potential datatyping related features were deliberately considered out of scope: o getting "schema" information for classes of resources (set of "required" properties, their types, display information), o definition of a set of mandatory property types, o discovery of supported property types, o extensions to PROPPATCH that would allow updates to parts of a (structured) property. 2. Notational Conventions The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119]. The term "property element" refers to the XML element that identifies a particular property, for instance <getcontentlength xmlns="DAV:" /> The term "prop element" is used for the WebDAV "prop" element as defined in section 12.11 of [RFC2518]. The XML representation of schema components uses a vocabulary Reschke Expires March 28, 2005 [Page 4]
Internet-Draft Datatypes for WebDAV properties September 2004 identified by the namespace name "http://www.w3.org/2001/XMLSchema". For brevity, the text and examples in this specification use the prefix "xs:" to stand for this namespace; in practice, any prefix can be used. "XML Schema: Structures" ([XS1]) also defines several attributes for direct use in any XML documents. These attributes are in a different namespace named "http://www.w3.org/2001/XMLSchema-instance". For brevity, the text and examples in this specification use the prefix "xsi:" to stand for this latter namespace; in practice, any prefix can be used. 3. Overview Although WebDAV property types can be anything that can be marshaled as content of an XML element, in many cases they actually are simple types like integers, booleans or dates. "XML Schema Part 2: Datatypes" [XS2] defines a set of simple types which can be used as a basis for supplying type information to attributes. Data type information is represented using the attribute "type" from the XML Schema namespace "http://www.w3.org/2001/XMLSchema-instance". In XML Schema, data types are qualified names, and the XML Schema recommendation defines a set of built-in datatypes (section 3 of [XS2]), defined in the namespace "http://www.w3.org/2001/XMLSchema". To avoid unnecessary verbosity, data type information should only be supplied if it adds usable information to the protocol. In particular, type information is not required for live properties defined in WebDAV [RFC2518] and for properties of type "xs:string". A server may implement any combination of datatypes, both from the XML Schema recommendation and possibly from other namespaces. Note that a particular property can be typed for a number of reasons: o The property is a live property with server-defined semantics and value space. o The property may have been set using a non-WebDAV protocol that the server understands in addition to WebDAV. o The type may have been specified in an extended PROPPATCH method as defined in Section 4. 4. Changes for PROPPATCH method If the property element has an XML attribute named "xsi:type", the server may use this information to select an optimized representation Reschke Expires March 28, 2005 [Page 5]
Internet-Draft Datatypes for WebDAV properties September 2004 for storing the property value. For instance, by specifying a type as "xs:boolean", the client declares the property value to be of type boolean (as defined in [XS2]). The server may choose any suitable internal format for persisting this property, and in particular is allowed to fail the request if the format given does not fit the format defined for this type. The server should indicate successful detection and parsing of the typed value by setting the xsi:type attribute on the property element in the response body (this implies that it should return a MULTISTATUS status code and a <multistatus> response body). 4.1 Example for successful PROPPATCH >>Request PROPPATCH /bar.html HTTP/1.1 Host: example.org Content-Type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <D:propertyupdate xmlns:D="DAV:" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:Z="http://ns.example.org/standards/z39.50"> <D:set> <D:prop> <Z:released xsi:type="xs:boolean">false</Z:released> </D:prop> </D:set> </D:propertyupdate> Reschke Expires March 28, 2005 [Page 6]
Internet-Draft Datatypes for WebDAV properties September 2004 >>Response HTTP/1.1 207 Multi-Status Content-Type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <D:multistatus xmlns:D="DAV:" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:Z="http://ns.example.org/standards/z39.50"> <D:response> <D:href>http://example.org/bar.html</D:href> <D:propstat> <D:prop><Z:released xsi:type="xs:boolean" /></D:prop> <D:status>HTTP/1.1 200 OK</D:status> </D:propstat> </D:response> </D:multistatus> In this cases, the xsi:type attribute on the element "Z:released" indicates that the server indeed has understood the submitted data type information. 4.2 Example for failed PROPPATCH >>Request PROPPATCH /bar.html HTTP/1.1 Host: example.org Content-Type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <D:propertyupdate xmlns:D="DAV:" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:Z="http://ns.example.org/standards/z39.50"> <D:set> <D:prop> <Z:released xsi:type="xs:boolean">t</Z:released> </D:prop> </D:set> </D:propertyupdate> Reschke Expires March 28, 2005 [Page 7]
Internet-Draft Datatypes for WebDAV properties September 2004 >>Response HTTP/1.1 207 Multi-Status Content-Type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <D:multistatus xmlns:D="DAV:" xmlns:Z="http://ns.example.org/standards/z39.50"> <D:response> <D:href>http://example.org/bar.html</D:href> <D:propstat> <D:prop><Z:released/></D:prop> <D:status>HTTP/1.1 422 Unprocessable Entity</D:status> <D:responsedescription> Does not parse as xs:boolean </D:responsedescription> </D:propstat> </D:response> </D:multistatus> In this case the request failed because the supplied value "t" is not a valid representation for a boolean value. Note that similar error conditions can occur in the standard WebDAV protocol even though no data type was specified: for instance, when a client tries to set a live property for which only a certain value space is allowed. Reschke Expires March 28, 2005 [Page 8]
Internet-Draft Datatypes for WebDAV properties September 2004 4.3 Example for successful PROPPATCH where type information was not preserved >>Request PROPPATCH /bar.html HTTP/1.1 Host: example.org Content-Type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <D:propertyupdate xmlns:D="DAV:" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:Z="http://ns.example.org/standards/z39.50"> <D:set> <D:prop> <Z:released xsi:type="Z:custom">t</Z:released> </D:prop> </D:set> </D:propertyupdate> >>Response HTTP/1.1 207 Multi-Status Content-Type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <D:multistatus xmlns:D="DAV:" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:Z="http://ns.example.org/standards/z39.50"> <D:response> <D:href>http://example.org/bar.html</D:href> <D:propstat> <D:prop><Z:released/></D:prop> <D:status>HTTP/1.1 200 OK</D:status> </D:propstat> </D:response> </D:multistatus> In this case the request succeeded, but the server did not know how to handle the data type "Z:custom". Therefore no data type information was returned in the response body. 5. Changes for PROPFIND method PROPFIND is extended to return the data type information for properties by adding "xsi:type" attributes to the property elements Reschke Expires March 28, 2005 [Page 9]
Internet-Draft Datatypes for WebDAV properties September 2004 unless one of the following conditions is met: o The data type MUST be different from "xs:string" (because this can be considered the default data type). o The property's data type MUST NOT be defined in [RFC2518] (because these types are already well-defined). 5.1 Example for PROPFIND/prop >>Request PROPFIND /bar.html HTTP/1.1 Host: example.org Content-Type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <D:propfind xmlns:D="DAV:" xmlns:Z="http://ns.example.org/standards/z39.50"> <D:prop> <D:getcontenttype/> <Z:released/> </D:prop> </D:propfind> Reschke Expires March 28, 2005 [Page 10]
Internet-Draft Datatypes for WebDAV properties September 2004 >>Response HTTP/1.1 207 Multi-Status Content-Type: text/xml; charset="utf-8" Content-Length: xxxx <?xml version="1.0" encoding="utf-8" ?> <D:multistatus xmlns:D="DAV:" xmlns:Z="http://ns.example.org/standards/z39.50" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <D:response> <D:href>http://example.org/bar.html</D:href> <D:propstat> <D:prop> <D:getcontenttype>text/html</D:getcontenttype> <Z:released xsi:type="xs:boolean">1</Z:released> </D:prop> <D:status>HTTP/1.1 200 OK</D:status> </D:propstat> </D:response> </D:multistatus> This example shows that the property value "true" is returned with the correct data type information, and that the server chose one of the two possible representations defined in XML Schema. It also shows that data type information is not returned for "D:getcontenttype", as this property's data type is already defined in [RFC2518]. 6. Changes for other methods Servers that support other methods using the DAV:multistatus response format (such as the REPORT method defined in [RFC3253], section 3.6) SHOULD apply the same extensions as defined in Section 5. 7. Compatibility Considerations This part of this specification does not introduce any new protocol elements, nor does it change the informal WebDAV DTD. It merely specifies additional server semantics for the case where clients submit additional data type information in an attribute on the property element (previously undefined), and adds an additional attribute on property elements upon PROPFIND. Clients not aware of datatype handling should not supply the "xsi:type" attribute on property elements (after all, this attribute belongs to the XML Schema-Instance namespace which has been defined Reschke Expires March 28, 2005 [Page 11]
Internet-Draft Datatypes for WebDAV properties September 2004 for exactly this purpose). Old clients should also ignore additional attributes on property elements returned by PROPFIND (and similar methods), although the WebDAV specification only defines this behaviour for unknown elements (and is silent about unknown attributes). Servers not aware of datatype handling either drop the "xsi:type" attribute, or persist it along with the property value. However, they will never indicate successful parsing of the data type by returning back the type in the response to PROPPATCH. Thus, clients can supply type information without having to poll for server support in advance. 8. Internationalization Considerations This proposal builds on [RFC2518], and inherits its internationalizability. 9. IANA Considerations This proposal does not introduce any new IANA considerations, since it does not specify any new namespaces (in the general sense), but merely uses existing ones. 10. Acknowledgements This draft has benefited from thoughtful discussion by Lisa Dusseault, Stefan Eissing, Eric Sedlar and Kevin Wiggen. 11. References 11.1 Normative References [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [RFC2518] Goland, Y., Whitehead, E., Faizi, A., Carter, S. and D. Jensen, "HTTP Extensions for Distributed Authoring -- WEBDAV", RFC 2518, February 1999. [XS1] Thompson, H., Beech, D., Maloney, M., Mendelsohn, N. and World Wide Web Consortium, "XML Schema Part 1: Structures", W3C REC-xmlschema-1-20010502, May 2001, <http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/>. [XS2] Biron, P., Malhotra, A. and World Wide Web Consortium, "XML Schema Part 2: Datatypes", W3C REC-xmlschema-2-20010502, May 2001, Reschke Expires March 28, 2005 [Page 12]
Internet-Draft Datatypes for WebDAV properties September 2004 <http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/>. 11.2 Informative References [RFC3253] Clemm, G., Amsden, J., Ellison, T., Kaler, C. and J. Whitehead, "Versioning Extensions to WebDAV", RFC 3253, March 2002. Author's Address Julian F. Reschke greenbytes GmbH Salzmannstrasse 152 Muenster, NW 48159 Germany Phone: +49 251 2807760 Fax: +49 251 2807761 EMail: julian.reschke@greenbytes.de URI: http://greenbytes.de/tech/webdav/ Appendix A. Change Log (to be removed by RFC Editor before publication) A.1 Since 'draft-reschke-webdav-property-datatypes-00' Editorial fixes. Changed examples to explicitly use utf-8 encoding for HTTP content type and XML encoding. Added example for marshalling array-typed properties. A.2 Since 'draft-reschke-webdav-property-datatypes-01' Fix width of artwork for IETF compliance. "Non-normative references" -> "Informative references". A.3 Since 'draft-reschke-webdav-property-datatypes-02' Added marshalling for property flags such as "hidden" and "protected". Moved array marshalling example into back section. Added rational and description for pf:property-displayname-set. Added acknowledgements section. A.4 Since 'draft-reschke-webdav-property-datatypes-03' Replaced domain names in examples according to RFC2606: "www.foo.com" by "example.org", "www.example.com" by "ns.example.org/standards/ z39.50/standards/z39.50" and "www.w3.com/standards/z39.50" by "ns.example.org/standards/z39.50". Reschke Expires March 28, 2005 [Page 13]
Internet-Draft Datatypes for WebDAV properties September 2004 A.5 Since 'draft-reschke-webdav-property-datatypes-04' Remove superfluous IP and copyright sections. Moved "Introduction" section to front. A.6 Since 'draft-reschke-webdav-property-datatypes-05' Added proposal for DAV:basicsearch operators for array-typed properties. Update all references. A.7 Since 'draft-reschke-webdav-property-datatypes-06' Reformat abstract. Remove property flags, displayname support and DASL extensions. A.8 Since 'draft-reschke-webdav-property-datatypes-07' Rewrite Editorial Note. Get rid of unnecessary sub section titles after removal of property flags and displayname support (no change tracking). Some typos fixed. Add and resolve issues "other-method-semantics", "1_clarify_scope", "7_discovery" and "a_remove_array_example". Removed unused reference to XML spec (no change tracking). Appendix B. Resolved issues (to be removed by RFC Editor before publication) Issues that were either rejected or resolved in this version of this document. B.1 other-method-semantics Type: change julian.reschke@greenbytes.de (2004-09-15): Define semantics for other methods such as REPORT. Resolution (2004-09-17): Other methods using DAV:multistatus such as REPORT SHOULD use the same extension as defined for PROPFIND. B.2 1_clarify_scope Type: change <http://lists.w3.org/Archives/Public/w3c-dist-auth/2004JulSep/ 0178.html> lisa@osafoundation.org (2004-09-14): Clarify what's in scope and what Reschke Expires March 28, 2005 [Page 14]
Internet-Draft Datatypes for WebDAV properties September 2004 is not. Resolution (2004-09-22): Done. B.3 7_discovery Type: change <http://lists.w3.org/Archives/Public/w3c-dist-auth/2004JulSep/ 0174.html> lisa@osafoundation.org (2004-09-14): Should there be a way for clients to detect whether the server supports this feature? I would think that would be better. However, if there's no way, then there should be some guidance for clients along the lines of "If the client supports this draft, the client SHOULD send data typing information for all non-string data types, without even knowing whether the server supports the feature." Resolution (2004-09-22): Clarify that sending the type information to un-extended servers is harmless, thus no in-advance discovery is needed. B.4 a_remove_array_example Type: change <http://lists.w3.org/Archives/Public/w3c-dist-auth/2004JulSep/ 0213.html> julian.reschke@greenbytes.de (2004-09-23): Remove "array" example. Resolution (2004-09-23): Done. Appendix C. Open issues (to be removed by RFC Editor prior to publication) C.1 edit Type: edit julian.reschke@greenbytes.de (2004-07-08): Umbrella issue for editorial fixes/enhancements. Reschke Expires March 28, 2005 [Page 15]
Internet-Draft Datatypes for WebDAV properties September 2004 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 (2004). 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. Reschke Expires March 28, 2005 [Page 16]