Adds the ability to query a site for a list of acceptable categories.



Author: JoeGregorio


Categories are part of the original charter for the atompub working group, and in addition they are showing up in the wild:


Add the following to the protocol specification:

3.4 CategoryURI

The CategoryURI allows the client application to retrieve a list of category name-value pairs from the server. These name-value pairs are presented to the user to choose from when creating or updating an entry. The value of the name-value pair is sent in a dc:subject element of the entry.

3.4.1 Locating

The CategoryURI is found in the Introspection file. If the server supports a specific type of categorization then it SHOULD present a category facet in it's Introspection file. The 'name' for the CategoryURI in the Introspection file is 'categories'.

<?xml version="1.0" encoding='utf-8'?>
<introspection version="0.3" xmlns="">
  <site title="Main Site" > 
    <service name="post" href="" />
    <service name="feed" href="" />
    <service name="categories" href="" />

3.4.2 Request

The only method specified for this URI is GET.

3.4.3 Response

The response from a successful GET on a CategoryURI is a Categories document. An example of such a document is:

<?xml version="1.0" encoding="utf-8"?>
<categories  version="1.0"  xmlns="">
    <subject value="">Books</subject>
    <subject value="">Travel</subject>
    <subject value="">Movies</subject>

Given the above example response, if a new entry was created with a movie review it can be categorized by adding the following element to the POSTed entry:


The mime-type of the returned content is 'application/atom+xml'.

Any number of children 'atom:subject' elements may be present. The "atom:categories" element.

The version identifier for this specification is "1.0". The 'atom:subject' element conveys information about a single category. The contents of the 'atom:subject' element is a human-readable description of the category.

<categories version="1.0"
   <subject value="01001000">archaeology</subject>
   <subject value="01002000">architecture</subject>
   <subject value="01005000">cinema</subject>

Key Questions

  1. What do we do for large categorization schemes? For example, if I recall correctly just the category names for DMOZ totals over 300MB.

  2. Do we need to indicate somewhere which categorization schema this is from, either something private, or indicate it is from a well known source, such as IPTC, DMOZ, etc.

  3. Does this work for all the 'well-known' categorization schemes?

  4. Are multiple dc:subject elements allowed in an entry? How do we distinguish if only 1 or if more are allowed?



CREDIT: This idea and interface is inspired by the TypePad implementation:

Update: Added a version attribute to the response.

Update: Added more detail on element and attribute meanings.