RFC 4685

Atom Threading Extensions

๐Ÿ“… published September 2006, from ietf

RFC 4685: Atom Threading Extensions ๐Ÿ’–๐Ÿงต

Network Working Group ยท Request for Comments: 4685 ยท September 2006

Okay so this one's written by J. Snell ๐ŸŽ€, and it's a Standards Track doc, so it's a real protocol spec, not just vibes. The title block doesn't list anything it obsoletes or updates, so it's a fresh start โœจ.


Status of This Memo ๐Ÿ“‹

okay so this doc is an Internet standards track protocol for the Internet community, and it's basically asking everyone to chime in with discussion and suggestions for improvements ๐Ÿซถ. For the current standardization state and status of this protocol, check the "Internet Official Protocol Standards" (STD 1). And distribution of this memo is unlimited, so share away ๐Ÿ’….

Copyright (C) The Internet Society (2006).

Abstract ๐ŸŒธ

this memo is all about a mechanism that lets feed publishers show threaded discussions inside the Atom Syndication Format ๐Ÿงตโœจ.

Table of Contents ๐Ÿ—‚๏ธ

1. Introduction ....................................................1
2. Notational Conventions ..........................................2
3. The 'in-reply-to' Extension Element .............................2
4. The 'replies' Link Relation .....................................5
5. The 'total' Extension Element ...................................6
6. Considerations for Using thr:count, thr:updated, and total ......7
7. Security Considerations .........................................8
8. IANA Considerations .............................................9
9. References ......................................................9
   9.1. Normative References .......................................9
   9.2. Informative References ....................................10
Appendix A.  Acknowledgements .....................................11

1. Introduction ๐Ÿฆ‹

so this doc defines an extension for expressing threaded discussions inside the Atom Syndication Format [RFC4287]. It's giving "reply chains, but make it a standard" ๐Ÿ™ˆ.

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 BCP 14, [RFC2119], as scoped to those conformance targets.

the XML Namespaces URI [W3C.REC-xml-names-19990114] for the XML elements and attributes described in this specification is:

http://purl.org/syndication/thread/1.0

In this document, the namespace prefix thr: stands for that Namespace URI. The prefix is arbitrary, so the choice of prefix isn't semantically significant ๐Ÿ’œ.

this spec borrows some shorthand from the XML Infoset [W3C.REC-xml-infoset-20040204]. The phrase "Information Item" gets dropped when naming Element and Attribute Information Items. So when this spec says "element," it means an Element Information Item in Infoset terms, and when it says "attribute," it means an Attribute Information Item ๐Ÿง .

This specification allows IRIs [RFC3987] to be used. Every URI [RFC3986] is also an IRI, so you can use a URI anywhere an IRI is named. When an IRI that isn't also a URI is given for dereferencing, it MUST be mapped to a URI using the steps in Section 3.1 of [RFC3987]. When an IRI is serving as an identifier, it MUST NOT be so mapped ๐Ÿ”.

Some sections of this spec are illustrated with a non-normative RELAX NG Compact schema [RELAXNG]. In those sections, this specification uses the atomCommonAttributes, atomMediaType, and atomURI patterns, which are defined in [RFC4287] โœจ.

However, the text of this specification is the only thing that defines conformance. The pictures and schemas are just helpers, bestie ๐ŸŽ€.

3. The 'in-reply-to' Extension Element ๐Ÿ’ฌ

The "in-reply-to" element is used to say that an entry is a response to another resource. The element MUST contain a "ref" attribute identifying the resource that is being responded to ๐Ÿซถ.

it's not unlike the references and in-reply-to email message headers, defined by [RFC2822]. But here's the tea โ˜•: unlike the in-reply-to header, the "in-reply-to" element is required to identify the unique identifier of only a single parent resource. If the entry is a response to multiple resources, additional "in-reply-to" elements MAY be used. There's no direct equivalent to the references header, which lists the unique identifiers of each preceding message in a thread ๐Ÿงต๐Ÿ’….

The grammar goes like this:

in-reply-to =
  element thr:in-reply-to {
    atomCommonAttributes,
    ref,
    href?,
    source?,
    type?,
    ( undefinedContent )
  }

ref = attribute ref { atomURI }
href = attribute href { atomURI }
type = attribute type { atomMediaType }
source = attribute source { atomURI }

The "ref" attribute specifies the persistent, universally unique identifier of the resource being responded to. The value MUST conform to the same construction and comparison rules as the value of the atom:id element, as defined in Section 4.2.6 of [RFC4287]. Even though the IRI might use a dereferenceable scheme, processors MUST NOT assume that it can be dereferenced ๐Ÿ‘€.

If the resource being responded to doesn't have a persistent, universally unique identifier, the publisher MUST assign an identifier that satisfies all the considerations in Section 4.2.6 of [RFC4287] to use as the value of the "ref" attribute. In that case, if a representation of the resource can be retrieved from an IRI that can be used as a valid atom:id value, then this IRI SHOULD be used as the value of both the "ref" and "href" attributes ๐Ÿ”—.

The "source" attribute MAY be used to specify the IRI [RFC3987] of an Atom Feed or Entry Document containing an atom:entry with an atom:id value equal to the value of the "ref" attribute. The IRI you specify, once it's appropriately mapped to a corresponding URI, MUST be dereferenceable ๐Ÿงš.

The "href" attribute specifies an IRI that may be used to retrieve a representation of the resource being responded to. The IRI you specify, once it's appropriately mapped to a corresponding URI, MUST be dereferenceable ๐ŸŒˆ.

The "type" attribute MAY be used to give the client a hint about the media type [RFC4288] of the resource identified by the "href" attribute. The "type" attribute only means something if a corresponding "href" attribute is also provided ๐Ÿ“.

This specification gives no significance to the order in which multiple "in-reply-to" elements appear within an entry ๐Ÿ™ƒ.

Here's an example of an entry with a response:

<feed xmlns="http://www.w3.org/2005/Atom"
      xmlns:thr="http://purl.org/syndication/thread/1.0">
  <id>http://www.example.org/myfeed</id>
  <title>My Example Feed</title>
  <updated>2005-07-28T12:00:00Z</updated>
  <link href="http://www.example.org/myfeed" />
  <author><name>James</name></author>
  <entry>
    <id>tag:example.org,2005:1</id>
    <title>My original entry</title>
    <updated>2006-03-01T12:12:12Z</updated>
    <link
      type="application/xhtml+xml"
      href="http://www.example.org/entries/1" />
    <summary>This is my original entry</summary>
  </entry>
  <entry>
    <id>tag:example.org,2005:1,1</id>
    <title>A response to the original</title>
    <updated>2006-03-01T12:12:12Z</updated>
    <link href="http://www.example.org/entries/1/1" />
    <thr:in-reply-to
      ref="tag:example.org,2005:1"
      type="application/xhtml+xml"
      href="http://www.example.org/entries/1"/>
    <summary>This is a response to the original entry</summary>
  </entry>
</feed>

To help Atom processors that don't know about the in-reply-to extension still see that there's a relationship between the entry and the resource it's responding to, publishers are advised to consider including a "related" link that references a representation of the resource identified by the in-reply-to element. Those links probably won't get processed as a reference to a predecessor in a threaded conversation, but they're still super helpful for establishing a semantically meaningful relationship between the linked resources ๐Ÿ’–.

For example:

<feed xmlns="http://www.w3.org/2005/Atom"
      xmlns:thr="http://purl.org/syndication/thread/1.0">
  <id>http://www.example.org/myfeed</id>
  <title>My Example Feed</title>
  <updated>2005-07-28T12:00:00Z</updated>
  <link href="http://www.example.org/myfeed" />
  <author><name>James</name></author>
  <entry>
    <id>tag:example.org,2005:1,1</id>
    <title>A response to the original</title>
    <updated>2006-03-01T12:12:12Z</updated>
    <link href="http://www.example.org/entries/1/1" />
    <thr:in-reply-to
      ref="tag:example.org,2005:1,0"
      type="application/xhtml+xml"
      href="http://www.example.org/entries/1"
      source="http://www.example.org/myfeed" />
    <link
      rel="related"
      type="application/xhtml+xml"
      href="http://www.example.org/entries/1" />
    <summary>This is a response to the original entry</summary>
  </entry>
</feed>

okay so an Atom link element with rel="replies" is how you point people to the spot where the responses to an entry live ๐Ÿ’ฌ and if you leave off the type attribute, it's assumed to be application/atom+xml ๐ŸŽ€

a replies link sitting inside the feed or source element means the linked resource probably has responses to any of that feed's entries ๐ŸŒธ and a replies link inside an entry means the linked resource probably has responses meant for that one entry specifically ๐Ÿ’…

an atom:link using rel="replies" MAY have a thr:count attribute ๐Ÿ”ข its value is an unsigned, non-negative integer written in the canonical representation of the XML Schema nonNegativeInteger datatype [W3C.REC-xmlschema-2-20041028] ๐Ÿงš it's just a hint for clients about roughly how many replies the linked resource has, and it's advisory, so it might not match the real number ๐Ÿ™ˆ

the link MAY also have a thr:updated attribute ๐Ÿฆ‹ its value is a [RFC3339] date-time stamp that follows the same construction rules as the Atom Date Construct from [RFC4287] โฐ it's another hint, this time about when the newest reply showed up, and again it might not be accurate ๐Ÿซถ

here's an example feed to vibe with ๐Ÿ‘‘

<feed xmlns="http://www.w3.org/2005/Atom"
      xmlns:thr="http://purl.org/syndication/thread/1.0">
  <id>http://www.example.org/myfeed</id>
  <title>My Example Feed</title>
  <updated>2005-07-28T12:00:00Z</updated>
  <link href="http://www.example.org/myfeed" />
  <author><name>James</name></author>
  <entry>
    <id>tag:entries.com,2005:1</id>
    <title>My original entry</title>
    <updated>2006-03-01T12:12:12Z</updated>
    <link href="http://www.example.org/entries/1" />
    <link rel="replies"
          type="application/atom+xml"
          href="http://www.example.org/mycommentsfeed.xml"
          thr:count="10" thr:updated="2005-07-28T12:10:00Z" />
    <summary>This is my original entry</summary>
  </entry>
</feed>

so Atom feed, entry, and source elements MAY each hold as many replies links as they want ๐Ÿ’– but this spec doesn't give any meaning to whether those links show up or what order they're in ๐Ÿคทโ€โ™€๏ธ if an entry has multiple replies links, they might point at different versions of the same set of responses, or they might point at totally separate resources with separate responses ๐ŸŒˆ either way, processors MUST NOT assume that multiple replies links are pointing at different representations of the same resource, and they MUST handle each replies link on its own, independent of the others ๐Ÿ”ฅ

5. The 'total' Extension Element

the total element tells you the total number of unique responses to an entry that the publisher knows about ๐Ÿ“ its content MUST be an unsigned non-negative integer that follows the canonical representation of the XML Schema nonNegativeInteger datatype [W3C.REC-xmlschema-2-20041028] ๐Ÿ’œ

total = element thr:total { xsd:nonNegativeInteger }

atom entries MAY have a total element, but they MUST NOT have more than one ๐Ÿ™…โ€โ™€๏ธ

and there's no implied relationship between an entry's total value and any individual or combined thr:count values on its replies links ๐Ÿ™ƒ they're separate things, bestie, don't mix them up ๐Ÿ’…

6. Considerations for Using thr:count, thr:updated, and total

okay so thr:count, thr:updated, and total all add extra metadata about the discussion thread attached to an entry ๐Ÿงต the whole point is to let feed readers show basic context about the thread without having to fetch, parse, and analyze every linked resource ๐Ÿš€ but there are a few things implementors need to keep in mind ๐Ÿ‘€

first up, these extensions MUST NOT be assumed to be completely accurate about the thread ๐Ÿ˜ฌ for example, the real number of responses in a linked resource MAY be different from what thr:count says ๐Ÿ™ˆ publishers SHOULD try their best to keep the values accurate ๐ŸŽฏ the fact that this kind of "external reference metadata" (like the attributes on replies links) isn't authoritative is covered in more detail in Section 3.3 of the W3C document "Tag Finding 12: Authoritative Metadata" [TAG12] ๐Ÿ“š

second, these values are volatile and can change faster than the entry they belong to ๐ŸŒช๏ธ if they get updated a lot, or if any part of the Atom document changes a lot, that could hurt how well the document can be cached, which means more bandwidth gets used overall ๐Ÿ˜ญ

publishers SHOULD treat a change to the values of thr:count, thr:updated, and total as an "insignificant" update in terms of [RFC4287] โœจ that means the containing feed, entry, or source element's atom:updated value SHOULD NOT be affected by a change to these extensions ๐Ÿ’–

lastly, implementors should know that even though the Atom specification [RFC4287] explicitly lets the link element carry arbitrary extensions, it does not require implementations to support them ๐Ÿซ  for extensions in general, Atom only requires feed consumers to ignore any extension they don't understand, and nothing stricter than that ๐Ÿงš so some implementations MAY NOT be able to fully use the extensions defined here, or in any other spec ๐Ÿ™ˆ

7. Security Considerations

okay this part is serious, so let's get into it ๐Ÿซก this spec extends the Atom Syndication Format, so it's subject to the same security considerations defined in [RFC4287] ๐Ÿ”

now, feeds that use these mechanisms could be crafted to make a consumer start an excessive number of network requests, or even an endless chain of them ๐Ÿ˜ฑ that can cause denial of service for the consumer, the target server, and/or the networks in between ๐Ÿ’€ consumers can reduce this risk by requiring user intervention after a certain number of requests, or by limiting requests with a hard limit or with heuristics ๐Ÿ›ก๏ธ

these mechanisms can also be used to build threaded conversations that span resources spread across multiple domains ๐ŸŒ for example, someone posting an entry to a weblog on one Internet domain could mark that entry as a response to an entry from a weblog on a different domain ๐Ÿ‘€ implementors should be aware that attackers can take advantage of these distributed responses to attach inappropriate or unwanted content to a discussion ๐Ÿšจ to prevent or reduce this, users can be allowed to explicitly configure which sources responses may be retrieved from, or the legitimacy of a response source can be checked with heuristics ๐Ÿง

implementors should also watch out for malicious content publishers who edit or change content after it's been published ๐Ÿ˜ค in closed, centralized comment systems, after-the-fact editing usually isn't a problem, because those changes are easy to prevent, detect, or track ๐Ÿ”’ but with the distributed comments you get from the thr:in-reply-to extension, those changes are much harder to spot, which opens the door to serious attribution and repudiation problems ๐Ÿ’” XML Digital Signatures, as specified in Section 5.1 of [RFC4287], are one possible way to help with those concerns ๐Ÿ–‹๏ธ but a valid XML Digital Signature inside an entry is not, by itself, a reliable defense against repudiation issues ๐Ÿ™…โ€โ™€๏ธ

8. IANA Considerations

this spec defines one new Atom link relation type, and it's been registered in the IANA Registry of Link Relation, which is set up by [RFC4287] ๐Ÿ“‹

Attribute Value: replies
Description: (see Section 4)
Expected display characteristics: (see Section 4)
Security considerations: (see Section 5)

9. References

9.1. Normative References

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. ๐Ÿ”‘

[RFC3339] Klyne, G. and C. Newman, "Date and Time on the Internet: Timestamps", RFC 3339, July 2002. โฐ

[RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", STD 66, RFC 3986, January 2005. ๐ŸŒ

[RFC3987] Duerst, M. and M. Suignard, "Internationalized Resource Identifiers (IRIs)", RFC 3987, January 2005. ๐ŸŒ

[RFC4287] Nottingham, M. and R. Sayre, "The Atom Syndication Format", RFC 4287, December 2005. ๐ŸŒธ

[RFC4288] Freed, N. and J. Klensin, "Media Type Specifications and Registration Procedures", BCP 13, RFC 4288, December 2005. ๐ŸŽ€

[W3C.REC-xml-infoset-20040204] Tobin, R. and J. Cowan, "XML Information Set (Second Edition)", W3C REC REC-xml-infoset-20040204, February 2004. ๐Ÿงพ

[W3C.REC-xml-names-19990114] Hollander, D., Bray, T., and A. Layman, "Namespaces in XML", W3C REC REC-xml-names-19990114, January 1999. ๐Ÿท๏ธ

[W3C.REC-xmlschema-2-20041028] Malhotra, A. and P. Biron, "XML Schema Part 2: Datatypes Second Edition", W3C REC REC-xmlschema-2-20041028, October 2004. ๐Ÿงฎ

9.2. Informative References

[RELAXNG] Clark, J., "RELAX NG Compact Syntax", December 2001, http://www.oasis-open.org/committees/relax-ng/compact-20021121.html. ๐Ÿ“

[RFC2822] Resnick, P., "Internet Message Format", RFC 2822, April 2001. โœ‰๏ธ

[TAG12] Fielding, R. and I. Jacobs, "Tag Finding 12: Authoritative Metadata", http://www.w3.org/2001/tag/doc/mime-respect-20060412. ๐Ÿท๏ธ

Appendix A. Acknowledgements

the author says a huge thank you to Antone Roundy, Aristotle Pagaltzis, Byrne Reese, David Powell, Eric Scheid, James Holderness, John Panzer, Lisa Dusseault, M. David Peterson, Sam Ruby, Sylvain Hellegouarch, and the rest of the Atom Publishing Format and Protocol working group for their feedback while this spec was being developed ๐Ÿซถ and any fault or weakness in the definition of this extension is solely the author's fault ๐Ÿ™ˆ

some portions of text in this document were adapted from [RFC4287] so the two specs stay stylistically and technically aligned โœจ

Author's Address

James M Snell ๐Ÿ’œ

EMail: jasnell@gmail.com URI: http://www.snellspace.com ๐Ÿฆ‹

Okay bestie, the legal bits ๐Ÿ’… Copyright (C) The Internet Society (2006). ๐Ÿฆ‹

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 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 ๐ŸŒˆ

Okay so the IETF is not picking a side ๐Ÿ™ˆ It takes no position on whether any Intellectual Property Rights or other rights that might be claimed to apply to the technology in this document are valid or what their scope is. It also doesn't say whether any license under those rights might or might not be available, and it hasn't made any independent effort to go looking for such rights. If you want the procedures for rights in RFC documents, check out 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. ๐Ÿซถ


Acknowledgement ๐ŸŒธ

Funding for the RFC Editor function is provided by the IETF Administrative Support Activity (IASA). โœจ๐Ÿ‘‘

๐Ÿ“ฆ where this page comes from