Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions cds_migrator_kit/rdm/records/transform/models/moedal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2026 CERN.
#
# CDS-RDM is free software; you can redistribute it and/or modify it under
# the terms of the MIT License; see LICENSE file for more details.

"""CDS-RDM MoEDAL model."""

from cds_migrator_kit.rdm.collection_conf import conf_query
from cds_migrator_kit.rdm.records.transform.models._config import IGNORE_SYSTEM_KEYS
from cds_migrator_kit.rdm.records.transform.models.base_publication_record import (
rdm_base_publication_model,
)
from cds_migrator_kit.rdm.records.transform.models.research import ResearchModel
from cds_migrator_kit.transform.overdo import CdsOverdo


class MoEDALModel(CdsOverdo):
"""Translation model for MoEDAL."""

__query__ = conf_query("moedal")

__ignore_keys__ = IGNORE_SYSTEM_KEYS | ResearchModel.__ignore_keys__

_default_fields = {
"custom_fields": {},
}


moedal_model = MoEDALModel(
bases=(rdm_base_publication_model,),
entry_point_group="cds_migrator_kit.migrator.rules.moedal",
)
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,8 @@ def resource_type(self, key, value):
"technical note": {"id": "publication-technicalnote"},
"minutes": {"id": "publication-meetingminutes"},
"presentation": {"id": "presentation"},
"moedal_internal_notes": {"id": "publication-technicalnote"},
"moedal_notes": {"id": "publication-technicalnote"},
}

try:
Expand Down
11 changes: 11 additions & 0 deletions migration_cli/collections/moedal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: moedal
queries:
- q: '980__a:PREPRINT AND 693__e:MoEDAL OR 980__a:ARTICLE AND 693__e:MoEDAL OR 980:MoEDAL_NOTES OR 980:MoEDAL_INTERNAL_NOTES'

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.

does this give the correct amount of results? No parenthesis needed?

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

dump_file_prefix: moedal
flags:
include_plots: true
create_inclusion_request: true
preferred_model: moedal
# These community slugs must exist in the target environment.
communities:
- moedal

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.

nit: please align on the community slug before going to prod - we should follow a convention, normally we have some "collaboration" suffix in the name

5 changes: 5 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ cds_migrator_kit.migrator.models =
isolde = cds_migrator_kit.rdm.records.transform.models.isolde:isolde_model
north_area = cds_migrator_kit.rdm.records.transform.models.north_area:north_area_model
hie_isolde = cds_migrator_kit.rdm.records.transform.models.hie_isolde:hie_isolde_model
moedal = cds_migrator_kit.rdm.records.transform.models.moedal:moedal_model

cds_migrator_kit.migrator.rules.base =
base = cds_migrator_kit.transform.xml_processing.rules.base
Expand Down Expand Up @@ -257,6 +258,10 @@ cds_migrator_kit.migrator.rules.hie_isolde =
base = cds_migrator_kit.transform.xml_processing.rules.base
base_records = cds_migrator_kit.rdm.records.transform.xml_processing.rules.base
publication = cds_migrator_kit.rdm.records.transform.xml_processing.rules.research
cds_migrator_kit.migrator.rules.moedal =
base = cds_migrator_kit.transform.xml_processing.rules.base
base_records = cds_migrator_kit.rdm.records.transform.xml_processing.rules.base
publication = cds_migrator_kit.rdm.records.transform.xml_processing.rules.research
cds_migrator_kit.migrator.rules.people =
people = cds_migrator_kit.rdm.users.transform.xml_processing.rules.people
invenio_pidstore.minters =
Expand Down
Loading