Skip to content
Draft
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
44 changes: 44 additions & 0 deletions cds_migrator_kit/rdm/records/transform/models/aleph.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# -*- 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 CMS note model."""
from cds_migrator_kit.rdm.records.transform.models.base_publication_record import (
rdm_base_publication_model,
)
from cds_migrator_kit.transform.overdo import CdsOverdo


class AlephModel(CdsOverdo):
"""Translation model for Aleph."""

__query__ = (
"980__:ALEPHDRAFT"
)

__ignore_keys__ = {
"0248_a",
"0248_p",
}

_default_fields = {
"resource_type": {"id": "publication-report"},
"custom_fields": {},
"creators": [
{
"person_or_org": {
"type": "organizational",
"name": "European Organization for Nuclear Research",
}
}
],
}


aleph_model = AlephModel(
bases=(rdm_base_publication_model,),
entry_point_group="cds_migrator_kit.migrator.rules.aleph",
)
44 changes: 44 additions & 0 deletions cds_migrator_kit/rdm/records/transform/models/lcd.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2025 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 CMS note model."""
from cds_migrator_kit.rdm.records.transform.models.base_publication_record import (
rdm_base_publication_model,
)
from cds_migrator_kit.transform.overdo import CdsOverdo


class LCDModel(CdsOverdo):
"""Translation model for LCD."""

__query__ = (
'980__:LCD-NOTES AND 591__:"draft"'
)

__ignore_keys__ = {
"0248_a",
"0248_p",
}

_default_fields = {
"resource_type": {"id": "publication-report"},
"custom_fields": {},
"creators": [
{
"person_or_org": {
"type": "organizational",
"name": "European Organization for Nuclear Research",
}
}
],
}


lcd_model = LCDModel(
bases=(rdm_base_publication_model,),
entry_point_group="cds_migrator_kit.migrator.rules.lcd",
)
44 changes: 44 additions & 0 deletions cds_migrator_kit/rdm/records/transform/models/re29.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2025 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 CMS note model."""
from cds_migrator_kit.rdm.records.transform.models.base_publication_record import (
rdm_base_publication_model,
)
from cds_migrator_kit.transform.overdo import CdsOverdo


class Re29Model(CdsOverdo):
"""Translation model for Re29."""

__query__ = (
'980__a:CONFERENCEPAPER OR 980__a:ARTICLE OR 980__a:PREPRINT AND 693__e:"DAMPE RE29" OR 591__:"Not approved" '
)

__ignore_keys__ = {
"0248_a",
"0248_p",
}

_default_fields = {
"resource_type": {"id": "publication-report"},
"custom_fields": {},
"creators": [
{
"person_or_org": {
"type": "organizational",
"name": "European Organization for Nuclear Research",
}
}
],
}


re29_model = Re29Model(
bases=(rdm_base_publication_model,),
entry_point_group="cds_migrator_kit.migrator.rules.re29",
)
40 changes: 40 additions & 0 deletions cds_migrator_kit/rdm/streams.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,43 @@ records:
missing_users: cds_migrator_kit/rdm/data/users
communities_ids:
- ""
aleph:
data_dir: cds_migrator_kit/rdm/data/aleph
tmp_dir: cds_migrator_kit/rdm/tmp/aleph
log_dir: cds_migrator_kit/rdm/log/aleph
extract:
dirpath: cds_migrator_kit/rdm/data/aleph/dump/
transform:
files_dump_dir: cds_migrator_kit/rdm/data/aleph/files/
missing_users: cds_migrator_kit/rdm/data/users
communities_ids:
- "946c9d60-1e10-4996-ae1d-c5add94acd7b" # needs to be updated with the id on prod
load:
legacy_pids_to_redirect: cds_migrator_kit/rdm/data/aleph/duplicated_pids.json
lcd:
data_dir: cds_migrator_kit/rdm/data/lcd
tmp_dir: cds_migrator_kit/rdm/tmp/lcd
log_dir: cds_migrator_kit/rdm/log/lcd
extract:
dirpath: cds_migrator_kit/rdm/data/lcd/dump/
transform:
files_dump_dir: cds_migrator_kit/rdm/data/lcd/files/
missing_users: cds_migrator_kit/rdm/data/users
communities_ids:
- "c241b972-4510-4f80-87cb-cbb500e0be88" # needs to be updated with the id on prod
load:
legacy_pids_to_redirect: cds_migrator_kit/rdm/data/lcd/duplicated_pids.json
re29:
data_dir: cds_migrator_kit/rdm/data/re29
tmp_dir: cds_migrator_kit/rdm/tmp/re29
log_dir: cds_migrator_kit/rdm/log/re29
restricted: "True"
extract:
dirpath: cds_migrator_kit/rdm/data/re29/dump/
transform:
files_dump_dir: cds_migrator_kit/rdm/data/re29/files/
missing_users: cds_migrator_kit/rdm/data/users
communities_ids:
- "18def4bb-a5c7-4597-a54e-ec5f205c1e58" # needs to be updated with the id on prod
load:
legacy_pids_to_redirect: cds_migrator_kit/rdm/data/re29/duplicated_pids.json
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ cds_migrator_kit.migrator.models =
te = cds_migrator_kit.rdm.records.transform.models.te:te_model
en = cds_migrator_kit.rdm.records.transform.models.en:en_model
annual_rep = cds_migrator_kit.rdm.records.transform.models.annual_report:annual_rep_model
aleph = cds_migrator_kit.rdm.records.transform.models.aleph:aleph_model
lcd = cds_migrator_kit.rdm.records.transform.models.lcd:lcd_model
re29 = cds_migrator_kit.rdm.records.transform.models.re29:re29_model
fap = cds_migrator_kit.rdm.records.transform.models.fap:fap_model
cds_migrator_kit.migrator.rules.base =
base = cds_migrator_kit.transform.xml_processing.rules.base
Expand Down
Loading