dsp-tools 17.0.0.post10__tar.gz → 17.0.0.post14__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of dsp-tools might be problematic. Click here for more details.

Files changed (253) hide show
  1. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/PKG-INFO +1 -1
  2. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/pyproject.toml +2 -1
  3. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/cli/call_action.py +68 -25
  4. dsp_tools-17.0.0.post14/src/dsp_tools/commands/create/constants.py +4 -0
  5. dsp_tools-17.0.0.post14/src/dsp_tools/commands/create/models/input_problems.py +23 -0
  6. dsp_tools-17.0.0.post14/src/dsp_tools/commands/create/models/parsed_ontology.py +48 -0
  7. dsp_tools-17.0.0.post14/src/dsp_tools/commands/create/models/parsed_project.py +49 -0
  8. dsp_tools-17.0.0.post14/src/dsp_tools/commands/create/parsing/parse_ontology.py +108 -0
  9. dsp_tools-17.0.0.post14/src/dsp_tools/commands/create/parsing/parse_project.py +99 -0
  10. dsp_tools-17.0.0.post14/src/dsp_tools/commands/create/parsing/parsing_utils.py +43 -0
  11. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/error/exceptions.py +12 -0
  12. dsp_tools-17.0.0.post14/src/dsp_tools/xmllib/internal/__init__.py +0 -0
  13. dsp_tools-17.0.0.post14/src/dsp_tools/xmllib/models/__init__.py +0 -0
  14. dsp_tools-17.0.0.post14/src/dsp_tools/xmllib/models/internal/__init__.py +0 -0
  15. dsp_tools-17.0.0.post14/src/dsp_tools/xmllib/models/licenses/__init__.py +0 -0
  16. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/docs/index.md +0 -0
  17. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/__init__.py +0 -0
  18. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/cli/__init__.py +0 -0
  19. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/cli/args.py +0 -0
  20. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/cli/create_parsers.py +0 -0
  21. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/cli/entry_point.py +0 -0
  22. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/clients/__init__.py +0 -0
  23. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/clients/authentication_client.py +0 -0
  24. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/clients/authentication_client_live.py +0 -0
  25. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/clients/connection.py +0 -0
  26. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/clients/connection_live.py +0 -0
  27. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/clients/fuseki_metrics.py +0 -0
  28. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/clients/legal_info_client.py +0 -0
  29. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/clients/legal_info_client_live.py +0 -0
  30. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/__init__.py +0 -0
  31. {dsp_tools-17.0.0.post10/src/dsp_tools/commands/excel2json → dsp_tools-17.0.0.post14/src/dsp_tools/commands/create}/__init__.py +0 -0
  32. {dsp_tools-17.0.0.post10/src/dsp_tools/commands/excel2json/lists → dsp_tools-17.0.0.post14/src/dsp_tools/commands/create/models}/__init__.py +0 -0
  33. {dsp_tools-17.0.0.post10/src/dsp_tools/commands/excel2json/lists/models → dsp_tools-17.0.0.post14/src/dsp_tools/commands/create/parsing}/__init__.py +0 -0
  34. /dsp_tools-17.0.0.post10/src/dsp_tools/commands/excel2json/models/__init__.py → /dsp_tools-17.0.0.post14/src/dsp_tools/commands/create/parsing/parse_lists.py +0 -0
  35. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/excel2json/CLAUDE.md +0 -0
  36. {dsp_tools-17.0.0.post10/src/dsp_tools/commands/ingest_xmlupload → dsp_tools-17.0.0.post14/src/dsp_tools/commands/excel2json}/__init__.py +0 -0
  37. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/excel2json/json_header.py +0 -0
  38. {dsp_tools-17.0.0.post10/src/dsp_tools/commands/ingest_xmlupload/create_resources → dsp_tools-17.0.0.post14/src/dsp_tools/commands/excel2json/lists}/__init__.py +0 -0
  39. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/excel2json/lists/compliance_checks.py +0 -0
  40. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/excel2json/lists/make_lists.py +0 -0
  41. {dsp_tools-17.0.0.post10/src/dsp_tools/commands/ingest_xmlupload/ingest_files → dsp_tools-17.0.0.post14/src/dsp_tools/commands/excel2json/lists/models}/__init__.py +0 -0
  42. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/excel2json/lists/models/deserialise.py +0 -0
  43. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/excel2json/lists/models/input_error.py +0 -0
  44. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/excel2json/lists/models/serialise.py +0 -0
  45. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/excel2json/lists/utils.py +0 -0
  46. {dsp_tools-17.0.0.post10/src/dsp_tools/commands/ingest_xmlupload/upload_files → dsp_tools-17.0.0.post14/src/dsp_tools/commands/excel2json/models}/__init__.py +0 -0
  47. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/excel2json/models/input_error.py +0 -0
  48. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/excel2json/models/json_header.py +0 -0
  49. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/excel2json/models/list_node_name.py +0 -0
  50. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/excel2json/models/ontology.py +0 -0
  51. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/excel2json/old_lists.py +0 -0
  52. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/excel2json/project.py +0 -0
  53. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/excel2json/properties.py +0 -0
  54. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/excel2json/resources.py +0 -0
  55. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/excel2json/utils.py +0 -0
  56. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/excel2xml/__init__.py +0 -0
  57. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/excel2xml/excel2xml_cli.py +0 -0
  58. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/excel2xml/excel2xml_lib.py +0 -0
  59. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/excel2xml/propertyelement.py +0 -0
  60. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/id2iri.py +0 -0
  61. {dsp_tools-17.0.0.post10/src/dsp_tools/commands/project → dsp_tools-17.0.0.post14/src/dsp_tools/commands/ingest_xmlupload}/__init__.py +0 -0
  62. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/ingest_xmlupload/bulk_ingest_client.py +0 -0
  63. {dsp_tools-17.0.0.post10/src/dsp_tools/commands/project/create → dsp_tools-17.0.0.post14/src/dsp_tools/commands/ingest_xmlupload/create_resources}/__init__.py +0 -0
  64. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/ingest_xmlupload/create_resources/apply_ingest_id.py +0 -0
  65. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/ingest_xmlupload/create_resources/upload_xml.py +0 -0
  66. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/ingest_xmlupload/create_resources/user_information.py +0 -0
  67. {dsp_tools-17.0.0.post10/src/dsp_tools/commands/project/get → dsp_tools-17.0.0.post14/src/dsp_tools/commands/ingest_xmlupload/ingest_files}/__init__.py +0 -0
  68. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/ingest_xmlupload/ingest_files/ingest_files.py +0 -0
  69. {dsp_tools-17.0.0.post10/src/dsp_tools/commands/project/legacy_models → dsp_tools-17.0.0.post14/src/dsp_tools/commands/ingest_xmlupload/upload_files}/__init__.py +0 -0
  70. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/ingest_xmlupload/upload_files/filechecker.py +0 -0
  71. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/ingest_xmlupload/upload_files/input_error.py +0 -0
  72. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/ingest_xmlupload/upload_files/upload_failures.py +0 -0
  73. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/ingest_xmlupload/upload_files/upload_files.py +0 -0
  74. {dsp_tools-17.0.0.post10/src/dsp_tools/commands/project/models → dsp_tools-17.0.0.post14/src/dsp_tools/commands/project}/__init__.py +0 -0
  75. {dsp_tools-17.0.0.post10/src/dsp_tools/commands/resume_xmlupload → dsp_tools-17.0.0.post14/src/dsp_tools/commands/project/create}/__init__.py +0 -0
  76. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/project/create/parse_project.py +0 -0
  77. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/project/create/project_create_all.py +0 -0
  78. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/project/create/project_create_default_permissions.py +0 -0
  79. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/project/create/project_create_lists.py +0 -0
  80. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/project/create/project_create_ontologies.py +0 -0
  81. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/project/create/project_validate.py +0 -0
  82. {dsp_tools-17.0.0.post10/src/dsp_tools/commands/validate_data → dsp_tools-17.0.0.post14/src/dsp_tools/commands/project/get}/__init__.py +0 -0
  83. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/project/get/get.py +0 -0
  84. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/project/get/get_permissions.py +0 -0
  85. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/project/get/get_permissions_legacy.py +0 -0
  86. {dsp_tools-17.0.0.post10/src/dsp_tools/commands/validate_data/models → dsp_tools-17.0.0.post14/src/dsp_tools/commands/project/legacy_models}/__init__.py +0 -0
  87. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/project/legacy_models/context.py +0 -0
  88. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/project/legacy_models/group.py +0 -0
  89. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/project/legacy_models/helpers.py +0 -0
  90. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/project/legacy_models/listnode.py +0 -0
  91. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/project/legacy_models/model.py +0 -0
  92. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/project/legacy_models/ontology.py +0 -0
  93. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/project/legacy_models/project.py +0 -0
  94. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/project/legacy_models/propertyclass.py +0 -0
  95. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/project/legacy_models/resourceclass.py +0 -0
  96. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/project/legacy_models/user.py +0 -0
  97. {dsp_tools-17.0.0.post10/src/dsp_tools/commands/validate_data/prepare_data → dsp_tools-17.0.0.post14/src/dsp_tools/commands/project/models}/__init__.py +0 -0
  98. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/project/models/permissions_client.py +0 -0
  99. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/project/models/permissions_models.py +0 -0
  100. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/project/models/project_definition.py +0 -0
  101. {dsp_tools-17.0.0.post10/src/dsp_tools/commands/validate_data/process_validation_report → dsp_tools-17.0.0.post14/src/dsp_tools/commands/resume_xmlupload}/__init__.py +0 -0
  102. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/resume_xmlupload/resume_xmlupload.py +0 -0
  103. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/start_stack.py +0 -0
  104. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/validate_data/CLAUDE.md +0 -0
  105. {dsp_tools-17.0.0.post10/src/dsp_tools/commands/validate_data/sparql → dsp_tools-17.0.0.post14/src/dsp_tools/commands/validate_data}/__init__.py +0 -0
  106. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/validate_data/api_clients.py +0 -0
  107. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/validate_data/constants.py +0 -0
  108. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/validate_data/mappers.py +0 -0
  109. {dsp_tools-17.0.0.post10/src/dsp_tools/commands/validate_data/validation → dsp_tools-17.0.0.post14/src/dsp_tools/commands/validate_data/models}/__init__.py +0 -0
  110. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/validate_data/models/api_responses.py +0 -0
  111. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/validate_data/models/input_problems.py +0 -0
  112. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/validate_data/models/rdf_like_data.py +0 -0
  113. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/validate_data/models/validation.py +0 -0
  114. {dsp_tools-17.0.0.post10/src/dsp_tools/commands/xmlupload → dsp_tools-17.0.0.post14/src/dsp_tools/commands/validate_data/prepare_data}/__init__.py +0 -0
  115. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/validate_data/prepare_data/get_rdf_like_data.py +0 -0
  116. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/validate_data/prepare_data/make_data_graph.py +0 -0
  117. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/validate_data/prepare_data/prepare_data.py +0 -0
  118. {dsp_tools-17.0.0.post10/src/dsp_tools/commands/xmlupload/make_rdf_graph → dsp_tools-17.0.0.post14/src/dsp_tools/commands/validate_data/process_validation_report}/__init__.py +0 -0
  119. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/validate_data/process_validation_report/get_user_validation_message.py +0 -0
  120. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/validate_data/process_validation_report/query_validation_result.py +0 -0
  121. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/validate_data/process_validation_report/reformat_validation_results.py +0 -0
  122. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/validate_data/shacl_cli_validator.py +0 -0
  123. {dsp_tools-17.0.0.post10/src/dsp_tools/commands/xmlupload/models → dsp_tools-17.0.0.post14/src/dsp_tools/commands/validate_data/sparql}/__init__.py +0 -0
  124. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/validate_data/sparql/cardinality_shacl.py +0 -0
  125. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/validate_data/sparql/construct_shacl.py +0 -0
  126. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/validate_data/sparql/legal_info_shacl.py +0 -0
  127. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/validate_data/sparql/value_shacl.py +0 -0
  128. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/validate_data/utils.py +0 -0
  129. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/validate_data/validate_data.py +0 -0
  130. {dsp_tools-17.0.0.post10/src/dsp_tools/commands/xmlupload/models/processed → dsp_tools-17.0.0.post14/src/dsp_tools/commands/validate_data/validation}/__init__.py +0 -0
  131. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/validate_data/validation/check_duplicate_files.py +0 -0
  132. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/validate_data/validation/check_for_unknown_classes.py +0 -0
  133. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/validate_data/validation/get_validation_report.py +0 -0
  134. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/validate_data/validation/validate_ontology.py +0 -0
  135. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/CLAUDE.md +0 -0
  136. {dsp_tools-17.0.0.post10/src/dsp_tools/commands/xmlupload/prepare_xml_input → dsp_tools-17.0.0.post14/src/dsp_tools/commands/xmlupload}/__init__.py +0 -0
  137. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/iri_resolver.py +0 -0
  138. {dsp_tools-17.0.0.post10/src/dsp_tools/commands/xmlupload/stash → dsp_tools-17.0.0.post14/src/dsp_tools/commands/xmlupload/make_rdf_graph}/__init__.py +0 -0
  139. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/make_rdf_graph/constants.py +0 -0
  140. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/make_rdf_graph/jsonld_utils.py +0 -0
  141. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/make_rdf_graph/make_file_value.py +0 -0
  142. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/make_rdf_graph/make_resource_and_values.py +0 -0
  143. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/make_rdf_graph/make_values.py +0 -0
  144. {dsp_tools-17.0.0.post10/src/dsp_tools/config → dsp_tools-17.0.0.post14/src/dsp_tools/commands/xmlupload/models}/__init__.py +0 -0
  145. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/models/bitstream_info.py +0 -0
  146. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/models/formatted_text_value.py +0 -0
  147. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/models/ingest.py +0 -0
  148. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/models/input_problems.py +0 -0
  149. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/models/lookup_models.py +0 -0
  150. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/models/permission.py +0 -0
  151. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/models/permissions_parsed.py +0 -0
  152. {dsp_tools-17.0.0.post10/src/dsp_tools/error → dsp_tools-17.0.0.post14/src/dsp_tools/commands/xmlupload/models/processed}/__init__.py +0 -0
  153. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/models/processed/file_values.py +0 -0
  154. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/models/processed/res.py +0 -0
  155. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/models/processed/values.py +0 -0
  156. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/models/rdf_models.py +0 -0
  157. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/models/upload_clients.py +0 -0
  158. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/models/upload_state.py +0 -0
  159. {dsp_tools-17.0.0.post10/src/dsp_tools/legacy_models → dsp_tools-17.0.0.post14/src/dsp_tools/commands/xmlupload/prepare_xml_input}/__init__.py +0 -0
  160. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/prepare_xml_input/ark2iri.py +0 -0
  161. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/prepare_xml_input/get_processed_resources.py +0 -0
  162. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/prepare_xml_input/iiif_uri_validator.py +0 -0
  163. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/prepare_xml_input/list_client.py +0 -0
  164. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/prepare_xml_input/prepare_xml_input.py +0 -0
  165. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/prepare_xml_input/read_validate_xml_file.py +0 -0
  166. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/prepare_xml_input/transform_input_values.py +0 -0
  167. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/project_client.py +0 -0
  168. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/resource_create_client.py +0 -0
  169. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/richtext_id2iri.py +0 -0
  170. {dsp_tools-17.0.0.post10/src/dsp_tools/utils → dsp_tools-17.0.0.post14/src/dsp_tools/commands/xmlupload/stash}/__init__.py +0 -0
  171. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/stash/analyse_circular_reference_graph.py +0 -0
  172. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/stash/create_info_for_graph.py +0 -0
  173. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/stash/graph_models.py +0 -0
  174. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/stash/stash_circular_references.py +0 -0
  175. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/stash/stash_models.py +0 -0
  176. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/stash/upload_stashed_resptr_props.py +0 -0
  177. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/stash/upload_stashed_xml_texts.py +0 -0
  178. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/upload_config.py +0 -0
  179. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/write_diagnostic_info.py +0 -0
  180. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/commands/xmlupload/xmlupload.py +0 -0
  181. {dsp_tools-17.0.0.post10/src/dsp_tools/utils/data_formats → dsp_tools-17.0.0.post14/src/dsp_tools/config}/__init__.py +0 -0
  182. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/config/logger_config.py +0 -0
  183. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/config/warnings_config.py +0 -0
  184. {dsp_tools-17.0.0.post10/src/dsp_tools/utils/xml_parsing → dsp_tools-17.0.0.post14/src/dsp_tools/error}/__init__.py +0 -0
  185. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/error/custom_warnings.py +0 -0
  186. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/error/problems.py +0 -0
  187. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/error/xmllib_errors.py +0 -0
  188. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/error/xmllib_warnings.py +0 -0
  189. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/error/xmllib_warnings_util.py +0 -0
  190. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/error/xsd_validation_error_msg.py +0 -0
  191. {dsp_tools-17.0.0.post10/src/dsp_tools/utils/xml_parsing/models → dsp_tools-17.0.0.post14/src/dsp_tools/legacy_models}/__init__.py +0 -0
  192. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/legacy_models/datetimestamp.py +0 -0
  193. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/legacy_models/langstring.py +0 -0
  194. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/legacy_models/projectContext.py +0 -0
  195. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/py.typed +0 -0
  196. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/resources/schema/data.xsd +0 -0
  197. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/resources/schema/lists-only.json +0 -0
  198. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/resources/schema/project.json +0 -0
  199. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/resources/schema/properties-only.json +0 -0
  200. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/resources/schema/resources-only.json +0 -0
  201. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/resources/start-stack/docker-compose.override-host.j2 +0 -0
  202. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/resources/start-stack/docker-compose.override.yml +0 -0
  203. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/resources/start-stack/docker-compose.yml +0 -0
  204. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/resources/start-stack/dsp-app-config.json +0 -0
  205. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/resources/start-stack/dsp-app-config.override-host.j2 +0 -0
  206. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/resources/validate_data/api-shapes-resource-cardinalities.ttl +0 -0
  207. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/resources/validate_data/api-shapes.ttl +0 -0
  208. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/resources/validate_data/shacl-cli-image.yml +0 -0
  209. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/resources/validate_data/validate-ontology.ttl +0 -0
  210. {dsp_tools-17.0.0.post10/src/dsp_tools/xmllib/internal → dsp_tools-17.0.0.post14/src/dsp_tools/utils}/__init__.py +0 -0
  211. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/utils/ansi_colors.py +0 -0
  212. {dsp_tools-17.0.0.post10/src/dsp_tools/xmllib/models → dsp_tools-17.0.0.post14/src/dsp_tools/utils/data_formats}/__init__.py +0 -0
  213. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/utils/data_formats/date_util.py +0 -0
  214. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/utils/data_formats/iri_util.py +0 -0
  215. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/utils/data_formats/shared.py +0 -0
  216. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/utils/data_formats/uri_util.py +0 -0
  217. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/utils/fuseki_bloating.py +0 -0
  218. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/utils/json_parsing.py +0 -0
  219. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/utils/rdflib_constants.py +0 -0
  220. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/utils/replace_id_with_iri.py +0 -0
  221. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/utils/request_utils.py +0 -0
  222. {dsp_tools-17.0.0.post10/src/dsp_tools/xmllib/models/internal → dsp_tools-17.0.0.post14/src/dsp_tools/utils/xml_parsing}/__init__.py +0 -0
  223. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/utils/xml_parsing/get_lookups.py +0 -0
  224. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/utils/xml_parsing/get_parsed_resources.py +0 -0
  225. {dsp_tools-17.0.0.post10/src/dsp_tools/xmllib/models/licenses → dsp_tools-17.0.0.post14/src/dsp_tools/utils/xml_parsing/models}/__init__.py +0 -0
  226. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/utils/xml_parsing/models/parsed_resource.py +0 -0
  227. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/utils/xml_parsing/parse_clean_validate_xml.py +0 -0
  228. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/xmllib/CLAUDE.md +0 -0
  229. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/xmllib/__init__.py +0 -0
  230. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/xmllib/general_functions.py +0 -0
  231. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/xmllib/internal/checkers.py +0 -0
  232. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/xmllib/internal/circumvent_circular_imports.py +0 -0
  233. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/xmllib/internal/constants.py +0 -0
  234. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/xmllib/internal/input_converters.py +0 -0
  235. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/xmllib/internal/serialise_file_value.py +0 -0
  236. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/xmllib/internal/serialise_resource.py +0 -0
  237. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/xmllib/internal/serialise_values.py +0 -0
  238. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/xmllib/internal/type_aliases.py +0 -0
  239. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/xmllib/models/config_options.py +0 -0
  240. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/xmllib/models/date_formats.py +0 -0
  241. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/xmllib/models/dsp_base_resources.py +0 -0
  242. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/xmllib/models/internal/file_values.py +0 -0
  243. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/xmllib/models/internal/geometry.py +0 -0
  244. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/xmllib/models/internal/migration_metadata.py +0 -0
  245. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/xmllib/models/internal/serialise_permissions.py +0 -0
  246. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/xmllib/models/internal/values.py +0 -0
  247. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/xmllib/models/licenses/other.py +0 -0
  248. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/xmllib/models/licenses/recommended.py +0 -0
  249. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/xmllib/models/permissions.py +0 -0
  250. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/xmllib/models/res.py +0 -0
  251. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/xmllib/models/root.py +0 -0
  252. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/xmllib/value_checkers.py +0 -0
  253. {dsp_tools-17.0.0.post10 → dsp_tools-17.0.0.post14}/src/dsp_tools/xmllib/value_converters.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: dsp-tools
3
- Version: 17.0.0.post10
3
+ Version: 17.0.0.post14
4
4
  Summary: DSP-TOOLS is a Python package with a command line interface that helps you interact with a DaSCH service platform (DSP) server.
5
5
  Author: DaSCH - Swiss National Data and Service Center for the Humanities
6
6
  Author-email: DaSCH - Swiss National Data and Service Center for the Humanities <info@dasch.swiss>
@@ -2,7 +2,7 @@
2
2
 
3
3
  [project]
4
4
  name = "dsp-tools"
5
- version = "17.0.0.post10"
5
+ version = "17.0.0.post14"
6
6
  description = "DSP-TOOLS is a Python package with a command line interface that helps you interact with a DaSCH service platform (DSP) server."
7
7
  authors = [
8
8
  { name = "DaSCH - Swiss National Data and Service Center for the Humanities", email = "info@dasch.swiss" },
@@ -203,5 +203,6 @@ exclude = [
203
203
  "src/dsp_tools/error/xmllib_warnings_util.py",
204
204
  "src/dsp_tools/commands/excel2xml/",
205
205
  "test/",
206
+ "src/dsp_tools/commands/create/", # to be ignored to enable small steps untill the intensive work is completed
206
207
  ]
207
208
  sort_by_size = true # sort unused classes and functions by size
@@ -2,6 +2,7 @@ import argparse
2
2
  import subprocess
3
3
  from pathlib import Path
4
4
 
5
+ import requests
5
6
  from loguru import logger
6
7
 
7
8
  from dsp_tools.cli.args import ServerCredentials
@@ -27,9 +28,13 @@ from dsp_tools.commands.start_stack import StackHandler
27
28
  from dsp_tools.commands.validate_data.validate_data import validate_data
28
29
  from dsp_tools.commands.xmlupload.upload_config import UploadConfig
29
30
  from dsp_tools.commands.xmlupload.xmlupload import xmlupload
31
+ from dsp_tools.error.exceptions import DockerNotReachableError
32
+ from dsp_tools.error.exceptions import DspApiNotReachableError
30
33
  from dsp_tools.error.exceptions import InputError
31
34
  from dsp_tools.utils.xml_parsing.parse_clean_validate_xml import parse_and_validate_xml_file
32
35
 
36
+ LOCALHOST_API = "http://0.0.0.0:3333"
37
+
33
38
 
34
39
  def call_requested_action(args: argparse.Namespace) -> bool: # noqa: PLR0912 (too many branches)
35
40
  """
@@ -41,20 +46,36 @@ def call_requested_action(args: argparse.Namespace) -> bool: # noqa: PLR0912 (t
41
46
  Raises:
42
47
  BaseError: from the called function
43
48
  InputError: from the called function
49
+ DockerNotReachableError: from the called function
50
+ LocalDspApiNotReachableError: from the called function
44
51
  unexpected errors from the called methods and underlying libraries
45
52
 
46
53
  Returns:
47
54
  success status
48
55
  """
49
56
  match args.action:
57
+ # commands with Docker / API interactions
58
+ case "start-stack":
59
+ result = _call_start_stack(args)
60
+ case "stop-stack":
61
+ result = _call_stop_stack()
50
62
  case "create":
51
63
  result = _call_create(args)
52
- case "xmlupload":
53
- result = _call_xmlupload(args)
64
+ case "get":
65
+ result = _call_get(args)
54
66
  case "validate-data":
55
67
  result = _call_validate_data(args)
68
+ case "xmlupload":
69
+ result = _call_xmlupload(args)
56
70
  case "resume-xmlupload":
57
71
  result = _call_resume_xmlupload(args)
72
+ case "upload-files":
73
+ result = _call_upload_files(args)
74
+ case "ingest-files":
75
+ result = _call_ingest_files(args)
76
+ case "ingest-xmlupload":
77
+ result = _call_ingest_xmlupload(args)
78
+ # commands that do not require docker
58
79
  case "excel2json":
59
80
  result = _call_excel2json(args)
60
81
  case "old-excel2json":
@@ -69,18 +90,6 @@ def call_requested_action(args: argparse.Namespace) -> bool: # noqa: PLR0912 (t
69
90
  result = _call_excel2properties(args)
70
91
  case "id2iri":
71
92
  result = _call_id2iri(args)
72
- case "start-stack":
73
- result = _call_start_stack(args)
74
- case "stop-stack":
75
- result = _call_stop_stack()
76
- case "get":
77
- result = _call_get(args)
78
- case "upload-files":
79
- result = _call_upload_files(args)
80
- case "ingest-files":
81
- result = _call_ingest_files(args)
82
- case "ingest-xmlupload":
83
- result = _call_ingest_xmlupload(args)
84
93
  case _:
85
94
  print(f"ERROR: Unknown action '{args.action}'")
86
95
  logger.error(f"Unknown action '{args.action}'")
@@ -89,6 +98,7 @@ def call_requested_action(args: argparse.Namespace) -> bool: # noqa: PLR0912 (t
89
98
 
90
99
 
91
100
  def _call_stop_stack() -> bool:
101
+ _check_docker_health()
92
102
  stack_handler = StackHandler(StackConfiguration())
93
103
  return stack_handler.stop_stack()
94
104
 
@@ -164,7 +174,7 @@ def _call_old_excel2json(args: argparse.Namespace) -> bool:
164
174
 
165
175
 
166
176
  def _call_upload_files(args: argparse.Namespace) -> bool:
167
- _check_docker_health_if_on_localhost(args.server)
177
+ _check_health_with_docker_on_localhost(args.server)
168
178
  return upload_files(
169
179
  xml_file=Path(args.xml_file),
170
180
  creds=_get_creds(args),
@@ -173,12 +183,12 @@ def _call_upload_files(args: argparse.Namespace) -> bool:
173
183
 
174
184
 
175
185
  def _call_ingest_files(args: argparse.Namespace) -> bool:
176
- _check_docker_health_if_on_localhost(args.server)
186
+ _check_health_with_docker_on_localhost(args.server)
177
187
  return ingest_files(creds=_get_creds(args), shortcode=args.shortcode)
178
188
 
179
189
 
180
190
  def _call_ingest_xmlupload(args: argparse.Namespace) -> bool:
181
- _check_docker_health_if_on_localhost(args.server)
191
+ _check_health_with_docker(args.server)
182
192
  interrupt_after = args.interrupt_after if args.interrupt_after > 0 else None
183
193
  return ingest_xmlupload(
184
194
  xml_file=Path(args.xml_file),
@@ -191,7 +201,7 @@ def _call_ingest_xmlupload(args: argparse.Namespace) -> bool:
191
201
 
192
202
 
193
203
  def _call_xmlupload(args: argparse.Namespace) -> bool:
194
- _check_docker_health_if_on_localhost(args.server)
204
+ _check_health_with_docker(args.server)
195
205
  if args.validate_only:
196
206
  success = parse_and_validate_xml_file(Path(args.xmlfile))
197
207
  print("The XML file is syntactically correct.")
@@ -227,7 +237,7 @@ def _call_xmlupload(args: argparse.Namespace) -> bool:
227
237
 
228
238
 
229
239
  def _call_validate_data(args: argparse.Namespace) -> bool:
230
- _check_docker_health_if_on_localhost(args.server)
240
+ _check_health_with_docker(args.server)
231
241
  return validate_data(
232
242
  filepath=Path(args.xmlfile),
233
243
  creds=_get_creds(args),
@@ -239,7 +249,8 @@ def _call_validate_data(args: argparse.Namespace) -> bool:
239
249
 
240
250
 
241
251
  def _call_resume_xmlupload(args: argparse.Namespace) -> bool:
242
- _check_docker_health_if_on_localhost(args.server)
252
+ # this does not need docker if not on localhost, as does not need to validate
253
+ _check_health_with_docker_on_localhost(args.server)
243
254
  return resume_xmlupload(
244
255
  creds=_get_creds(args),
245
256
  skip_first_resource=args.skip_first_resource,
@@ -247,7 +258,7 @@ def _call_resume_xmlupload(args: argparse.Namespace) -> bool:
247
258
 
248
259
 
249
260
  def _call_get(args: argparse.Namespace) -> bool:
250
- _check_docker_health_if_on_localhost(args.server)
261
+ _check_health_with_docker_on_localhost(args.server)
251
262
  return get_project(
252
263
  project_identifier=args.project,
253
264
  outfile_path=args.project_definition,
@@ -257,7 +268,7 @@ def _call_get(args: argparse.Namespace) -> bool:
257
268
 
258
269
 
259
270
  def _call_create(args: argparse.Namespace) -> bool:
260
- _check_docker_health_if_on_localhost(args.server)
271
+ _check_health_with_docker_on_localhost(args.server)
261
272
  success = False
262
273
  match args.lists_only, args.validate_only:
263
274
  case True, True:
@@ -289,11 +300,43 @@ def _get_creds(args: argparse.Namespace) -> ServerCredentials:
289
300
  )
290
301
 
291
302
 
292
- def _check_docker_health_if_on_localhost(api_url: str) -> None:
293
- if api_url == "http://0.0.0.0:3333":
303
+ def _check_health_with_docker_on_localhost(api_url: str) -> None:
304
+ if api_url == LOCALHOST_API:
294
305
  _check_docker_health()
306
+ _check_api_health(api_url)
307
+
308
+
309
+ def _check_health_with_docker(api_url: str) -> None:
310
+ # validate always needs docker running
311
+ _check_docker_health()
312
+ _check_api_health(api_url)
295
313
 
296
314
 
297
315
  def _check_docker_health() -> None:
298
316
  if subprocess.run("docker stats --no-stream".split(), check=False, capture_output=True).returncode != 0:
299
- raise InputError("Docker is not running properly. Please start Docker and try again.")
317
+ raise DockerNotReachableError()
318
+
319
+
320
+ def _check_api_health(api_url: str) -> None:
321
+ health_url = f"{api_url}/health"
322
+ msg = (
323
+ "The DSP-API could not be reached. Please check if your stack is healthy "
324
+ "or start a stack with 'dsp-tools start-stack' if none is running."
325
+ )
326
+ try:
327
+ response = requests.get(health_url, timeout=2)
328
+ if not response.ok:
329
+ if api_url != LOCALHOST_API:
330
+ msg = (
331
+ f"The DSP-API could not be reached (returned status {response.status_code}). "
332
+ f"Please contact the DaSCH engineering team for help."
333
+ )
334
+ logger.error(msg)
335
+ raise DspApiNotReachableError(msg)
336
+ logger.debug(f"DSP API health check passed: {health_url}")
337
+ except requests.exceptions.RequestException as e:
338
+ logger.error(e)
339
+ if api_url != LOCALHOST_API:
340
+ msg = "The DSP-API responded with a request exception. Please contact the DaSCH engineering team for help."
341
+ logger.error(msg)
342
+ raise DspApiNotReachableError(msg) from None
@@ -0,0 +1,4 @@
1
+ KNORA_API = "http://api.knora.org/ontology/knora-api/v2#"
2
+ SALSAH_GUI = "http://api.knora.org/ontology/salsah-gui/v2#"
3
+
4
+ UNIVERSAL_PREFIXES = {"knora-api": KNORA_API, "salsah-gui": SALSAH_GUI}
@@ -0,0 +1,23 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass
4
+ from enum import StrEnum
5
+
6
+
7
+ @dataclass
8
+ class CollectedProblems:
9
+ header: str
10
+ problems: list[InputProblem]
11
+
12
+
13
+ @dataclass
14
+ class InputProblem:
15
+ problematic_object: str
16
+ problem: ProblemType
17
+
18
+
19
+ class ProblemType(StrEnum):
20
+ PREFIX_COULD_NOT_BE_RESOLVED = (
21
+ "The prefix used is not defined in the 'prefix' section of the file, "
22
+ "nor does it belong to one of the project ontologies."
23
+ )
@@ -0,0 +1,48 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass
4
+ from enum import Enum
5
+ from enum import auto
6
+ from typing import Any
7
+
8
+
9
+ @dataclass
10
+ class ParsedOntology:
11
+ name: str
12
+ label: str
13
+ comment: str | None
14
+ classes: list[ParsedClass]
15
+ properties: list[ParsedProperty]
16
+ cardinalities: list[ParsedClassCardinalities]
17
+
18
+
19
+ @dataclass
20
+ class ParsedClass:
21
+ name: str
22
+ info: dict[str, Any]
23
+
24
+
25
+ @dataclass
26
+ class ParsedProperty:
27
+ name: str
28
+ info: dict[str, Any]
29
+
30
+
31
+ @dataclass
32
+ class ParsedClassCardinalities:
33
+ class_iri: str
34
+ cards: list[ParsedPropertyCardinality]
35
+
36
+
37
+ @dataclass
38
+ class ParsedPropertyCardinality:
39
+ propname: str
40
+ cardinality: Cardinality
41
+ gui_order: int | None
42
+
43
+
44
+ class Cardinality(Enum):
45
+ C_0_1 = auto()
46
+ C_1 = auto()
47
+ C_0_N = auto()
48
+ C_1_N = auto()
@@ -0,0 +1,49 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass
4
+ from typing import Any
5
+
6
+ from dsp_tools.commands.create.models.parsed_ontology import ParsedOntology
7
+
8
+
9
+ @dataclass
10
+ class ParsedProject:
11
+ prefixes: dict[str, str]
12
+ project_metadata: ParsedProjectMetadata
13
+ permissions: ParsedPermissions
14
+ groups: list[ParsedGroup]
15
+ users: list[ParsedUser]
16
+ lists: list[ParsedList]
17
+ ontologies: list[ParsedOntology]
18
+
19
+
20
+ @dataclass
21
+ class ParsedProjectMetadata:
22
+ shortcode: str
23
+ shortname: str
24
+ longname: str
25
+ descriptions: dict[str, str]
26
+ keywords: list[str]
27
+ enabled_licenses: list[str]
28
+
29
+
30
+ @dataclass
31
+ class ParsedPermissions:
32
+ default_permissions: str
33
+ default_permissions_overrule: dict[str, Any] | None
34
+
35
+
36
+ @dataclass
37
+ class ParsedGroup:
38
+ info: dict[str, Any]
39
+
40
+
41
+ @dataclass
42
+ class ParsedUser:
43
+ info: dict[str, Any]
44
+
45
+
46
+ @dataclass
47
+ class ParsedList:
48
+ name: str
49
+ info: dict[str, Any]
@@ -0,0 +1,108 @@
1
+ from typing import Any
2
+ from typing import cast
3
+
4
+ from dsp_tools.commands.create.models.input_problems import CollectedProblems
5
+ from dsp_tools.commands.create.models.input_problems import InputProblem
6
+ from dsp_tools.commands.create.models.input_problems import ProblemType
7
+ from dsp_tools.commands.create.models.parsed_ontology import Cardinality
8
+ from dsp_tools.commands.create.models.parsed_ontology import ParsedClass
9
+ from dsp_tools.commands.create.models.parsed_ontology import ParsedClassCardinalities
10
+ from dsp_tools.commands.create.models.parsed_ontology import ParsedOntology
11
+ from dsp_tools.commands.create.models.parsed_ontology import ParsedProperty
12
+ from dsp_tools.commands.create.models.parsed_ontology import ParsedPropertyCardinality
13
+ from dsp_tools.commands.create.parsing.parsing_utils import resolve_to_absolute_iri
14
+
15
+ CARDINALITY_MAPPER = {
16
+ "0-1": Cardinality.C_0_1,
17
+ "1": Cardinality.C_1,
18
+ "0-n": Cardinality.C_0_N,
19
+ "1-n": Cardinality.C_1_N,
20
+ }
21
+
22
+
23
+ def parse_ontology(ontology_json: dict[str, Any], prefixes: dict[str, str]) -> ParsedOntology | CollectedProblems:
24
+ onto_name = ontology_json["name"]
25
+ current_onto = prefixes[onto_name]
26
+ fails = []
27
+ props, prop_fails = _parse_properties(ontology_json["properties"], current_onto)
28
+ fails.extend(prop_fails)
29
+ classes, cls_fails = _parse_classes(ontology_json["resources"], current_onto)
30
+ fails.extend(cls_fails)
31
+ cards, card_fails = _parse_cardinalities(ontology_json["resources"], current_onto, prefixes)
32
+ fails.extend(card_fails)
33
+ if fails:
34
+ return CollectedProblems(
35
+ f"During the parsing of the ontology '{onto_name}' the following errors occurred", fails
36
+ )
37
+ return ParsedOntology(
38
+ name=onto_name,
39
+ label=ontology_json["label"],
40
+ comment=ontology_json.get("comment"),
41
+ classes=classes,
42
+ properties=props,
43
+ cardinalities=cards,
44
+ )
45
+
46
+
47
+ def _parse_properties(
48
+ properties_list: list[dict[str, Any]], current_onto_prefix: str
49
+ ) -> tuple[list[ParsedProperty], list[InputProblem]]:
50
+ parsed = []
51
+ for prop in properties_list:
52
+ parsed.append(ParsedProperty(f"{current_onto_prefix}{prop['name']}", prop))
53
+ return parsed, []
54
+
55
+
56
+ def _parse_classes(
57
+ classes_list: list[dict[str, Any]], current_onto_prefix: str
58
+ ) -> tuple[list[ParsedClass], list[InputProblem]]:
59
+ parsed = []
60
+ for cls in classes_list:
61
+ parsed.append(ParsedClass(f"{current_onto_prefix}{cls['name']}", cls))
62
+ return parsed, []
63
+
64
+
65
+ def _parse_cardinalities(
66
+ classes_list: list[dict[str, Any]], current_onto_prefix: str, prefixes: dict[str, str]
67
+ ) -> tuple[list[ParsedClassCardinalities], list[InputProblem]]:
68
+ parsed = []
69
+ failures = []
70
+ for c in classes_list:
71
+ if c.get("cardinalities"):
72
+ result = _parse_one_class_cardinality(c, current_onto_prefix, prefixes)
73
+ if isinstance(result, ParsedClassCardinalities):
74
+ parsed.append(result)
75
+ else:
76
+ failures.extend(result)
77
+ return parsed, failures
78
+
79
+
80
+ def _parse_one_class_cardinality(
81
+ cls_json: dict[str, Any], current_onto_prefix: str, prefixes: dict[str, str]
82
+ ) -> ParsedClassCardinalities | list[InputProblem]:
83
+ failures = []
84
+ parsed = []
85
+ for c in cls_json["cardinalities"]:
86
+ result = _parse_one_cardinality(c, current_onto_prefix, prefixes)
87
+ if isinstance(result, ParsedPropertyCardinality):
88
+ parsed.append(result)
89
+ else:
90
+ failures.append(result)
91
+ if failures:
92
+ return failures
93
+ cls_iri = f"{current_onto_prefix}{cls_json['name']}"
94
+ return ParsedClassCardinalities(cls_iri, parsed)
95
+
96
+
97
+ def _parse_one_cardinality(
98
+ card_json: dict[str, str | int], current_onto_prefix: str, prefixes: dict[str, str]
99
+ ) -> ParsedPropertyCardinality | InputProblem:
100
+ prp_name = cast(str, card_json["propname"])
101
+ if not (resolved := resolve_to_absolute_iri(prp_name, current_onto_prefix, prefixes)):
102
+ return InputProblem(prp_name, ProblemType.PREFIX_COULD_NOT_BE_RESOLVED)
103
+ gui = cast(int | None, card_json.get("gui_order"))
104
+ return ParsedPropertyCardinality(
105
+ propname=resolved,
106
+ cardinality=CARDINALITY_MAPPER[cast(str, card_json["cardinality"])],
107
+ gui_order=gui,
108
+ )
@@ -0,0 +1,99 @@
1
+ from pathlib import Path
2
+ from typing import Any
3
+
4
+ from loguru import logger
5
+
6
+ from dsp_tools.commands.create.models.input_problems import CollectedProblems
7
+ from dsp_tools.commands.create.models.parsed_ontology import ParsedOntology
8
+ from dsp_tools.commands.create.models.parsed_project import ParsedGroup
9
+ from dsp_tools.commands.create.models.parsed_project import ParsedList
10
+ from dsp_tools.commands.create.models.parsed_project import ParsedPermissions
11
+ from dsp_tools.commands.create.models.parsed_project import ParsedProject
12
+ from dsp_tools.commands.create.models.parsed_project import ParsedProjectMetadata
13
+ from dsp_tools.commands.create.models.parsed_project import ParsedUser
14
+ from dsp_tools.commands.create.parsing.parse_ontology import parse_ontology
15
+ from dsp_tools.commands.create.parsing.parsing_utils import create_prefix_lookup
16
+ from dsp_tools.commands.project.create.project_validate import validate_project
17
+ from dsp_tools.utils.json_parsing import parse_json_input
18
+
19
+
20
+ def parse_project(
21
+ project_file_as_path_or_parsed: str | Path | dict[str, Any], api_url: str
22
+ ) -> ParsedProject | list[CollectedProblems]:
23
+ complete_json = _parse_and_validate(project_file_as_path_or_parsed)
24
+ return _parse_project(complete_json, api_url)
25
+
26
+
27
+ def _parse_project(complete_json: dict[str, Any], api_url: str) -> ParsedProject | list[CollectedProblems]:
28
+ prefix_lookup = create_prefix_lookup(complete_json, api_url)
29
+ project_json = complete_json["project"]
30
+ ontologies, failures = _parse_all_ontologies(project_json, prefix_lookup)
31
+ if failures:
32
+ return failures
33
+ return ParsedProject(
34
+ prefixes=prefix_lookup,
35
+ project_metadata=_parse_metadata(project_json),
36
+ permissions=_parse_permissions(project_json),
37
+ groups=_parse_groups(project_json),
38
+ users=_parse_users(project_json),
39
+ lists=_parse_lists(project_json),
40
+ ontologies=ontologies,
41
+ )
42
+
43
+
44
+ def _parse_and_validate(project_file_as_path_or_parsed: str | Path | dict[str, Any]) -> dict[str, Any]:
45
+ project_json = parse_json_input(project_file_as_path_or_parsed=project_file_as_path_or_parsed)
46
+ validate_project(project_json)
47
+ print(" JSON project file is syntactically correct and passed validation.")
48
+ logger.info("JSON project file is syntactically correct and passed validation.")
49
+ return project_json
50
+
51
+
52
+ def _parse_metadata(project_json: dict[str, Any]) -> ParsedProjectMetadata:
53
+ return ParsedProjectMetadata(
54
+ shortcode=project_json["shortcode"],
55
+ shortname=project_json["shortname"],
56
+ longname=project_json["longname"],
57
+ descriptions=project_json["descriptions"],
58
+ keywords=project_json["keywords"],
59
+ enabled_licenses=project_json["enabled_licenses"],
60
+ )
61
+
62
+
63
+ def _parse_permissions(project_json: dict[str, Any]) -> ParsedPermissions:
64
+ return ParsedPermissions(
65
+ default_permissions=project_json["default_permissions"],
66
+ default_permissions_overrule=project_json.get("default_permissions_overrule"),
67
+ )
68
+
69
+
70
+ def _parse_groups(project_json: dict[str, Any]) -> list[ParsedGroup]:
71
+ if not (found := project_json.get("groups")):
72
+ return []
73
+ return [ParsedGroup(x) for x in found]
74
+
75
+
76
+ def _parse_users(project_json: dict[str, Any]) -> list[ParsedUser]:
77
+ if not (found := project_json.get("users")):
78
+ return []
79
+ return [ParsedUser(x) for x in found]
80
+
81
+
82
+ def _parse_lists(project_json: dict[str, Any]) -> list[ParsedList]:
83
+ if not (found := project_json.get("lists")):
84
+ return []
85
+ return [ParsedList(x["name"], x) for x in found]
86
+
87
+
88
+ def _parse_all_ontologies(
89
+ project_json: dict[str, Any], prefix_lookup: dict[str, str]
90
+ ) -> tuple[list[ParsedOntology], list[CollectedProblems]]:
91
+ ontos = []
92
+ failures = []
93
+ for o in project_json["ontologies"]:
94
+ result = parse_ontology(o, prefix_lookup)
95
+ if isinstance(result, ParsedOntology):
96
+ ontos.append(result)
97
+ else:
98
+ failures.append(result)
99
+ return ontos, failures
@@ -0,0 +1,43 @@
1
+ from typing import Any
2
+
3
+ import regex
4
+
5
+ from dsp_tools.commands.create.constants import KNORA_API
6
+ from dsp_tools.commands.create.constants import UNIVERSAL_PREFIXES
7
+ from dsp_tools.utils.data_formats.uri_util import is_uri
8
+
9
+
10
+ def resolve_to_absolute_iri(prefixed: str, current_onto: str, prefix_lookup: dict[str, str]) -> str | None:
11
+ if is_uri(prefixed):
12
+ return prefixed
13
+ if prefixed.startswith(":"):
14
+ return f"{current_onto}{prefixed.lstrip(':')}"
15
+ segments = prefixed.split(":", maxsplit=1)
16
+ if len(segments) == 1:
17
+ return f"{KNORA_API}{segments[0]}"
18
+ if not (found := prefix_lookup.get(segments[0])):
19
+ return None
20
+ return f"{found}{segments[1]}"
21
+
22
+
23
+ def create_prefix_lookup(project_json: dict[str, Any], api_url: str) -> dict[str, str]:
24
+ defined_prefixes = project_json.get("prefixes", {})
25
+ defined_prefixes = defined_prefixes | UNIVERSAL_PREFIXES
26
+ defined_prefixes = _correct_external_prefix(defined_prefixes)
27
+ shortcode = project_json["project"]["shortcode"]
28
+ for onto in project_json["project"]["ontologies"]:
29
+ onto_name = onto["name"]
30
+ defined_prefixes[onto_name] = _make_dsp_ontology_prefix(api_url, shortcode, onto_name)
31
+ return defined_prefixes
32
+
33
+
34
+ def _correct_external_prefix(prefixes: dict[str, str]) -> dict[str, str]:
35
+ for prfx, namespace in prefixes.items():
36
+ if regex.search(r"(#|\/)$", namespace):
37
+ continue
38
+ prefixes[prfx] = f"{namespace}/"
39
+ return prefixes
40
+
41
+
42
+ def _make_dsp_ontology_prefix(api_url: str, shortcode: str, onto_name: str) -> str:
43
+ return f"{api_url}/ontology/{shortcode}/{onto_name}/v2#"
@@ -45,6 +45,18 @@ class InternalError(BaseError):
45
45
  super().__init__(default_msg)
46
46
 
47
47
 
48
+ class DockerNotReachableError(BaseError):
49
+ """This error is raised when docker is not running."""
50
+
51
+ def __init__(self) -> None:
52
+ msg = "Docker is not running properly. Please start Docker and try again."
53
+ super().__init__(msg)
54
+
55
+
56
+ class DspApiNotReachableError(BaseError):
57
+ """This error is raised when the DSP-API could not be reached on localhost."""
58
+
59
+
48
60
  class InputError(BaseError):
49
61
  """This error is raised when the user input is invalid. The message should be as user-friendly as possible."""
50
62