[RDF] Sorting selections

Jonas Liljegren jonas@rit.se
19 Feb 2001 14:01:36 +0100


I started this message two weeks ago.  I have prosponed this topic,
but may as well send out this now.


I was thinking about how to sort selections.

Let's say we have four interfaces and asks for resources with a
specific property.

If there are a lot of resources that match the criterion, it would
generate a very large selection.  But we may only want to list the
first five.

In order to save time and memory, we only put the criterion in the
selection and doesn't compute the result.  Then li($n) is called to
get the $n entry, the selection entry is expanded.

If the selection comes from only one interface, we could let the
interface directly return the $n resource.  But because several
interfaces is onvolved, none of the interface know which enty is
number $n.  We have to get one by one until we get to $n.

If the ordering isn't important, we could return the objects from one
interface after another.  If we request numer 248, and a size()
request to the first interface gives 235, we continue with the next
interface.

But a size() should not have to count all resources if the point is to
know in which interface number 248 resides in.


Dynamic properties could be computed based on many things.  If we want
all objects of a specific type, we cant let the backend only retrieve
those resources. anotther interface could say that another class is a
subClassOf that type.  It could be very complicated.  many selections
would have to be done.


If the order is significant, we have to build an internal list of
resources in the container.  If the conteiner is very larg, we don't
want to have the whole list in memory.

We could do some sorts of partial sorting.  For example, if we only
want the top three items, we wouldn't have to sort the bottom 9997
items.


-- 
/ Jonas Liljegren

The Wraf project http://www.uxn.nu/wraf/
Sponsored by http://www.rit.se/