Skip to content

Update to latest version of DwC-DP - #47

Merged
samleeflang merged 4 commits into
mainfrom
feature/dd-3271-update-dwcdp
Sep 18, 2026
Merged

samleeflang merged 4 commits into
mainfrom
feature/dd-3271-update-dwcdp

Conversation

@samleeflang

@samleeflang samleeflang commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Update to the latest version of the DwC-DP and add support for non-source-system jobs.

The latest version of DwC-DP: https://github.com/gbif/dwc-dp/tree/master/dwc-dp/table-schemas
As the schema's are not yet final and no central repository is hosting the schema's yet the recommendation was to include the whole schema description in the data-package.json. This resulted in a high number of lines changes.

Generated DwC-DP have been validated against the frictionless data validation tool: https://pypi.org/project/frictionless/

First touch with new formatter, tried to limit the impact to files I actually thouched.

Sonar

We don't comply with the Sonar rules where there should be no underscores in the names (that is all the issues it indicates). However, if we want to comply it means we need an additional mapping in the CsV header strategy to map all the Java names to the DwC-DP names, whcih is also ugly. I am inclined to accept the Sonar issues and keep the names as is. I will indicate the issues also with John as I don't like the mixing conventions.

Duplication happened because there is duplication of fields in the domain object which just represents the DwC-DP classes. There is no logic duplication (or not above 3.0% anyway).

AI help

AI helped identify differences and update the domain models.
AI helped update the tests to align with the latest changes.

@samleeflang
samleeflang requested a review from southeo September 16, 2026 10:09

@southeo southeo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🧄

Comment thread src/main/java/eu/dissco/exportjob/service/DwcaService.java
templateMap.put("publication_date_time", DATE_TIME_FORMATTER.format(now));
templateMap.put("number_of_source_systems", numberOfSourceSystem);
templateMap.put("package_id", UUID.randomUUID().toString());
templateMap.put("export_download_link",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is it typical to have the download link in the eml? that means we're committing to storing these files forever.

Do you check first if this dwc-dp/dwca exists? like what we have for the doi download? that could reduce storage load.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ok i see this is just moving existing logic to an abstract class, point still stands but it's probably out of scope.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes just took over the logic to a new shared DwC class as only DwC-A and DwC-DP need this logic. As we are not sure if the data has changed between the run of two exports we do not first check if it already exists. We do now keep the DwC-DP forever. Maybe at some point we get a policy that we only store them for a couple of years or something.

Comment thread src/main/java/eu/dissco/exportjob/service/AbstractDwcService.java Outdated
Comment thread src/main/resources/templates/data-package.ftl

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

formatting is weird here too

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reformatted file

@southeo

southeo commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

fyi you can "accept" these issues on sonar. Maybe you can even disable this rule for this repo?

@samleeflang
samleeflang requested a review from southeo September 18, 2026 06:57
@sonarqubecloud

Copy link
Copy Markdown

@southeo southeo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🫚

@samleeflang
samleeflang merged commit 39503e2 into main Sep 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants