RE: relate a Collection and a PagedCollection

On Thursday, April 24, 2014 5:46 PM, Ruben Verborgh wrote:
> > Let me answer with a question: What is an rdf:List?
> >  a) the sum of all list nodes (the things with rdf:first/rdf:rest
properties)
> >  b) a single list node
> >  c) both
> 
> a), no doubt about that. Example:
> 
> :l1 rdf:first :a;
>      rdf:next :l2.
> :l2 rdf:first :b;
>      rdf:next rdf:nil.
> 
> :l1 is a list. :l2 is a list (and a sublist of :l2).
> :nil is a list (and a sublist of :l1 and :l2).

We are starting to split hairs here but I would really like to understand
your reasoning.

So, forgetting about totalItems and firstPage/lastPage for the moment, would
you agree in

  :pc1 hydra:member :a, :b
          hydra:nextPage :pc2
  :pc2 hydra:member :c, :d
          hydra:previousPage :pc2

both :pc1 and :pc2 are paged collections? If not, why not? Where's the
difference to the list above?

> :a is a list node.
> :b is a list node.

OK, I call them list items to save the term node for the blank nodes, but it
doesn't matter at all.


> None are both.

Same for collections IMO. We argue about the distinction between pages
(:l1/:pc1) and the complete collection (list). Neither Hydra
PagedCollections nor rdf:Lists express that entity explicitly. 


> Could you still say whether PageCollection is a/b/c?

Given that I just found out that we use the term list node for different
terms, I would say clearly a). For me it's really the same as a
(double-linked) list.


> >> That's where blank nodes come in handy:
> >>    :p5 hydra:pageOf [ hydra:firstPage :p1 ].
> >> meaning
> >>    page 5 is a page of something, here is its first page
> >
> > I don't see how this improves things.. quite the contrary actually.
> 
> Well, for starters, no troubles in explaining this ;-)
> It corresponds to the real world.

Except that people usually have problems grasping blank nodes. But apart
from that, you are right that separating a PagedCollection into a Collection
and Pages is quite trivial to explain and understand.


> > I do agree though that from a theoretical point of view this is more
precise. On
> > the Web, however, theoretical pureness rarely wins. Pragmatism and
> > simplicity typically does.
> 
> The pragmatism here is that it corresponds to real collections;
> you don't need theoretically abstract concepts that are a hybrid of a
collection and a
> member.

Is it really that abstract? It is a pattern that is so often seen that I
would argue most developers are already familiar with. Just out of
curiosity, I checked what LDP is doing. They are basically doing the same as
Hydra:

  https://dvcs.w3.org/hg/ldpwg/raw-file/default/ldp-paging.html#terms

Perhaps you should also raise an issue for LDP then giving that they are
close to completing their work!?


> > Also, if you use blank nodes for this, what's the advantage? You won't
even
> > know anymore whether different pages belong to the same collection.
> 
> Yes you do:
> >> :p5 hydra:pageOf [ hydra:firstPage :p1 ].
> 
> :p5 and :p1 belong to the same collection
> because hydra:pageOf and hydra:firstPage are functional.

Good point!


> >> Seems to make more sense than
> >>    :x hydra:firstPage :p1
> >> which does *not* mean
> >>    "here is the first page of x"
> >> but
> >>    "here is the first page of the thing that :x also is a page of"
> >
> > I don't really see a problem with the latter.
> 
> The thing. What is the thing?

You wrote that sentence :-)


> Just because you don't mention it, doesn't mean it doesn't exist.
> It clearly does-hiding it doesn't simplify things.

I'm afraid this is getting philosophical now and I don't want us to go
there.


[...]

> >> With the hybrid PagedCollection that acts both as a page and a
collection,
> >> I can point to neither.
> >
> > Just as with lists, you can simply point to the first page.
> 
> No. With the list, I can point to item1 and list1;
> with the current PagedCollection, I can point to node1
> (which would be a hybrid of item1 and list1).

Sorry, I don't follow.


> In all seriousness, the important thing for me is this:
> please allow the separate identification of collections and pages.
> No matter how you define (the domain of) firstPage and lastPage,
> at least allow us to say things about the collection,
> which are different than the things we want to say about a page.

OK. I was going to ask how this should look like in a concrete Web API
according to you, but I see Gregg just posted a mail that covers that so
I'll jump onto that thread instead.


--
Markus Lanthaler
@markuslanthaler

Received on Friday, 25 April 2014 16:32:32 UTC