Skip to content

feat(serializers.dcat): Add checksum to dcat serializer#2211

Open
MahmoudMHassan wants to merge 2 commits intoinveniosoftware:masterfrom
MahmoudMHassan:master
Open

feat(serializers.dcat): Add checksum to dcat serializer#2211
MahmoudMHassan wants to merge 2 commits intoinveniosoftware:masterfrom
MahmoudMHassan:master

Conversation

@MahmoudMHassan
Copy link
Copy Markdown

❤️ Thank you for your contribution!

Description

This consider checksums in the dcat serializer for oai-sets as per W3 dcat version 3 (link)

Checklist

Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:

Frontend

Reminder

By using GitHub, you have already agreed to the GitHub’s Terms of Service including that:

  1. You license your contribution under the same terms as the current repository’s license.
  2. You agree that you have the right to license your contribution under the current repository’s license.

Copy link
Copy Markdown
Contributor

@tmorrell tmorrell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for this contribution! This enhancement seems reasonable, and should be quick to merge once the tests are passing and you remove the draft tag.

'rdf:resource="https://127.0.0.1:5000/records/12345-abcde/files/test.txt"/>\n'
" <dcat:mediaType>text/plain</dcat:mediaType>\n"
" <dcat:byteSize>9</dcat:byteSize>\n"
" <dcat:checksum>md5:e795abeef2c38de2b064be9f6364ceae</dcat:checksum>\n"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to be moved after accessURL for the tests to pass.

Copy link
Copy Markdown
Author

@MahmoudMHassan MahmoudMHassan Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @tmorrell for checking out the PR. I put it on draft state as I still needed to further test it and check the format introduced. Your suggestion indeed fixed the test failure above.
Nevertheless, we have discussed internally and following the checksum introduced in W3 version 3, the documentation formats the checksum with spdx clauses and some properties, Therefore extending the format for example to the following:

...
<dcat:distribution>
  <dcat:Distribution>
    <dcat:downloadURL rdf:resource="https://berd-platform.de/records/j3h3z-k1f62/files/100m_grid.7z"/>
    <dcat:mediaType>application/x-7z-compressed</dcat:mediaType>
    <dcat:byteSize>59374850</dcat:byteSize>
    <dcat:accessURL rdf:resource="https://doi.org/10.60914/j3h3z-k1f62"/>
    <spdx:checksum>
      <spdx:Checksum>
        <spdx:algorithm rdf:resource="http://spdx.org/rdf/terms#checksumAlgorithm_md5"/>
        <spdx:checksumValue>be1258c3526dc89ddaf4f0a45ee20486</spdx:checksumValue>
      </spdx:Checksum>
    </spdx:checksum>
  </dcat:Distribution>
</dcat:distribution>
...

I have modified the tests as well accordingly after the extension and it passes. Our use case is mainly to have the checksum value added to the dcat format so the first structure would have worked for us but as per the W3 v3 spec, it should be formatted with spdx clauses, therefore the extension. WDYT ?
FYI, Our instance is the berd-platform [1] [2]

@MahmoudMHassan MahmoudMHassan marked this pull request as ready for review December 5, 2025 10:15
consider checksums in the dcat serializer for oai-sets as per W3 dcat version 3
* add spdx clauses as parents classes and properties to checksum.

* add XML namespace prefix spdx and binds it to the SPDX RDF vocabulary at that base IRI.
Copy link
Copy Markdown
Contributor

@tmorrell tmorrell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks correct to me, though I haven't been able to find a live example of a dcat3 record that uses checksum. This needs one more review to be merged.

@utnapischtim utnapischtim added this to v14 Dec 19, 2025
@utnapischtim utnapischtim moved this to 👀 In review in v14 Dec 19, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 4, 2026

This PR was automatically marked as stale.

@github-actions github-actions Bot added the stale label Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

3 participants