feat(serializers.dcat): Add checksum to dcat serializer#2211
feat(serializers.dcat): Add checksum to dcat serializer#2211MahmoudMHassan wants to merge 2 commits intoinveniosoftware:masterfrom
Conversation
tmorrell
left a comment
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
I think this needs to be moved after accessURL for the tests to pass.
There was a problem hiding this comment.
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]
2ed11bb to
d3a71e1
Compare
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.
037b382 to
594449e
Compare
tmorrell
left a comment
There was a problem hiding this comment.
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.
|
This PR was automatically marked as stale. |
❤️ 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: