Antone Roundy wrote:
On Wednesday, September 21, 2005, at 11:43 PM, James M Snell wrote:
<feed xmlns:i="urn:ranking">
<i:domain>{domain}</i:domain>
I was thinking yesterday of suggesting that feed/id be used the way
you're using i:domain. Which is better is probably a matter of whether
ranking domains that span multiple feeds will be useful or not. In the
movie ratings use case presented below, perhaps rather than a
fivestarts scheme and netflix and amazon domains, it might make more
sense to do this:
Using atom:id as the ranking domain would limit the ranking to a single
feed which is useful, but does not cover the full range of cases.
Later on in your note, you say:
If sticking with i:domain, I'd recommend that you recommend that in
cases where a ranking domain does not span multiple feeds, the feed/id
value be used for the value of i:domain, and that in all cases, the
same care be taken to (attempt to) ensure that i:domain's value is
unique to what is intended to be a particular domain.
Yes, there are two special cases here:
1. Lack of a i:domain
2. i:domain value that is a same document reference
In the first case, I had imagined a "Default Ranking Domain" that is
identified by the feed atom:id element, just as you suggest.
In the second case, I had imagined a "Document Ranking Domain" that is
identified by the document containing the feed.
There is a subtle difference between these two. Consider the following
(somewhat contrived) example:
<xhtml:html>
...
<xhtml:body>
<atom:feed>
<atom:id>Feed1</atom:id>
<i:domain>#</i:domain> <!-- document ranking domain -->
<atom:entry>
<atom:id>A</atom:id>
<i:rank scheme="priority">50</i:rank>
<i:rank scheme="priority" domain="#">20</i:rank>
</atom:entry>
<atom:entry>
<atom:id>B</atom:id>
<i:rank scheme="priority">25</i:rank>
<i:rank scheme="priority" domain="#">40</i:rank>
</atom:entry>
</atom:feed>
<atom:feed>
<atom:id>Feed2</atom:id>
<i:domain>#</i:domain> <!-- document ranking domain -->
<atom:entry>
<atom:id>C</atom:id>
<i:rank scheme="priority">50</i:rank>
<i:rank scheme="priority" domain="#">30</i:rank>
</atom:entry>
<atom:entry>
<atom:id>D</atom:id>
<i:rank scheme="priority">25</i:rank>
<i:rank scheme="priority" domain="#">10</i:rank>
</atom:entry>
</atom:feed>
</xhtml:body>
</xhtml:html>
The two embedded atom:feed elements specify two ranking domains: The
Default Ranking Domain and a Document Ranking Domain. The Default
Ranking Domain is scoped to the individual atom:feed as is identified by
the value of the atom:id. the Document Ranking Domain is scoped to the
containing document.
The Default Ranking Domain ranks may only be used to order the entries
within the containing atom:feed:
sort_ascending ( Feed1 ) = B, A
sort_ascending ( Feed2 ) = D, C
The Document Ranking Domain ranks may be used to order all entries
appearing within the document
sort_ascending ( Document ) = D, A, C, B
In an Atom Feed Document, the Default Ranking Domain and the Document
Ranking Domain happen to be identical.
<feed>
<id>urn:my_reviews</id>
<i:order scheme="urn:netflix.com/reviews" label="Netflix
rating">descending</i:order>
<i:order scheme="urn:amazon.com/reviews" label="Amazon
rating">descending</i:order>
<entry>
<id>Movie A</id>
<i:rank scheme="urn:netflix.com/reviews">3</i:rank>
<i:rank scheme="urn:amazon.com/reviews">4</i:rank>
</entry>
<entry>
<id>Movie B</id>
<i:rank scheme="urn:netflix.com/reviews">2</i:rank>
<i:rank scheme="urn:amazon.com/reviews">1</i:rank>
</entry>
</feed>
Notes:
* The i:order element tells the user agent whether higher or lower
numbers are considered "better", "higher priority", "first", or
whatever. In these cases, higher numbers are better, so would
typicially be shown first, so they're considered a "descending" schemes.
Hmm.. I wanted to get away from doing this kind of thing.
* i:order/@label indicates a human readable label for the scheme, and
could be optional.
* Since the urn:(netflix|amazon).com/reviews schemes are feed
independent, it is not necessary to indicate a feed (or "domain") in
this case.
* For a feed-specific scheme, like natural order, the feed ID would be
included like this (so that if these entries were aggregated, it would
be clear that the i:order elements were relevant to the source feed,
not the aggregate feed):
The goal of @scheme is to identify the type of ranking to apply while
the goal of @domain is to identify the scope of the ranking. I do not
believe that it is a good idea to conflate the two.
- James