Closed Markus92 closed 2 months ago
This pull request updates the discovery service to be compatible with ckanext-dcat 2.0 and prepares for CKAN 2.11. The changes primarily involve restructuring the data models for publishers, creators, and contact points, moving away from legacy fields to more structured representations using foaf:Agent
objects. This update breaks API compatibility with previous versions.
sequenceDiagram
participant CKAN as CKAN Package
participant Mapper as PackageShowMapper
participant Discovery as RetrievedDataset
CKAN->>Mapper: CkanPackage data
Mapper->>Mapper: Extract catalogue
Mapper->>Mapper: Map organization
Mapper->>Mapper: Parse dates
Mapper->>Mapper: Map creators (agents)
Mapper->>Mapper: Map publishers (agents)
Mapper->>Mapper: Map contacts
Mapper->>Mapper: Map distributions
Mapper->>Discovery: Mapped RetrievedDataset
Change | Details | Files |
---|---|---|
Refactored data models for publishers, creators, and contact points |
|
src/main/openapi/ckan.yaml src/main/openapi/discovery.yaml src/main/java/io/github/genomicdatainfrastructure/discovery/utils/PackageShowMapper.java |
Updated mapping logic in PackageShowMapper |
|
src/main/java/io/github/genomicdatainfrastructure/discovery/utils/PackageShowMapper.java |
Updated test cases to reflect new data structures |
|
src/test/java/io/github/genomicdatainfrastructure/discovery/services/PackageShowMapperTest.java |
Added new fields to CkanPackage schema |
|
src/main/openapi/ckan.yaml |
Updated RetrievedDataset schema |
|
src/main/openapi/discovery.yaml |
🚀 Pull Request Checklist
Title:
[X]
A brief, descriptive title for the changes.Description:
This pull requests updates the discovery service for the new DCAT mapping made in ckanext-dcat 2.0; This also prepares us for CKAN 2.11
Note: breaks API compatibility with previous versions! Publisher and Creator are changed compared to previous versions on the user-facing side. Legacy fields like
publisherName
andcontactUrl
have been retired in favor offoaf:Agent
objects.[X]
Provide a clear and concise description of your pull request, including the purpose of the changes and the approach you've taken.Changes are necessary for compatibility with upstream CKAN.
[X]
Why are these changes necessary? What problem do they solve? Link any related issues.Changes:
[X]
List the major changes you've made, ideally organized by commit or feature.Testing:
Tested against fresh version of
gdi-userportal-ckan-docker
with master version of ckanext-dcat, v1.3.1 of gdi-ckanext-fairdatapoint and latest version of ckanext-gdi-userportal.[X]
Describe how the changes have been tested. Include any relevant details about the testing environment and the test cases.As discussed this afternoon, will need to plan the release well ;)
[X]
Add any other information that might be useful for reviewers, such as considerations, discussions, or dependencies.[X]
I have checked that my code adheres to the project's style guidelines and that my code is well-commented.[X]
I have performed self-review of my own code and corrected any misspellings.[X]
I have made corresponding changes to the documentation (if applicable).[X]
My changes generate no new warnings or errors.[X]
I have added tests that prove my fix is effective or that my feature works.[X]
New and existing unit tests pass locally with my changes.Summary by Sourcery
Upgrade the discovery service to support the new DCAT mapping in ckanext-dcat 2.0, replacing legacy fields with
foaf:Agent
objects for publishers and creators, and update OpenAPI specifications and tests accordingly.New Features:
foaf:Agent
objects to represent publishers and creators, replacing legacy fields likepublisherName
andcontactUrl
.Enhancements:
Documentation:
Agent
objects and removal of legacy fields.Tests: