This could all get rather complicated very quickly. My primary objective
is to address known use cases for ordered feeds (my netflix queue
feed[1] for example), most of which are structured as complete datasets
that are non-incremental in nature. I'm not convinced that I necessarily
want to try to solve all of the potential problem cases that could arise
with ordered feeds that span multiple a collection of historical feeds,
etc. Also, I am not wishing to duplicate what Microsoft has done with
their simple list extensions. So with that in mind, I still wish to try
and address the issues that have been raised so here's what I have so far:
[1] http://rss.netflix.com/QueueRSS?id=P5365369447081104293883231608616881
<feed xmlns:i="urn:ranking">
<i:domain>{domain}</i:domain>
<item>
<i:rank scheme="{scheme}" domain="{domain}">{nonNegativeInteger}</i:rank>
</item>
</feed>
I drop the feed level i:ranking element and introduce a new i:domain
element that identifies a "ranking domain" that this feed is a part of.
The i:rank element is used to specify the nonNegativeInteger rank for
the given {scheme} for the containing element. The {domain} attribute is
used to scope the i:rank to a specific ranking domain -- for instance,
the priority ranking is only relevant if the entry is contained in a
feed with a corresponding i:domain element.
The lack of a i:domain element indicates the "default ranking domain".
Any i:rank elements that do not specify a domain attribute are
considered to be part of the default ranking domain.
For instance, in the following example, only the first i:rank is
relevant within the given feed. Neither of the urn:bar i:rank elements
are relevant within this particular feed example.
<feed>
<id>tag:example.com,2005:/feed</id>
<i:domain>urn:foo</i:domain>
<entry>
<id>tag:example.com,2005:/feed/1</id>
<i:rank scheme="index" domain="urn:foo">1</i:rank>
<i:rank scheme="index" domain="urn:bar">2</i:rank>
</entry>
<entry>
<id>tag:example.com,2005:/feed/2</id>
<i:rank scheme="index" domain="urn:foo">2</i:rank>
<i:rank scheme="index" domain="urn:bar">1</i:rank>
</entry>
</feed>
Domain urn:foo ranking: tag:example.com,2005:/feed/1 then
tag:example.com,2005:/feed/2
Domain urn:bar ranking: rag:example.com,2005:/feed/2 then
tag:example.com,2005:/feed/1
The domain element serves multiple purposes.
1. It helps us to scope the relevance of an i:rank element within an
entry. For instance, if an entry with an i:rank in the urn:foo domain is
aggregated into a synthetic feed that either a) does not specify a
ranking domain or b) specifies a different ranking domain, consumers can
safely ignore the urn:foo i:rank.
2. It helps us to correlate ranks that span multiple feed documents. For
instance, two separate feed documents may specify the same ranking domain.
No-Rank Entries: no-rank entries are marked by the absence of an i:rank
element corresponding to a given scheme. For instance, in the following
example, entry "C" is a No-Rank Entry in the Index scheme, but is ranked
in the Priority Scheme.
<feed>
<entry>
<id>A</id>
<i:rank scheme="index">1<i:rank>
<i:rank scheme="priority">10<i:rank>
</entry>
<entry>
<id>B</id>
<i:rank scheme="index">2<i:rank>
<i:rank scheme="priority">50<i:rank>
</entry>
<entry>
<id>C</id>
<i:rank scheme="priority">20<i:rank>
</entry>
</feed>
Re: Eric's Question: "How does this help (eg) bbc.co.uk order their news
items in some sensible manner?"
By the description given, it sounds as if the BBC ranking is more a
ranking of relative importance than a ranking of natural order. That is,
Top Story A has a higher importance that Top Story B, etc. If that is
the case, a "priority" or "importance" ranking scheme can be used in
conjunction with the atom:updated element.
<feed>
<entry>
<id>top-story-A</id>
<updated>2005-12-12T12:00:00Z</updated>
<i:rank scheme="priority">90</i:rank>
</entry>
<entry>
<id>top-story-B</id>
<updated>2005-12-12T12:00:00Z</updated>
<i:rank scheme="priority">80</i:rank>
</entry>
<entry>
<id>top-story-C</id>
<updated>2005-12-11T12:00:00Z</updated>
<i:rank scheme="priority">90</i:rank>
</entry>
<entry>
<id>top-story-D</id>
<updated>2005-12-11T12:00:00Z</updated>
<i:rank scheme="priority">80</i:rank>
</entry>
</feed>
In this example, top-story-A is ranked as the highest priority entry on
Dec, 12, 2005 while top-story-C is ranked as the highest priority entry
on Dec, 11, 2005.
Re: Eric's Question: "What happens when entries "fall off the bottom"
... do their rankings expire?"
It will be entirely dependent on the scheme. In a priority ranking
scheme (measuring the relative importance of an entry), having an entry
"fall off the bottom" would have no effect on the overall
ordering/ranking of the feed. In a natural order ranking scheme (indexed
position), having an entry "fall off the bottom" would likely mean that
the entry is no longer a part of the ordered list or is no longer
relevant to the rankings.
Re: Thomas Broyer's suggestions:
>1. get rid of your i:rank, users will use any extension element
instead (no more
> registry and you can still define "standard" priority and index
extensions)
I considered this but a single extensible rank element fits most of the
simple use cases for this rather well. That said, allowing for specific
ranking elements would be helpful, so how about a bit of a compromise?
rankingCommonAttributes =
attribute i:scheme { IRI },
attribute i:domain { IRI }?
rankingConstruct =
rankingCommonAttributes
integerRank = element i:rank {
rankingConstruct (nonNegativeInteger)
}
With this approach, i:rank is defined as the standard nonNegativeInteger
ranking element. If I so desired, I could easily define new
rankingConstructs however, for instance:
importanceRank = element x:importance {
rankingConstruct ('critical' | 'high' | 'medium' | 'low' | 'info'|)
}
<x:importance i:scheme="importance" i:domain="urn:foo">high</x:importance>
>2. get rid of your @order attribute: users should be able to choose in
which
>order they want their entries: best-ranked to least-ranked "top to
bottom" or
>"bottom to top". Its the responsibility of the producer to provide
labels and
>values that will be well-understood by users (e.g. not saying "stars" and
>ranking from 1 (best rank) down to 5: "stars" implies "number of
stars", so
>"sort by stars in ascending order" implies "the highest the value, the
better it
>is", which is not what's behind 1=best-rankā¦)
Done.
>3. make content of i:raking a user understandable label
>4. (optional) add a data-type attribute to i:ranking (maybe rename
that one to
> something related to sorting, not ranking)
>5. use @namespace and @localname attributes on i:ranking to describe the
>element in entries the sort applies to (using those attributes prevent
from using
>QNames in attribute values, which doesn't work great with prefix changes)
I think I want to avoid this. Again, my goal is not to duplicate the
function of the simple list extensions. In the same vein, I've removed
the order attribute.
Ok, time for some use cases,
Imagine if Google wished to start offering search results in an Atom
feed and that they wished to include Page Rank in with the results.
<feed>
<id>urn:my_google_search</id>
<i:domain>http://www.google.com</i:domain>
<entry>
<id>A</id>
<i:rank scheme="pagerank" domain="http://www.google.com">1234</i:rank>
</entry>
<entry>
<id>B</id>
<i:rank scheme="pagerank" domain="http://www.google.com">3456</i:rank>
</entry>
<entry>
<id>C</id>
<i:rank scheme="pagerank" domain="http://www.google.com">5467</i:rank>
</entry>
</feed>
<feed>
<id>urn:your_google_search</id>
<i:domain>http://www.google.com</i:domain>
<entry>
<id>A</id>
<i:rank scheme="pagerank" domain="http://www.google.com">1234</i:rank>
</entry>
<entry>
<id>D</id>
<i:rank scheme="pagerank" domain="http://www.google.com">785</i:rank>
</entry>
<entry>
<id>E</id>
<i:rank scheme="pagerank" domain="http://www.google.com">123</i:rank>
</entry>
</feed>
Note that the two feeds both specify pagerank values in the
http://www.google.com ranking domain. If these feeds were aggregated
together, a consumer could intelligently order the combined set of
entries based on the i:rank pagerank values.
Another example, entries are ranked on a five-star scale
<feed>
<id>urn:my_reviews</id>
<i:domain>http://www.example.com/reviews</i:domain>
<i:domain>http://www.example.org/reviews</i:domain>
<entry>
<id>Movie A</id>
<i:rank scheme="fivestars"
domain="http://www.example.com/reviews">3</i:rank>
<i:rank scheme="fivestars"
domain="http://www.example.org/reviews">4</i:rank>
</entry>
<entry>
<id>Movie B</id>
<i:rank scheme="fivestars"
domain="http://www.example.com/reviews">2</i:rank>
<i:rank scheme="fivestars"
domain="http://www.example.org/reviews">1</i:rank>
</entry>
<entry>
<id>Movie C</id>
<i:rank scheme="fivestars"
domain="http://www.example.com/reviews">5</i:rank>
<i:rank scheme="fivestars"
domain="http://www.example.org/reviews">3</i:rank>
</entry>
</feed>
The feed specifies multiple ranking domains. To put this into a real
world perspective, imagine that instead of domains
http://www.example.com/reviews and http://www.example.org/reviews, it
was http://www.netflix.com and http://www.amazon.com... e.g. Movie A is
ranked with 3 stars on NetFlix.com and 4 stars on Amazon.com.
Anyway, that's what I have currently. Further thoughts?
- James
Eric Scheid wrote:
On 21/9/05 9:35 PM, "James Holderness" <[EMAIL PROTECTED]> wrote:
Marking entries as having no rank sounds like a nice idea, but I don't think
it's feasible in the long run.
thinking more ... I think the way to handle this is that the client
application could weight the ranking with the age of the item, and thus a
rank#1 item would appear near the top of the list, and then slowly drop
away.
You also get to know what the original ranking for an item is.
e.