Category Collection vs using predicates

Hi,
I am in the process of classifying some resource types and just wonder when to use the Collection category. At first look it looks similar to just any category where you just use predicates of the same type to point to several objects and use id.o.predicate_name in your template to iterate over them (or id.s.predicate_name if others are pointing to the resource).
Are there any situations where one should consider the Collection over just using any predicate pointing to resources?

1 Like

Hi Mikael,

That is a good question about data modeling in Zotonic.

You are correct that every resource can have as many connections (edges) to other resources as you want.

In general we use categories to distinguish meaning and classify what a resource is. We also use categories to select templates and decide how things are viewed.

The collection category is a set of different pages. And it is typically shown as a list of other pages. It typically doesn’t have much content, mostly just a title and a short description. The predicate we use for the collections is haspart (which matches common semantic web terms).

That is also why stored queries are classified as a sub-category of collection. They are also mostly showing a list of items (aka resources or pages) without much other content from themselves.

That is different than, say, the authors of an article. Where the main content is the article and the author-connections add meaning to the article.

Hope this clarifies a bit.

Cheers, Marc

1 Like

Hi Marc,
very clarifying.
So the two major things to keep in mind when selecting/adding categories are the semantics - the classifying itself, and then how to view them - which template to select eventually.
Thanks,
Mikael

Indeed, if a category is displayed in very different ways, then it might be actually more than one category.

2 Likes