Eric Scheid wrote:

On 15/9/05 6:06 AM, "David Powell" <[EMAIL PROTECTED]> wrote:

Eg - An Atom library or server that doesn't know about this extension
is free to not preserve the entry order, and yet to retain the
<fi:ordered /> element, even though this will have corrupted the data.

very good point.

Indeed. And it is a point that signals a show stopper for the approach taken in the draft. As an alternative, I'm considering a alternate approach that places order metadata within the entry.

For instance
 <feed>
   <entry>
     ...
     <i:rank>10</i:rank>
   </entry>
   <entry>
     ...
     <i:rank>5</i:rank>
   </entry>
   <entry>
     ...
     <i:rank>15</i:rank>
   </entry>
 </feed>

The i:rank element is a non-negative integer. Consumers of the feed may use the rank as a key for sorting entries. Because different rankings may be relevant in different domains, the i:rank element will support a scheme attribute whose value is either a name or an IRI identifying a ranking scheme. The built in schemes are "priority" and "index". "priority" is used to rank the relevative importance of the entry (the higher the value, the higher the importance). "index" is used to specify a natural order for entries. New scheme names can be standardized through IANA registration. IRI values can be used to identify non-standardized schemes. If the scheme attribute is missing, the value is assumed to be "index".

For instance
 <feed>
   <entry>
     ...
     <i:rank scheme="priority">10</i:rank>
     <i:rank scheme="index">1</i:rank>
     <i:rank scheme="http://www.example.com/ranking/foo";>100</i:rank>
   </entry>
   <entry>
     ...
     <i:rank scheme="priority">5</i:rank>
     <i:rank scheme="index">2</i:rank>
     <i:rank scheme="http://www.example.com/ranking/foo";>50</i:rank>
   </entry>
   <entry>
     ...
     <i:rank scheme="priority">0</i:rank>
     <i:rank scheme="index">3</i:rank>
     <i:rank scheme="http://www.example.com/ranking/foo";>30</i:rank>
   </entry>
 </feed>

On the feed level, metadata can be specified to indicate which ranking schemes are intended to be applied to the entries in the feed. These are generally informative and do no rely on the actual order of the entries

For instance
 <feed>
   ...
   <i:ranking default="yes" order="descending">priority</i:ranking>
   <i:ranking order="ascending">index</i:ranking>
<i:ranking order="descending">http://www.example.com/ranking/foo</i:ranking>
 </feed>

The value of the i:ranking element is the name or IRI of a ranking scheme. The default attribute (value 'yes' or 'no') is used to indicate which ranking scheme should be considered the default. Only one i:ranking with @default="yes" is allowed within a feed. The order attribute (value 'ascending' or 'descending') is used to indicate the default sort order for that ranking scheme. If a feed contains a particular i:ranking scheme, it's entries SHOULD contain corresponding i:rank elements. Entry elements that do not have i:rank elements for a particular scheme must be presented at the end of the presentation list (see the example below)

Complete example
 <feed>
   ...
   <i:ranking default="yes" order="descending">priority</i:ranking>
   <i:ranking order="ascending">index</i:ranking>
<i:ranking order="descending">http://www.example.com/ranking/foo</i:ranking>
   <entry>
     ...
     <id>C</id>
     <i:rank scheme="priority">10</i:rank>
     <i:rank scheme="index">3</i:rank>
     <i:rank scheme="http://www.example.com/ranking/foo";>30</i:rank>
   </entry>
   <entry>
     ...
     <id>A</id>
     <i:rank scheme="priority">5</i:rank>
     <i:rank scheme="index">1</i:rank>
     <i:rank scheme="http://www.example.com/ranking/foo";>50</i:rank>
   </entry>
   <entry>
     ...
     <id>B</id>
     <i:rank scheme="priority">0</i:rank>
     <i:rank scheme="index">2</i:rank>
     <i:rank scheme="http://www.example.com/ranking/foo";>100</i:rank>
   </entry>
   <entry>
     ...
     <id>D</id>
   </entry>
 </feed>

Ordered descending by priority): C, A, B, D
Ordered ascending by index: A, B, C, D
Ordered descending by http://www.example.com/ranking/foo: B, A, C, D

Thoughts?

- James

Reply via email to