kitodo / kitodo-presentation

Kitodo.Presentation is a feature-rich framework for building a METS- or IIIF-based digital library. It is part of the Kitodo Digital Library Suite.
https://kitodo.github.io/kitodo-presentation/
GNU General Public License v3.0
39 stars 45 forks source link

What's the definition of toplevel:true? It's a feature or a bug in collection plugin to show all issues twice? #568

Open albig opened 3 years ago

albig commented 3 years ago

There are toplevel structures and non-toplevel structures. Up to a certain point, that's comprehensible. Of course an article or a chapter is not a toplevel structure. But I'm a little confused in some details.

In newspapers, the Kitodo.Presentation comes with the defaults:

Newspaper, year and issue are indexed as Kitodo.presentation documents in tx_dlf_documents. In case of type:year, you cannot edit the structure in the backend because year is not toplevel. So we changed the configuration and set year to toplevel.

Question 1

Shouldn't be type:year a toplevel document? Same as type:newspaper and type:issue?

In the collection plugin in showSingleCollection() we are looking for all documents with toplevel:true. That's why we find all newspaper issues and show them as "Toplevel" entries. The newspaper itself is shown, too with all years below. This behaviour is confusing and we modified the collection by the field "index_search" to exclude issues and year. This can be done e.g. with !type:(year OR issue) toplevel:true.

Question 2

Is this the expected behaviour of the collection plugin? Shouldn't it show the (real) toplevel element (type:newspaper) with the years below?

Looking forward to some explanation :-)

sebastian-meyer commented 3 years ago

Originally toplevel was meant as an indicator for aggregation: When showing collections, all non-toplevel documents should be grouped under their respective toplevel document (e.g. volumes are grouped together under their respective multi-volume work and issues are grouped together under their respective periodical).

But keep in mind that there are other forms of lists, like fulltext search results. In those cases, we want all hits within a document grouped under the respective document without worrying about the toplevel status.

So effectively there were two modi operandi for ListView:

Now newspapers have even more levels of hierarchy (newspaper, year, issue and sub-structures like articles) and those aren't rare edge cases any more. If only the newspaper was toplevel, collection lists would show years grouped under their respective newspapers, but there would be no issues shown. So I declared issues as toplevel as well in order to show them in collection lists, but now they are no longer grouped together. (And when searching, things get even more complicated...)

I think, we have to completely rethink how we want to do grouping and aggregating in a consistent and yet configurable way.