GenomicDataInfrastructure / gdi-userportal-dataset-discovery-service

0 stars 1 forks source link

feat(mapping): Update mapping with missing fields after updating to C… #157

Closed hcvdwerf closed 1 week ago

hcvdwerf commented 1 week ago

…KAN DCAT EXTENSION 2.1.0

🚀 Pull Request Checklist

Summary by Sourcery

Enhance the mapping by adding missing fields 'uri' and 'identifier' to contact points and agents after upgrading to DCAT CKAN extension 2.1.0. Update YAML configurations and modify unit tests to ensure compliance with DCAT AP 3.

New Features:

Enhancements:

Tests:

sourcery-ai[bot] commented 1 week ago

Reviewer's Guide by Sourcery

This PR updates the data model and mapping logic to accommodate new fields introduced in CKAN DCAT Extension 2.1.0. The changes primarily focus on adding URI fields to Agent entities (publisher/creator) and identifier fields to contact points, ensuring better compliance with DCAT AP 3.

ER diagram for updated CKAN data model

erDiagram
    CkanContactPoint {
        string name
        string email
        string uri
        string identifier
    }
    CkanAgent {
        string name
        string email
        string url
        string type
        string uri
    }
    ContactPoint {
        string name
        string email
        string uri
        string identifier
    }
    Agent {
        string name
        string email
        string url
        string type
        string uri
        string identifier
    }

Updated class diagram for CKAN mapping

classDiagram
    class CkanContactPoint {
        +String name
        +String email
        +String uri
        +String identifier
    }
    class CkanAgent {
        +String name
        +String email
        +String url
        +String type
        +String uri
    }
    class ContactPoint {
        +String name
        +String email
        +String uri
        +String identifier
    }
    class Agent {
        +String name
        +String email
        +String url
        +String type
        +String uri
        +String identifier
    }
    CkanContactPoint --> ContactPoint
    CkanAgent --> Agent

File-Level Changes

Change Details Files
Added new fields to OpenAPI specifications for ContactPoint and Agent entities
  • Added 'identifier' field to ContactPoint schema
  • Added 'uri' field to Agent schema
src/main/openapi/ckan.yaml
src/main/openapi/discovery.yaml
Updated mapping implementations to handle new fields
  • Added URI mapping in agent parser
  • Added identifier mapping in contact point conversion
src/main/java/io/github/genomicdatainfrastructure/discovery/datasets/infrastructure/ckan/utils/CkanAgentParser.java
src/main/java/io/github/genomicdatainfrastructure/discovery/datasets/infrastructure/ckan/utils/PackageShowMapper.java
Updated unit tests to verify new field mappings
  • Added test cases for contact point identifier field
  • Added test cases for agent URI field
src/test/java/io/github/genomicdatainfrastructure/discovery/services/PackageShowMapperTest.java

Tips and commands #### Interacting with Sourcery - **Trigger a new review:** Comment `@sourcery-ai review` on the pull request. - **Continue discussions:** Reply directly to Sourcery's review comments. - **Generate a GitHub issue from a review comment:** Ask Sourcery to create an issue from a review comment by replying to it. - **Generate a pull request title:** Write `@sourcery-ai` anywhere in the pull request title to generate a title at any time. - **Generate a pull request summary:** Write `@sourcery-ai summary` anywhere in the pull request body to generate a PR summary at any time. You can also use this command to specify where the summary should be inserted. #### Customizing Your Experience Access your [dashboard](https://app.sourcery.ai) to: - Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others. - Change the review language. - Add, remove or edit custom review instructions. - Adjust other review settings. #### Getting Help - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).