From e0bd48a88511e337913ff43c771b2c4a8c923246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Z=C3=BCbeyde=20Civelek?= Date: Tue, 18 Aug 2026 14:55:15 +0200 Subject: [PATCH] add(lhcf): add streams for lhcf collection --- .../rdm/records/transform/models/en.py | 2 +- .../rdm/records/transform/models/lhcf.py | 24 +++++++++++++++++++ .../rdm/records/transform/models/research.py | 2 +- .../xml_processing/rules/research.py | 4 ++++ cds_migrator_kit/rdm/streams.yaml | 22 +++++++++++++++++ setup.cfg | 1 + 6 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 cds_migrator_kit/rdm/records/transform/models/lhcf.py diff --git a/cds_migrator_kit/rdm/records/transform/models/en.py b/cds_migrator_kit/rdm/records/transform/models/en.py index ab756161..edf56e1d 100644 --- a/cds_migrator_kit/rdm/records/transform/models/en.py +++ b/cds_migrator_kit/rdm/records/transform/models/en.py @@ -15,7 +15,7 @@ class ENModel(CdsOverdo): """Translation model for MoUs.""" - __query__ = "980__:INTNOTEENPUBL OR (980__:ARTICLE OR 980__:PREPRINT AND 710__.5:EN) OR 980__:ENLIB -980__:THESIS" + __query__ = "980__:INTNOTEENPUBL OR (980__:ARTICLE OR 980__:PREPRINT AND 710__.5:EN) OR 980__:ENLIB -980__:THESIS -980__:LHCf_Papers -980__:LHCf_Proc -980__:LHCf_Reports" __ignore_keys__ = { "0248_a", diff --git a/cds_migrator_kit/rdm/records/transform/models/lhcf.py b/cds_migrator_kit/rdm/records/transform/models/lhcf.py new file mode 100644 index 00000000..3d04eff3 --- /dev/null +++ b/cds_migrator_kit/rdm/records/transform/models/lhcf.py @@ -0,0 +1,24 @@ +# -*- 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 LHCf model.""" +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 + + +class LHCfModel(ResearchModel): + """Translation model for LHCf.""" + + __query__ = "980__:LHCf_Papers OR 980__:LHCf_Proc OR 980__:LHCf_Reports -980__:THESIS -980:SCICOMMPUBLLHCC -980__:DELETED -980__.a:DUMMY -690C_.a:SCICOM" + + +lhcf_model = LHCfModel( + bases=(rdm_base_publication_model,), + entry_point_group="cds_migrator_kit.migrator.rdm.rules.research", +) diff --git a/cds_migrator_kit/rdm/records/transform/models/research.py b/cds_migrator_kit/rdm/records/transform/models/research.py index 5bef9aa4..b7a22b48 100644 --- a/cds_migrator_kit/rdm/records/transform/models/research.py +++ b/cds_migrator_kit/rdm/records/transform/models/research.py @@ -15,7 +15,7 @@ class ResearchModel(CdsOverdo): """Translation model for research.""" - __query__ = '693__.e:"DAMPE RE29" OR 037__:DIRAC-NOTE* OR 037__:DIRAC-Note* OR 037__:DIRAC-CONF* OR 037__:DIRAC-DOC* OR 037__:DIRAC-PUB* OR 693__:UA2 OR 693__:UA4 OR 693__:UA5 OR 693__:UA8 OR 980__:INTNOTEHARPCDPPUBL OR 980__:PRIVIMXGAM -980__:THESIS -037__:CERN-STUDENTS-Note-* -980__:DELETED -980__.c:MIGRATED -980__.a:DUMMY -690C_.a:SCICOM' + __query__ = '693__.e:"DAMPE RE29" OR 037__:DIRAC-NOTE* OR 037__:DIRAC-Note* OR 037__:DIRAC-CONF* OR 037__:DIRAC-DOC* OR 037__:DIRAC-PUB* OR 693__:UA2 OR 693__:UA4 OR 693__:UA5 OR 693__:UA8 OR 980__:INTNOTEHARPCDPPUBL OR 980__:PRIVIMXGAM -980__:THESIS -037__:CERN-STUDENTS-Note-* -980__:DELETED -980__.a:DUMMY -690C_.a:SCICOM' __ignore_keys__ = { "0248_a", diff --git a/cds_migrator_kit/rdm/records/transform/xml_processing/rules/research.py b/cds_migrator_kit/rdm/records/transform/xml_processing/rules/research.py index 3cb4794f..6d851c38 100644 --- a/cds_migrator_kit/rdm/records/transform/xml_processing/rules/research.py +++ b/cds_migrator_kit/rdm/records/transform/xml_processing/rules/research.py @@ -784,6 +784,10 @@ def resource_type(self, key, value): "slide": {"id": "presentation"}, "faser_papers": {"id": "publication-article"}, "demsuppliers": {"id": "other"}, + "lhcf_papers": {"id": "publication-article"}, + "lhcf_proc": {"id": "publication-conferenceproceeding"}, + "lhcf_reports": {"id": "publication-report"}, + "conferencepapers": {"id": "publication-conferencepaper"}, } try: diff --git a/cds_migrator_kit/rdm/streams.yaml b/cds_migrator_kit/rdm/streams.yaml index aeb22a39..bd80235b 100644 --- a/cds_migrator_kit/rdm/streams.yaml +++ b/cds_migrator_kit/rdm/streams.yaml @@ -609,6 +609,28 @@ records: - "c2c46ab3-5fb4-4d86-83c6-5d9dc8392d6f" load: legacy_pids_to_redirect: cds_migrator_kit/rdm/data/div_msc/duplicated_pids.json + lhcf: + data_dir: cds_migrator_kit/rdm/data/lhcf + plots: true + create_inclusion_request: true + extract: + dirpath: cds_migrator_kit/rdm/data/lhcf/dump/ + transform: + files_dump_dir: cds_migrator_kit/rdm/data/lhcf/files/ + missing_users: cds_migrator_kit/rdm/data/users + communities_ids: + - "88a105fe-4713-493b-b555-6ab398599d21" + lhcf-ep: + data_dir: cds_migrator_kit/rdm/data/lhcf-ep + plots: true + create_inclusion_request: true + extract: + dirpath: cds_migrator_kit/rdm/data/lhcf-ep/dump/ + transform: + files_dump_dir: cds_migrator_kit/rdm/data/lhcf-ep/files/ + missing_users: cds_migrator_kit/rdm/data/users + communities_ids: + - "88a105fe-4713-493b-b555-6ab398599d21" comments: faser-drafts: dir_path: /migration/faser-drafts/comments/ diff --git a/setup.cfg b/setup.cfg index aedb5a9c..6ddede48 100644 --- a/setup.cfg +++ b/setup.cfg @@ -70,6 +70,7 @@ cds_migrator_kit.migrator.submitter.model = cds_migrator_kit.migrator.models = research = cds_migrator_kit.rdm.records.transform.models.research:research_model lep_research = cds_migrator_kit.rdm.records.transform.models.lep:lep_research_model + lhcf = cds_migrator_kit.rdm.records.transform.models.lhcf:lhcf_model antares = cds_migrator_kit.rdm.records.transform.models.antares:antares_research_model lcd = cds_migrator_kit.rdm.records.transform.models.lcd:lcd_research_model research_comm_model = cds_migrator_kit.rdm.records.transform.models.research_committee:research_comm_model