Scheduled service maintenance on November 22


On Friday, November 22, 2024, between 06:00 CET and 18:00 CET, GIN services will undergo planned maintenance. Extended service interruptions should be expected. We will try to keep downtimes to a minimum, but recommend that users avoid critical tasks, large data uploads, or DOI requests during this time.

We apologize for any inconvenience.

treeversionlistcreator.py 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. import time
  2. from typing import Dict, Tuple
  3. from uuid import UUID
  4. from dataladmetadatamodel.datasettree import DatasetTree
  5. from dataladmetadatamodel.metadatarootrecord import MetadataRootRecord
  6. from dataladmetadatamodel.versionlist import TreeVersionList
  7. def create_tree_version_list_for_mrrs(
  8. mapper_family: str,
  9. realm: str,
  10. metadata_root_records: Dict[Tuple[UUID, str, str], MetadataRootRecord]
  11. ) -> TreeVersionList:
  12. dataset_tree = DatasetTree()
  13. for id_version_path, metadata_root_record in metadata_root_records.items():
  14. dataset_id, dataset_version, relative_path = id_version_path
  15. dataset_tree.add_dataset(relative_path, metadata_root_record)
  16. top_level_version = tuple(
  17. filter(
  18. lambda ivp_mrr: ivp_mrr[0][2] == "",
  19. metadata_root_records.items()))[0][0][1]
  20. tree_version_list = TreeVersionList()
  21. tree_version_list.set_dataset_tree(
  22. top_level_version,
  23. str(time.time()),
  24. dataset_tree
  25. )
  26. return tree_version_list