Internet Draft Sean B. Palmer Document: draft-palmer-resrep-type-00.txt March 2001 Expires: September 1, 2002 Resource and Representation Typing in HTTP Status Of This Memo This document is an Internet-Draft and is in full conformance with all provisions of Section 10 of RFC2026. 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 1, 2002. Copyright Notice Copyright (C) The Internet Society (2001). All Rights Reserved. Abstract This document defines the "Repr-Type" and "Resource-Type" HTTP entity-header field names, to provide URIs that identify the generic type (class membership) of representations and their original source resources respectively. 1. Introduction Providing a resource type along with an HTTP response is useful, since there may be no other way to identify the resource type within the domain of the HTTP message. For example, HTML pages do not give a machine processable type for the resource that they are representations of. Palmer Informational - Expires September 1, 2002 [Page 1] Internet-Draft Resource and Representation Typing in HTTP March 2001 Meanwhile, using MIME types to identify content types is architecturally inadvisable due to the centralization around the IANA - URIs should identify all important things on the Web, and content types are no exception. (Note that the current set of MIME types can have URIs, and those can be used in the Repr-Type header). In fact, the content type idiom is isomorphic with that of the "Class" class in RDF Schema [RDFSchema]. "RDF classes can be defined to represent almost anything, such as Web pages, people, document types, databases or abstract concepts." - http://www.w3.org/TR/2000/CR-rdf-schema-20000327/#s2.2.3 Repr-Type values are generally restricted to content type classes, whereas the Resource-Type value have no such restriction, according to the definition of resource in RFC 2396. 2. Entity-Header Productions 2.1 Syntax Here is an ABNF for the proposed entity-headers:- ResourceType = "Resource-Type" ":" 1#URIview ReprType = "Repr-Type" ":" 1#URIview URIview = absoluteURI [ "#" fragment ] ; from [RFC2396] The , and components are imported from [RFC2396]. Two examples of syntactically valid ResourceType productions (i.e. "Resource-Type" HTTP headers) are:- Resource-Type: http://xmlns.com/foaf/0.1/Person Resource-Type: http://www.w3.org/2000/10/swap/pim/doc#Work Two examples of syntactically valid ReprType productions (i.e. "Repr-Type" HTTP headers) are:- Repr-Type: http://www.w3.org/2000/10/swap/log#N3Document Repr-Type: http://www.iana.org/assignments/media-types/text/html Palmer Informational - Expires September 1, 2002 [Page 2] Internet-Draft Resource and Representation Typing in HTTP March 2001 2.2 Equality and Character Parsing of Header Values Header values are to be compared on a character for character (case sensitive) basis. Due to internationalization issues, escaped unicode characters are allowed in the URI header values. You must use the following escaping procedure:- * Each disallowed character is converted to UTF-8 (as defined in [RFC2279]) as one or more bytes. * Any bytes corresponding to a disallowed character are escaped with the URI escaping mechanism (that is, converted to %HH, where HH is the hexadecimal notation of the byte value). * The original character is replaced by the resulting character sequence. 3. General Use Considerations It is perfectly legal and sensible for either of the defined entity-headers to occur more than once; if they do, then processors should take the intersection of the given classes. For example, a Resource Type may be both Vehicle and a Car. A Representation Type may be both an XML document, and a canonicalized XML document. Note that if the Repr-Type (and possibly Content-Type) headers conflict semantically, then all of the Repr-Type headers (or just those that conflict with Content-Type, if present) should be abandoned. 4. Security Considerations Implementors should take heed of section 15.1.1 of [RFC2616]. There may be other security considerations that have not yet been raised. The relevant security issues associated with each Repr-Type value should obviously be taken into consideration when handling the entity-body. 5. Further Information Further information on the headers defined by this document is available at http://purl.org/net/resreptype 6. Acknowledgements Many thanks to Mark Baker, Tim Berners-Lee, Jonathan Borden, Sandro Hawke, Mark Nottingham, and Aaron Swartz for the discussions and inspiration that led to this document. Palmer Informational - Expires September 1, 2002 [Page 3] Internet-Draft Resource and Representation Typing in HTTP March 2001 Many thanks also to Daniel Biddle and Aaron Swartz for their help in preparing this document. References [RDFSchema] Dan Brickley, R. V. Guha (2000). Resource Description Framework (RDF) Schema Specification 1.0. W3C Candidate Recommendation. http://www.w3.org/TR/2000/CR-rdf-schema-20000327/ [RFC2279] F. Yergeau (1998). UTF-8, a transformation format of ISO 10646. http://www.ietf.org/rfc/rfc2279.txt [RFC2396] T. Berners-Lee, R. Fielding, L. Masinter (1998). Uniform Resource Identifiers (URI): Generic Syntax. http://www.ietf.org/rfc/rfc2279.txt [RFC2616] T. Berners-Lee, R. Fielding, H. Frystyk, J. Gettys, P. Leach, L. Masinter, J. Mogul (1999). Hypertext Transfer Protocol -- HTTP/1.1. http://www.ietf.org/rfc/rfc2616.txt Palmer Informational - Expires September 1, 2002 [Page 4]