Brian Smith wrote:
[snip]
The scheme attribute tells the processor how to interpret the value of term[...]

The specification does not say anything about how to interpret terms, only that 
categories are identified by terms.

[...] which can be any string value, including an IRI.

I know any string value can be used (even the empty string). But I still 
recommend that people use IRIs as for the term attribute to avoid any confusion.

I can see why you might think that the authors of the specification intended to write the opposite of what they wrote. But, I doubt that all the people that have reviewed the specification overlooked such an obvious contradiction. It is better to assume that the specification says what it means. Regardless, It is prudent to apply the robustness principle here: when creating categories, ensure the category is uniquely identified by the term attribute (interpret the specification as it is written), and when accepting categories from others, copy them unmodified (if the producer doesn't take the spec literally, you should also tolerate that as much as possible). If you do that, you are unlikely to run into any problems.


Heh.. I think I'm familiar enough with the spec text to know exactly what it says. But let's look at the text again...

     The "term" attribute is a string that identifies the category to
     which the entry or feed belongs.  Category elements MUST have a
     "term" attribute.

     The "scheme" attribute is an IRI that identifies a categorization
     scheme.  Category elements MAY have a "scheme" attribute.

Notice that the word "unique" isn't used. In fact, the word "unique" is used only twice within the entire spec, in section 4.2.6 re: atom:id. So if we want to play the "interpret the specification" game, then yes, the term is used to identify the category, but it is not required, recommended or even subtlety suggested that the term should be unique.

Regarding the scheme attribute and the "interpretation" of categories... You're right, Atom does not define how to interpret terms. What it does do is provide the scheme attribute so the categorization scheme can be identified. It is the categorization scheme that defines how to interpret the term... which is what I said.

For instance, suppose I want to assign a Library of Congress categorization to an entry...

  <category
    scheme="http://www.loc.gov/aba/cataloging/classification";
    term="QA76.75-76.765" />

While the term appropriately identifies the category, there's absolutely no way a client can interpret the term without being familiar with the Library of Congress classification system. The fact that the term happens to be unique within the LoC scheme is irrelevant as far as Atom is concerned.

Another important point is that an entry can contain multiple category elements that use the same term but have different schemes. For all practical purposes, these are two completely different categories. The term identifies the category within the scope of the categorization scheme.

  <entry>
    ...
    <category scheme="http://example.org/foo"; term="baz" />
    <category scheme="http://example.org/bar"; term="baz" />
    ...
  </entry>

- James

- Brian



Reply via email to