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.org
GNU General Public License v3.0
38 stars 45 forks source link

[BUGFIX] Get issue title from the day if the issue itself doesn't contain correct date #1315

Closed beatrycze-volk closed 1 week ago

beatrycze-volk commented 1 month ago

Closes https://github.com/slub/dfg-viewer/issues/306

Problem here is actually a bit more complicated. This fix corrects the error introduced into the METS file. The issue elements don't have correct date in the orderlabel attribute and then when casting to date happens it always cast to the first day of the given month. Previous version of kitodo had this 'fix' to correct the wrong data in file.

Example: https://digital.slub-dresden.de/data/kitodo/TheDarea_416971482-1910/TheDarea_416971482-1910_mets.xml

<mets:div ID="uuid-5c2f6124-bbd4-4a26-a18f-e9d6842ebac3" TYPE="day" ORDER="4" ORDERLABEL="1910-01-06">
    <mets:div ID="uuid-96f00ace-c398-41e2-9fa9-b5a7b811d8e0" TYPE="issue" ORDER="1" ORDERLABEL="1910-01">
        <mets:mptr LOCTYPE="URL" xlink:href="https://digital.slub-dresden.de/data/kitodo/TheDarea_416971482-19100106/TheDarea_416971482-19100106_mets.xml"/>
    </mets:div>
</mets:div>

@sebastian-meyer @MarcMoschSLUB should we include this fix or just accept that produced data was wrong and display it as such?

sebastian-meyer commented 1 month ago

I am not sure why the @ORDERLABEL of an issue is casted to a date in the first place. Only the @ORDERLABEL of year, month and day are supposed to be ISO 8601 dates (see METS-Anwendungsprofil, page 10: "Das Attribut ORDERLABEL der kalendarischen mets:div muss das Monats- bzw. Tagesdatum nach ISO 8601 enthalten.").

So we shouldn't cast the @ORDERLABEL of an issue to anything at all. Furthermore, the title/label of an issue should be taken from @LABEL attribute.

beatrycze-volk commented 1 month ago

I also don't know why it happens, but it happens.

Calendar Plugin in current form was implemented in this commit: https://github.com/kitodo/kitodo-presentation/commit/1acecfbf7ae94f0ab3ece0f47c9fb778a01442e2

As mentioned earlier the METS file is quiet incomplete. Not only orderlabel contains incomplete date for issue but also doesn't contain label element at all. For this case label is substituted with orderlabel.

MarcMoschSLUB commented 1 month ago

I am d'accord with Sebastian. This is a data issue which has to be fixed on production side.

andre-hohmann commented 1 month ago

This behavior of missing LABEL attribute of issues is discussed in the context of Kitodo.Production, too:

Just FYI and to link the issues to create an overall picture and the impact.

andre-hohmann commented 1 month ago

The following two aspects should be regarded separately:

  1. Incorrect ORDERLABEL to describe the newspaper issues
  2. Missing LABEL information of the subordinate processes in superordinate processes and the former fix of Kitodo.Presentation to retrieve it from the subordinate process

Regarding aspect 1: A correction of the data is necessary. This might affect only a few institutions - the ones who migrated newspaper issues from Kitodo.Production 2 to Kitodo.Production 3. Possible reasons are analysed in:

Regarding aspect 2: Other hierarchical processes are also affected, such as periodical processes. Regardless of the incorrect data of aspect 1. This could affect several institutions.

This is being discussed in:

beatrycze-volk commented 1 week ago

Correction of the data should be made in Kitodo.Production, not in Kitodo.Presentation.