dsp-tools 0.9.13__py3-none-any.whl → 18.3.0.post13__py3-none-any.whl

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.
Files changed (348) hide show
  1. dsp_tools/__init__.py +5 -0
  2. dsp_tools/cli/args.py +47 -0
  3. dsp_tools/cli/call_action.py +85 -0
  4. dsp_tools/cli/call_action_files_only.py +101 -0
  5. dsp_tools/cli/call_action_with_network.py +207 -0
  6. dsp_tools/cli/create_parsers.py +479 -0
  7. dsp_tools/cli/entry_point.py +322 -0
  8. dsp_tools/cli/utils.py +87 -0
  9. dsp_tools/clients/CLAUDE.md +420 -0
  10. dsp_tools/clients/authentication_client.py +14 -0
  11. dsp_tools/clients/authentication_client_live.py +66 -0
  12. dsp_tools/clients/connection.py +35 -0
  13. dsp_tools/clients/connection_live.py +233 -0
  14. dsp_tools/clients/fuseki_metrics.py +60 -0
  15. dsp_tools/clients/group_user_clients.py +35 -0
  16. dsp_tools/clients/group_user_clients_live.py +181 -0
  17. dsp_tools/clients/legal_info_client.py +23 -0
  18. dsp_tools/clients/legal_info_client_live.py +132 -0
  19. dsp_tools/clients/list_client.py +49 -0
  20. dsp_tools/clients/list_client_live.py +166 -0
  21. dsp_tools/clients/metadata_client.py +24 -0
  22. dsp_tools/clients/metadata_client_live.py +47 -0
  23. dsp_tools/clients/ontology_clients.py +49 -0
  24. dsp_tools/clients/ontology_create_client_live.py +166 -0
  25. dsp_tools/clients/ontology_get_client_live.py +80 -0
  26. dsp_tools/clients/permissions_client.py +68 -0
  27. dsp_tools/clients/project_client.py +16 -0
  28. dsp_tools/clients/project_client_live.py +66 -0
  29. dsp_tools/commands/create/communicate_problems.py +24 -0
  30. dsp_tools/commands/create/create.py +134 -0
  31. dsp_tools/commands/create/create_on_server/cardinalities.py +111 -0
  32. dsp_tools/commands/create/create_on_server/classes.py +99 -0
  33. dsp_tools/commands/create/create_on_server/complete_ontologies.py +116 -0
  34. dsp_tools/commands/create/create_on_server/default_permissions.py +134 -0
  35. dsp_tools/commands/create/create_on_server/group_users.py +165 -0
  36. dsp_tools/commands/create/create_on_server/lists.py +163 -0
  37. dsp_tools/commands/create/create_on_server/mappers.py +12 -0
  38. dsp_tools/commands/create/create_on_server/onto_utils.py +74 -0
  39. dsp_tools/commands/create/create_on_server/ontology.py +52 -0
  40. dsp_tools/commands/create/create_on_server/project.py +68 -0
  41. dsp_tools/commands/create/create_on_server/properties.py +119 -0
  42. dsp_tools/commands/create/exceptions.py +29 -0
  43. dsp_tools/commands/create/lists_only.py +66 -0
  44. dsp_tools/commands/create/models/create_problems.py +87 -0
  45. dsp_tools/commands/create/models/parsed_ontology.py +88 -0
  46. dsp_tools/commands/create/models/parsed_project.py +81 -0
  47. dsp_tools/commands/create/models/rdf_ontology.py +12 -0
  48. dsp_tools/commands/create/models/server_project_info.py +100 -0
  49. dsp_tools/commands/create/parsing/parse_lists.py +45 -0
  50. dsp_tools/commands/create/parsing/parse_ontology.py +243 -0
  51. dsp_tools/commands/create/parsing/parse_project.py +149 -0
  52. dsp_tools/commands/create/parsing/parsing_utils.py +40 -0
  53. dsp_tools/commands/create/project_validate.py +595 -0
  54. dsp_tools/commands/create/serialisation/ontology.py +119 -0
  55. dsp_tools/commands/create/serialisation/project.py +44 -0
  56. dsp_tools/commands/excel2json/CLAUDE.md +101 -0
  57. dsp_tools/commands/excel2json/json_header.py +321 -0
  58. dsp_tools/commands/excel2json/lists/__init__.py +0 -0
  59. dsp_tools/commands/excel2json/lists/compliance_checks.py +292 -0
  60. dsp_tools/commands/excel2json/lists/make_lists.py +247 -0
  61. dsp_tools/commands/excel2json/lists/models/__init__.py +0 -0
  62. dsp_tools/commands/excel2json/lists/models/deserialise.py +30 -0
  63. dsp_tools/commands/excel2json/lists/models/input_error.py +216 -0
  64. dsp_tools/commands/excel2json/lists/models/serialise.py +57 -0
  65. dsp_tools/commands/excel2json/lists/utils.py +81 -0
  66. dsp_tools/commands/excel2json/models/__init__.py +0 -0
  67. dsp_tools/commands/excel2json/models/input_error.py +416 -0
  68. dsp_tools/commands/excel2json/models/json_header.py +175 -0
  69. dsp_tools/commands/excel2json/models/list_node_name.py +16 -0
  70. dsp_tools/commands/excel2json/models/ontology.py +76 -0
  71. dsp_tools/commands/excel2json/old_lists.py +328 -0
  72. dsp_tools/commands/excel2json/project.py +280 -0
  73. dsp_tools/commands/excel2json/properties.py +370 -0
  74. dsp_tools/commands/excel2json/resources.py +336 -0
  75. dsp_tools/commands/excel2json/utils.py +352 -0
  76. dsp_tools/commands/excel2xml/__init__.py +7 -0
  77. dsp_tools/commands/excel2xml/excel2xml_cli.py +523 -0
  78. dsp_tools/commands/excel2xml/excel2xml_lib.py +1953 -0
  79. dsp_tools/commands/excel2xml/propertyelement.py +47 -0
  80. dsp_tools/commands/get/__init__.py +0 -0
  81. dsp_tools/commands/get/get.py +166 -0
  82. dsp_tools/commands/get/get_permissions.py +257 -0
  83. dsp_tools/commands/get/get_permissions_legacy.py +89 -0
  84. dsp_tools/commands/get/legacy_models/__init__.py +0 -0
  85. dsp_tools/commands/get/legacy_models/context.py +318 -0
  86. dsp_tools/commands/get/legacy_models/group.py +241 -0
  87. dsp_tools/commands/get/legacy_models/helpers.py +47 -0
  88. dsp_tools/commands/get/legacy_models/listnode.py +390 -0
  89. dsp_tools/commands/get/legacy_models/model.py +12 -0
  90. dsp_tools/commands/get/legacy_models/ontology.py +324 -0
  91. dsp_tools/commands/get/legacy_models/project.py +366 -0
  92. dsp_tools/commands/get/legacy_models/propertyclass.py +417 -0
  93. dsp_tools/commands/get/legacy_models/resourceclass.py +676 -0
  94. dsp_tools/commands/get/legacy_models/user.py +438 -0
  95. dsp_tools/commands/get/models/__init__.py +0 -0
  96. dsp_tools/commands/get/models/permissions_models.py +10 -0
  97. dsp_tools/commands/id2iri.py +258 -0
  98. dsp_tools/commands/ingest_xmlupload/__init__.py +0 -0
  99. dsp_tools/commands/ingest_xmlupload/bulk_ingest_client.py +178 -0
  100. dsp_tools/commands/ingest_xmlupload/create_resources/__init__.py +0 -0
  101. dsp_tools/commands/ingest_xmlupload/create_resources/apply_ingest_id.py +69 -0
  102. dsp_tools/commands/ingest_xmlupload/create_resources/upload_xml.py +166 -0
  103. dsp_tools/commands/ingest_xmlupload/create_resources/user_information.py +121 -0
  104. dsp_tools/commands/ingest_xmlupload/ingest_files/__init__.py +0 -0
  105. dsp_tools/commands/ingest_xmlupload/ingest_files/ingest_files.py +64 -0
  106. dsp_tools/commands/ingest_xmlupload/upload_files/__init__.py +0 -0
  107. dsp_tools/commands/ingest_xmlupload/upload_files/filechecker.py +20 -0
  108. dsp_tools/commands/ingest_xmlupload/upload_files/input_error.py +57 -0
  109. dsp_tools/commands/ingest_xmlupload/upload_files/upload_failures.py +66 -0
  110. dsp_tools/commands/ingest_xmlupload/upload_files/upload_files.py +67 -0
  111. dsp_tools/commands/resume_xmlupload/__init__.py +0 -0
  112. dsp_tools/commands/resume_xmlupload/resume_xmlupload.py +96 -0
  113. dsp_tools/commands/start_stack.py +428 -0
  114. dsp_tools/commands/update_legal/CLAUDE.md +344 -0
  115. dsp_tools/commands/update_legal/__init__.py +0 -0
  116. dsp_tools/commands/update_legal/core.py +182 -0
  117. dsp_tools/commands/update_legal/csv_operations.py +135 -0
  118. dsp_tools/commands/update_legal/models.py +87 -0
  119. dsp_tools/commands/update_legal/xml_operations.py +247 -0
  120. dsp_tools/commands/validate_data/CLAUDE.md +159 -0
  121. dsp_tools/commands/validate_data/__init__.py +0 -0
  122. dsp_tools/commands/validate_data/constants.py +59 -0
  123. dsp_tools/commands/validate_data/mappers.py +143 -0
  124. dsp_tools/commands/validate_data/models/__init__.py +0 -0
  125. dsp_tools/commands/validate_data/models/api_responses.py +45 -0
  126. dsp_tools/commands/validate_data/models/input_problems.py +119 -0
  127. dsp_tools/commands/validate_data/models/rdf_like_data.py +117 -0
  128. dsp_tools/commands/validate_data/models/validation.py +106 -0
  129. dsp_tools/commands/validate_data/prepare_data/__init__.py +0 -0
  130. dsp_tools/commands/validate_data/prepare_data/get_rdf_like_data.py +296 -0
  131. dsp_tools/commands/validate_data/prepare_data/make_data_graph.py +91 -0
  132. dsp_tools/commands/validate_data/prepare_data/prepare_data.py +184 -0
  133. dsp_tools/commands/validate_data/process_validation_report/__init__.py +0 -0
  134. dsp_tools/commands/validate_data/process_validation_report/get_user_validation_message.py +358 -0
  135. dsp_tools/commands/validate_data/process_validation_report/query_validation_result.py +507 -0
  136. dsp_tools/commands/validate_data/process_validation_report/reformat_validation_results.py +150 -0
  137. dsp_tools/commands/validate_data/shacl_cli_validator.py +70 -0
  138. dsp_tools/commands/validate_data/sparql/__init__.py +0 -0
  139. dsp_tools/commands/validate_data/sparql/cardinality_shacl.py +209 -0
  140. dsp_tools/commands/validate_data/sparql/construct_shacl.py +92 -0
  141. dsp_tools/commands/validate_data/sparql/legal_info_shacl.py +36 -0
  142. dsp_tools/commands/validate_data/sparql/value_shacl.py +357 -0
  143. dsp_tools/commands/validate_data/utils.py +59 -0
  144. dsp_tools/commands/validate_data/validate_data.py +283 -0
  145. dsp_tools/commands/validate_data/validation/__init__.py +0 -0
  146. dsp_tools/commands/validate_data/validation/check_duplicate_files.py +55 -0
  147. dsp_tools/commands/validate_data/validation/check_for_unknown_classes.py +67 -0
  148. dsp_tools/commands/validate_data/validation/get_validation_report.py +94 -0
  149. dsp_tools/commands/validate_data/validation/validate_ontology.py +107 -0
  150. dsp_tools/commands/xmlupload/CLAUDE.md +292 -0
  151. dsp_tools/commands/xmlupload/__init__.py +0 -0
  152. dsp_tools/commands/xmlupload/iri_resolver.py +21 -0
  153. dsp_tools/commands/xmlupload/make_rdf_graph/__init__.py +0 -0
  154. dsp_tools/commands/xmlupload/make_rdf_graph/constants.py +63 -0
  155. dsp_tools/commands/xmlupload/make_rdf_graph/jsonld_utils.py +44 -0
  156. dsp_tools/commands/xmlupload/make_rdf_graph/make_file_value.py +77 -0
  157. dsp_tools/commands/xmlupload/make_rdf_graph/make_resource_and_values.py +114 -0
  158. dsp_tools/commands/xmlupload/make_rdf_graph/make_values.py +262 -0
  159. dsp_tools/commands/xmlupload/models/__init__.py +0 -0
  160. dsp_tools/commands/xmlupload/models/bitstream_info.py +18 -0
  161. dsp_tools/commands/xmlupload/models/formatted_text_value.py +10 -0
  162. dsp_tools/commands/xmlupload/models/ingest.py +143 -0
  163. dsp_tools/commands/xmlupload/models/input_problems.py +58 -0
  164. dsp_tools/commands/xmlupload/models/lookup_models.py +21 -0
  165. dsp_tools/commands/xmlupload/models/permission.py +45 -0
  166. dsp_tools/commands/xmlupload/models/permissions_parsed.py +93 -0
  167. dsp_tools/commands/xmlupload/models/processed/__init__.py +0 -0
  168. dsp_tools/commands/xmlupload/models/processed/file_values.py +29 -0
  169. dsp_tools/commands/xmlupload/models/processed/res.py +27 -0
  170. dsp_tools/commands/xmlupload/models/processed/values.py +101 -0
  171. dsp_tools/commands/xmlupload/models/rdf_models.py +26 -0
  172. dsp_tools/commands/xmlupload/models/upload_clients.py +14 -0
  173. dsp_tools/commands/xmlupload/models/upload_state.py +20 -0
  174. dsp_tools/commands/xmlupload/prepare_xml_input/__init__.py +0 -0
  175. dsp_tools/commands/xmlupload/prepare_xml_input/ark2iri.py +55 -0
  176. dsp_tools/commands/xmlupload/prepare_xml_input/get_processed_resources.py +252 -0
  177. dsp_tools/commands/xmlupload/prepare_xml_input/iiif_uri_validator.py +50 -0
  178. dsp_tools/commands/xmlupload/prepare_xml_input/list_client.py +120 -0
  179. dsp_tools/commands/xmlupload/prepare_xml_input/prepare_xml_input.py +67 -0
  180. dsp_tools/commands/xmlupload/prepare_xml_input/read_validate_xml_file.py +58 -0
  181. dsp_tools/commands/xmlupload/prepare_xml_input/transform_input_values.py +118 -0
  182. dsp_tools/commands/xmlupload/resource_create_client.py +25 -0
  183. dsp_tools/commands/xmlupload/richtext_id2iri.py +37 -0
  184. dsp_tools/commands/xmlupload/stash/__init__.py +0 -0
  185. dsp_tools/commands/xmlupload/stash/analyse_circular_reference_graph.py +236 -0
  186. dsp_tools/commands/xmlupload/stash/create_info_for_graph.py +53 -0
  187. dsp_tools/commands/xmlupload/stash/graph_models.py +87 -0
  188. dsp_tools/commands/xmlupload/stash/stash_circular_references.py +68 -0
  189. dsp_tools/commands/xmlupload/stash/stash_models.py +109 -0
  190. dsp_tools/commands/xmlupload/stash/upload_stashed_resptr_props.py +106 -0
  191. dsp_tools/commands/xmlupload/stash/upload_stashed_xml_texts.py +196 -0
  192. dsp_tools/commands/xmlupload/upload_config.py +76 -0
  193. dsp_tools/commands/xmlupload/write_diagnostic_info.py +27 -0
  194. dsp_tools/commands/xmlupload/xmlupload.py +516 -0
  195. dsp_tools/config/__init__.py +0 -0
  196. dsp_tools/config/logger_config.py +69 -0
  197. dsp_tools/config/warnings_config.py +32 -0
  198. dsp_tools/error/__init__.py +0 -0
  199. dsp_tools/error/custom_warnings.py +39 -0
  200. dsp_tools/error/exceptions.py +204 -0
  201. dsp_tools/error/problems.py +10 -0
  202. dsp_tools/error/xmllib_errors.py +20 -0
  203. dsp_tools/error/xmllib_warnings.py +54 -0
  204. dsp_tools/error/xmllib_warnings_util.py +159 -0
  205. dsp_tools/error/xsd_validation_error_msg.py +19 -0
  206. dsp_tools/legacy_models/__init__.py +0 -0
  207. dsp_tools/legacy_models/datetimestamp.py +81 -0
  208. dsp_tools/legacy_models/langstring.py +253 -0
  209. dsp_tools/legacy_models/projectContext.py +49 -0
  210. dsp_tools/py.typed +0 -0
  211. dsp_tools/resources/schema/data.xsd +648 -0
  212. dsp_tools/resources/schema/lists-only.json +72 -0
  213. dsp_tools/resources/schema/project.json +1258 -0
  214. dsp_tools/resources/schema/properties-only.json +874 -0
  215. dsp_tools/resources/schema/resources-only.json +140 -0
  216. dsp_tools/resources/start-stack/docker-compose.override-host.j2 +11 -0
  217. dsp_tools/resources/start-stack/docker-compose.override.yml +11 -0
  218. dsp_tools/resources/start-stack/docker-compose.yml +88 -0
  219. dsp_tools/resources/start-stack/dsp-app-config.json +45 -0
  220. dsp_tools/resources/start-stack/dsp-app-config.override-host.j2 +26 -0
  221. dsp_tools/resources/validate_data/api-shapes-resource-cardinalities.ttl +191 -0
  222. dsp_tools/resources/validate_data/api-shapes.ttl +804 -0
  223. dsp_tools/resources/validate_data/shacl-cli-image.yml +4 -0
  224. dsp_tools/resources/validate_data/validate-ontology.ttl +99 -0
  225. dsp_tools/utils/__init__.py +0 -0
  226. dsp_tools/utils/ansi_colors.py +32 -0
  227. dsp_tools/utils/data_formats/__init__.py +0 -0
  228. dsp_tools/utils/data_formats/date_util.py +166 -0
  229. dsp_tools/utils/data_formats/iri_util.py +30 -0
  230. dsp_tools/utils/data_formats/shared.py +81 -0
  231. dsp_tools/utils/data_formats/uri_util.py +76 -0
  232. dsp_tools/utils/fuseki_bloating.py +63 -0
  233. dsp_tools/utils/json_parsing.py +22 -0
  234. dsp_tools/utils/rdf_constants.py +42 -0
  235. dsp_tools/utils/rdflib_utils.py +10 -0
  236. dsp_tools/utils/replace_id_with_iri.py +66 -0
  237. dsp_tools/utils/request_utils.py +238 -0
  238. dsp_tools/utils/xml_parsing/__init__.py +0 -0
  239. dsp_tools/utils/xml_parsing/get_lookups.py +32 -0
  240. dsp_tools/utils/xml_parsing/get_parsed_resources.py +325 -0
  241. dsp_tools/utils/xml_parsing/models/__init__.py +0 -0
  242. dsp_tools/utils/xml_parsing/models/parsed_resource.py +76 -0
  243. dsp_tools/utils/xml_parsing/parse_clean_validate_xml.py +137 -0
  244. dsp_tools/xmllib/CLAUDE.md +302 -0
  245. dsp_tools/xmllib/__init__.py +49 -0
  246. dsp_tools/xmllib/general_functions.py +877 -0
  247. dsp_tools/xmllib/internal/__init__.py +0 -0
  248. dsp_tools/xmllib/internal/checkers.py +162 -0
  249. dsp_tools/xmllib/internal/circumvent_circular_imports.py +36 -0
  250. dsp_tools/xmllib/internal/constants.py +46 -0
  251. dsp_tools/xmllib/internal/input_converters.py +155 -0
  252. dsp_tools/xmllib/internal/serialise_file_value.py +57 -0
  253. dsp_tools/xmllib/internal/serialise_resource.py +177 -0
  254. dsp_tools/xmllib/internal/serialise_values.py +152 -0
  255. dsp_tools/xmllib/internal/type_aliases.py +11 -0
  256. dsp_tools/xmllib/models/__init__.py +0 -0
  257. dsp_tools/xmllib/models/config_options.py +28 -0
  258. dsp_tools/xmllib/models/date_formats.py +48 -0
  259. dsp_tools/xmllib/models/dsp_base_resources.py +1542 -0
  260. dsp_tools/xmllib/models/internal/__init__.py +0 -0
  261. dsp_tools/xmllib/models/internal/file_values.py +172 -0
  262. dsp_tools/xmllib/models/internal/geometry.py +162 -0
  263. dsp_tools/xmllib/models/internal/migration_metadata.py +55 -0
  264. dsp_tools/xmllib/models/internal/serialise_permissions.py +66 -0
  265. dsp_tools/xmllib/models/internal/values.py +342 -0
  266. dsp_tools/xmllib/models/licenses/__init__.py +0 -0
  267. dsp_tools/xmllib/models/licenses/other.py +59 -0
  268. dsp_tools/xmllib/models/licenses/recommended.py +107 -0
  269. dsp_tools/xmllib/models/permissions.py +41 -0
  270. dsp_tools/xmllib/models/res.py +1782 -0
  271. dsp_tools/xmllib/models/root.py +348 -0
  272. dsp_tools/xmllib/value_checkers.py +434 -0
  273. dsp_tools/xmllib/value_converters.py +777 -0
  274. dsp_tools-18.3.0.post13.dist-info/METADATA +90 -0
  275. dsp_tools-18.3.0.post13.dist-info/RECORD +286 -0
  276. dsp_tools-18.3.0.post13.dist-info/WHEEL +4 -0
  277. dsp_tools-18.3.0.post13.dist-info/entry_points.txt +3 -0
  278. dsp_tools-0.9.13.dist-info/LICENSE +0 -674
  279. dsp_tools-0.9.13.dist-info/METADATA +0 -144
  280. dsp_tools-0.9.13.dist-info/RECORD +0 -71
  281. dsp_tools-0.9.13.dist-info/WHEEL +0 -5
  282. dsp_tools-0.9.13.dist-info/entry_points.txt +0 -3
  283. dsp_tools-0.9.13.dist-info/top_level.txt +0 -1
  284. dsplib/models/connection.py +0 -272
  285. dsplib/models/group.py +0 -296
  286. dsplib/models/helpers.py +0 -505
  287. dsplib/models/langstring.py +0 -277
  288. dsplib/models/listnode.py +0 -578
  289. dsplib/models/model.py +0 -20
  290. dsplib/models/ontology.py +0 -448
  291. dsplib/models/permission.py +0 -112
  292. dsplib/models/project.py +0 -547
  293. dsplib/models/propertyclass.py +0 -505
  294. dsplib/models/resource.py +0 -366
  295. dsplib/models/resourceclass.py +0 -810
  296. dsplib/models/sipi.py +0 -30
  297. dsplib/models/user.py +0 -731
  298. dsplib/models/value.py +0 -1000
  299. dsplib/utils/knora-data-schema.xsd +0 -454
  300. dsplib/utils/knora-schema-lists.json +0 -83
  301. dsplib/utils/knora-schema.json +0 -434
  302. dsplib/utils/onto_commons.py +0 -24
  303. dsplib/utils/onto_create_lists.py +0 -73
  304. dsplib/utils/onto_create_ontology.py +0 -442
  305. dsplib/utils/onto_get.py +0 -58
  306. dsplib/utils/onto_validate.py +0 -33
  307. dsplib/utils/xml_upload.py +0 -539
  308. dsplib/widgets/doublepassword.py +0 -80
  309. knora/MLS-import-libraries.py +0 -84
  310. knora/dsp_tools.py +0 -96
  311. knora/dsplib/models/connection.py +0 -272
  312. knora/dsplib/models/group.py +0 -296
  313. knora/dsplib/models/helpers.py +0 -506
  314. knora/dsplib/models/langstring.py +0 -277
  315. knora/dsplib/models/listnode.py +0 -578
  316. knora/dsplib/models/model.py +0 -20
  317. knora/dsplib/models/ontology.py +0 -448
  318. knora/dsplib/models/permission.py +0 -112
  319. knora/dsplib/models/project.py +0 -583
  320. knora/dsplib/models/propertyclass.py +0 -505
  321. knora/dsplib/models/resource.py +0 -416
  322. knora/dsplib/models/resourceclass.py +0 -811
  323. knora/dsplib/models/sipi.py +0 -35
  324. knora/dsplib/models/user.py +0 -731
  325. knora/dsplib/models/value.py +0 -1000
  326. knora/dsplib/utils/knora-data-schema.xsd +0 -464
  327. knora/dsplib/utils/knora-schema-lists.json +0 -83
  328. knora/dsplib/utils/knora-schema.json +0 -444
  329. knora/dsplib/utils/onto_commons.py +0 -24
  330. knora/dsplib/utils/onto_create_lists.py +0 -73
  331. knora/dsplib/utils/onto_create_ontology.py +0 -451
  332. knora/dsplib/utils/onto_get.py +0 -58
  333. knora/dsplib/utils/onto_validate.py +0 -33
  334. knora/dsplib/utils/xml_upload.py +0 -540
  335. knora/dsplib/widgets/doublepassword.py +0 -80
  336. knora/knora.py +0 -2108
  337. knora/test.py +0 -99
  338. knora/testit.py +0 -76
  339. knora/xml2knora.py +0 -633
  340. {dsplib → dsp_tools/cli}/__init__.py +0 -0
  341. {dsplib/models → dsp_tools/clients}/__init__.py +0 -0
  342. {dsplib/utils → dsp_tools/commands}/__init__.py +0 -0
  343. {dsplib/widgets → dsp_tools/commands/create}/__init__.py +0 -0
  344. {knora → dsp_tools/commands/create/create_on_server}/__init__.py +0 -0
  345. {knora/dsplib → dsp_tools/commands/create/models}/__init__.py +0 -0
  346. {knora/dsplib/models → dsp_tools/commands/create/parsing}/__init__.py +0 -0
  347. {knora/dsplib/utils → dsp_tools/commands/create/serialisation}/__init__.py +0 -0
  348. {knora/dsplib/widgets → dsp_tools/commands/excel2json}/__init__.py +0 -0
@@ -0,0 +1,874 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://dasch.swiss/schema/properties-only.json",
4
+ "title": "JSON schema for properties used in DSP ontologies",
5
+ "description": "JSON schema for the properties section used in DSP ontologies",
6
+ "definitions": {
7
+ "langstring": {
8
+ "type": "object",
9
+ "patternProperties": {
10
+ "^(en|de|fr|it|rm)$": {
11
+ "type": "string"
12
+ }
13
+ },
14
+ "minProperties": 1,
15
+ "additionalProperties": false
16
+ },
17
+ "ncname": {
18
+ "type": "string",
19
+ "pattern": "^[a-zA-Z_][\\w.-]*$"
20
+ },
21
+ "prefixedname": {
22
+ "type": "string",
23
+ "pattern": "^([a-zA-Z_][\\w.-]*)?:([\\w.-]+)$"
24
+ },
25
+ "prefixedname_or_uri": {
26
+ "type": "string",
27
+ "pattern": "^(([a-zA-Z_][\\w.-]*)?:([\\w.-]+))|(https?://.*)$"
28
+ },
29
+ "baseresource": {
30
+ "type": "string",
31
+ "enum": [
32
+ "Resource",
33
+ "Region",
34
+ "Representation",
35
+ "StillImageRepresentation",
36
+ "TextRepresentation",
37
+ "AudioRepresentation",
38
+ "DDDRepresentation",
39
+ "DocumentRepresentation",
40
+ "MovingImageRepresentation",
41
+ "ArchiveRepresentation"
42
+ ]
43
+ },
44
+ "baseproperty": {
45
+ "type": "string",
46
+ "enum": [
47
+ "hasValue",
48
+ "hasLinkTo",
49
+ "hasColor",
50
+ "hasComment",
51
+ "isPartOf",
52
+ "hasRepresentation",
53
+ "seqnum"
54
+ ]
55
+ },
56
+ "basevalue": {
57
+ "type": "string",
58
+ "enum": [
59
+ "BooleanValue",
60
+ "ColorValue",
61
+ "DateValue",
62
+ "DecimalValue",
63
+ "GeonameValue",
64
+ "IntValue",
65
+ "ListValue",
66
+ "TextValue",
67
+ "TimeValue",
68
+ "UriValue"
69
+ ]
70
+ },
71
+ "gui_element": {
72
+ "type": "string",
73
+ "enum": [
74
+ "Checkbox",
75
+ "Colorpicker",
76
+ "Date",
77
+ "Geonames",
78
+ "List",
79
+ "Radio",
80
+ "Pulldown",
81
+ "Richtext",
82
+ "Searchbox",
83
+ "SimpleText",
84
+ "Spinbox",
85
+ "Textarea",
86
+ "TimeStamp"
87
+ ]
88
+ },
89
+ "property": {
90
+ "type": "object",
91
+ "properties": {
92
+ "name": {
93
+ "$ref": "#/definitions/ncname"
94
+ },
95
+ "super": {
96
+ "type": "array",
97
+ "items": {
98
+ "type": "string",
99
+ "oneOf": [
100
+ {
101
+ "$ref": "#/definitions/baseproperty"
102
+ },
103
+ {
104
+ "$ref": "#/definitions/prefixedname_or_uri"
105
+ }
106
+ ]
107
+ }
108
+ },
109
+ "object": {
110
+ "type": "string",
111
+ "oneOf": [
112
+ {
113
+ "$ref": "#/definitions/basevalue"
114
+ },
115
+ {
116
+ "$ref": "#/definitions/baseresource"
117
+ },
118
+ {
119
+ "$ref": "#/definitions/prefixedname"
120
+ }
121
+ ]
122
+ },
123
+ "subject": {
124
+ "$ref": "#/definitions/prefixedname"
125
+ },
126
+ "labels": {
127
+ "$ref": "#/definitions/langstring"
128
+ },
129
+ "gui_element": {
130
+ "$ref": "#/definitions/gui_element"
131
+ },
132
+ "gui_attributes": {
133
+ "type": "object",
134
+ "properties": {
135
+ "size": {
136
+ "type": "integer"
137
+ },
138
+ "maxlength": {
139
+ "type": "integer"
140
+ },
141
+ "hlist": {
142
+ "type": "string"
143
+ },
144
+ "numprops": {
145
+ "type": "integer"
146
+ },
147
+ "ncolors": {
148
+ "type": "integer"
149
+ },
150
+ "cols": {
151
+ "type": "integer"
152
+ },
153
+ "rows": {
154
+ "type": "integer"
155
+ },
156
+ "width": {
157
+ "type": "string",
158
+ "pattern": "^[0-9]*%?$"
159
+ },
160
+ "wrap": {
161
+ "type": "string",
162
+ "enum": [
163
+ "soft",
164
+ "hard"
165
+ ]
166
+ },
167
+ "max": {
168
+ "type": "number"
169
+ },
170
+ "min": {
171
+ "type": "number"
172
+ }
173
+ }
174
+ },
175
+ "comments": {
176
+ "$ref": "#/definitions/langstring"
177
+ }
178
+ },
179
+ "required": [
180
+ "name",
181
+ "super",
182
+ "object",
183
+ "labels",
184
+ "gui_element"
185
+ ],
186
+ "additionalProperties": false,
187
+ "allOf": [
188
+ {
189
+ "if": {
190
+ "properties": {
191
+ "super": {
192
+ "const": "hasLinkTo"
193
+ }
194
+ },
195
+ "required": [
196
+ "super"
197
+ ]
198
+ },
199
+ "then": {
200
+ "properties": {
201
+ "gui_element": {
202
+ "const": "Searchbox"
203
+ }
204
+ }
205
+ }
206
+ },
207
+ {
208
+ "if": {
209
+ "properties": {
210
+ "super": {
211
+ "const": "isPartOf"
212
+ }
213
+ },
214
+ "required": [
215
+ "super"
216
+ ]
217
+ },
218
+ "then": {
219
+ "properties": {
220
+ "gui_element": {
221
+ "const": "Searchbox"
222
+ }
223
+ }
224
+ }
225
+ },
226
+ {
227
+ "if": {
228
+ "properties": {
229
+ "object": {
230
+ "const": "Representation"
231
+ }
232
+ },
233
+ "required": [
234
+ "object"
235
+ ]
236
+ },
237
+ "then": {
238
+ "properties": {
239
+ "super": {
240
+ "type": "array",
241
+ "items": {
242
+ "type": "string",
243
+ "oneOf": [
244
+ {
245
+ "enum": [
246
+ "hasRepresentation",
247
+ "hasLinkTo"
248
+ ]
249
+ },
250
+ {
251
+ "$ref": "#/definitions/prefixedname_or_uri"
252
+ }
253
+ ]
254
+ }
255
+ },
256
+ "gui_element": {
257
+ "const": "Searchbox"
258
+ }
259
+ }
260
+ }
261
+ },
262
+ {
263
+ "if": {
264
+ "properties": {
265
+ "object": {
266
+ "const": "TextValue"
267
+ }
268
+ },
269
+ "required": [
270
+ "object"
271
+ ]
272
+ },
273
+ "then": {
274
+ "properties": {
275
+ "super": {
276
+ "type": "array",
277
+ "items": {
278
+ "type": "string",
279
+ "oneOf": [
280
+ {
281
+ "enum": [
282
+ "hasComment",
283
+ "hasValue"
284
+ ]
285
+ },
286
+ {
287
+ "$ref": "#/definitions/prefixedname_or_uri"
288
+ }
289
+ ]
290
+ }
291
+ },
292
+ "gui_element": {
293
+ "enum": [
294
+ "SimpleText",
295
+ "Textarea",
296
+ "Richtext"
297
+ ]
298
+ }
299
+ }
300
+ }
301
+ },
302
+ {
303
+ "if": {
304
+ "properties": {
305
+ "object": {
306
+ "const": "ColorValue"
307
+ }
308
+ },
309
+ "required": [
310
+ "object"
311
+ ]
312
+ },
313
+ "then": {
314
+ "properties": {
315
+ "super": {
316
+ "type": "array",
317
+ "items": {
318
+ "type": "string",
319
+ "oneOf": [
320
+ {
321
+ "enum": [
322
+ "hasColor"
323
+ ]
324
+ },
325
+ {
326
+ "$ref": "#/definitions/prefixedname_or_uri"
327
+ }
328
+ ]
329
+ }
330
+ },
331
+ "gui_element": {
332
+ "const": "Colorpicker"
333
+ }
334
+ }
335
+ }
336
+ },
337
+ {
338
+ "if": {
339
+ "properties": {
340
+ "object": {
341
+ "const": "DateValue"
342
+ }
343
+ },
344
+ "required": [
345
+ "object"
346
+ ]
347
+ },
348
+ "then": {
349
+ "properties": {
350
+ "super": {
351
+ "type": "array",
352
+ "items": {
353
+ "type": "string",
354
+ "oneOf": [
355
+ {
356
+ "enum": [
357
+ "hasValue"
358
+ ]
359
+ },
360
+ {
361
+ "$ref": "#/definitions/prefixedname_or_uri"
362
+ }
363
+ ]
364
+ }
365
+ },
366
+ "gui_element": {
367
+ "const": "Date"
368
+ }
369
+ }
370
+ }
371
+ },
372
+ {
373
+ "if": {
374
+ "properties": {
375
+ "object": {
376
+ "const": "TimeValue"
377
+ }
378
+ },
379
+ "required": [
380
+ "object"
381
+ ]
382
+ },
383
+ "then": {
384
+ "properties": {
385
+ "super": {
386
+ "type": "array",
387
+ "items": {
388
+ "type": "string",
389
+ "oneOf": [
390
+ {
391
+ "enum": [
392
+ "hasValue"
393
+ ]
394
+ },
395
+ {
396
+ "$ref": "#/definitions/prefixedname_or_uri"
397
+ }
398
+ ]
399
+ }
400
+ },
401
+ "gui_element": {
402
+ "const": "TimeStamp"
403
+ }
404
+ }
405
+ }
406
+ },
407
+ {
408
+ "if": {
409
+ "properties": {
410
+ "object": {
411
+ "const": "DecimalValue"
412
+ }
413
+ },
414
+ "required": [
415
+ "object"
416
+ ]
417
+ },
418
+ "then": {
419
+ "properties": {
420
+ "super": {
421
+ "type": "array",
422
+ "items": {
423
+ "type": "string",
424
+ "oneOf": [
425
+ {
426
+ "enum": [
427
+ "hasValue"
428
+ ]
429
+ },
430
+ {
431
+ "$ref": "#/definitions/prefixedname_or_uri"
432
+ }
433
+ ]
434
+ }
435
+ },
436
+ "gui_element": {
437
+ "enum": [
438
+ "Spinbox",
439
+ "SimpleText"
440
+ ]
441
+ }
442
+ }
443
+ }
444
+ },
445
+ {
446
+ "if": {
447
+ "properties": {
448
+ "object": {
449
+ "const": "GeonameValue"
450
+ }
451
+ },
452
+ "required": [
453
+ "object"
454
+ ]
455
+ },
456
+ "then": {
457
+ "properties": {
458
+ "super": {
459
+ "type": "array",
460
+ "items": {
461
+ "type": "string",
462
+ "oneOf": [
463
+ {
464
+ "enum": [
465
+ "hasValue"
466
+ ]
467
+ },
468
+ {
469
+ "$ref": "#/definitions/prefixedname_or_uri"
470
+ }
471
+ ]
472
+ }
473
+ },
474
+ "gui_element": {
475
+ "const": "Geonames"
476
+ }
477
+ }
478
+ }
479
+ },
480
+ {
481
+ "if": {
482
+ "properties": {
483
+ "object": {
484
+ "const": "IntValue"
485
+ }
486
+ },
487
+ "required": [
488
+ "object"
489
+ ]
490
+ },
491
+ "then": {
492
+ "properties": {
493
+ "super": {
494
+ "type": "array",
495
+ "items": {
496
+ "type": "string",
497
+ "oneOf": [
498
+ {
499
+ "enum": [
500
+ "hasValue",
501
+ "seqnum"
502
+ ]
503
+ },
504
+ {
505
+ "$ref": "#/definitions/prefixedname_or_uri"
506
+ }
507
+ ]
508
+ }
509
+ },
510
+ "gui_element": {
511
+ "enum": [
512
+ "Spinbox",
513
+ "SimpleText"
514
+ ]
515
+ }
516
+ }
517
+ }
518
+ },
519
+ {
520
+ "if": {
521
+ "properties": {
522
+ "object": {
523
+ "const": "BooleanValue"
524
+ }
525
+ },
526
+ "required": [
527
+ "object"
528
+ ]
529
+ },
530
+ "then": {
531
+ "properties": {
532
+ "super": {
533
+ "type": "array",
534
+ "items": {
535
+ "type": "string",
536
+ "oneOf": [
537
+ {
538
+ "enum": [
539
+ "hasValue"
540
+ ]
541
+ },
542
+ {
543
+ "$ref": "#/definitions/prefixedname_or_uri"
544
+ }
545
+ ]
546
+ }
547
+ },
548
+ "gui_element": {
549
+ "const": "Checkbox"
550
+ }
551
+ }
552
+ }
553
+ },
554
+ {
555
+ "if": {
556
+ "properties": {
557
+ "object": {
558
+ "const": "UriValue"
559
+ }
560
+ },
561
+ "required": [
562
+ "object"
563
+ ]
564
+ },
565
+ "then": {
566
+ "properties": {
567
+ "super": {
568
+ "type": "array",
569
+ "items": {
570
+ "type": "string",
571
+ "oneOf": [
572
+ {
573
+ "enum": [
574
+ "hasValue"
575
+ ]
576
+ },
577
+ {
578
+ "$ref": "#/definitions/prefixedname_or_uri"
579
+ }
580
+ ]
581
+ }
582
+ },
583
+ "gui_element": {
584
+ "const": "SimpleText"
585
+ }
586
+ }
587
+ }
588
+ },
589
+ {
590
+ "if": {
591
+ "properties": {
592
+ "object": {
593
+ "const": "ListValue"
594
+ }
595
+ },
596
+ "required": [
597
+ "object"
598
+ ]
599
+ },
600
+ "then": {
601
+ "properties": {
602
+ "super": {
603
+ "type": "array",
604
+ "items": {
605
+ "type": "string",
606
+ "oneOf": [
607
+ {
608
+ "enum": [
609
+ "hasValue"
610
+ ]
611
+ },
612
+ {
613
+ "$ref": "#/definitions/prefixedname_or_uri"
614
+ }
615
+ ]
616
+ }
617
+ },
618
+ "gui_element": {
619
+ "enum": [
620
+ "List",
621
+ "Radio",
622
+ "Pulldown"
623
+ ]
624
+ },
625
+ "gui_attributes": {
626
+ "type": "object",
627
+ "properties": {
628
+ "hlist": {
629
+ "type": "string"
630
+ }
631
+ },
632
+ "required": [
633
+ "hlist"
634
+ ],
635
+ "additionalProperties": false
636
+ }
637
+ },
638
+ "required": [
639
+ "gui_element",
640
+ "gui_attributes"
641
+ ]
642
+ }
643
+ },
644
+ {
645
+ "if": {
646
+ "properties": {
647
+ "object": {
648
+ "$ref": "#/definitions/prefixedname"
649
+ }
650
+ },
651
+ "required": [
652
+ "object"
653
+ ]
654
+ },
655
+ "then": {
656
+ "properties": {
657
+ "gui_element": {
658
+ "const": "Searchbox"
659
+ }
660
+ }
661
+ }
662
+ },
663
+ {
664
+ "if": {
665
+ "properties": {
666
+ "gui_element": {
667
+ "const": "SimpleText"
668
+ }
669
+ },
670
+ "required": [
671
+ "gui_element"
672
+ ]
673
+ },
674
+ "then": {
675
+ "properties": {
676
+ "gui_attributes": {
677
+ "type": "object",
678
+ "properties": {
679
+ "maxlength": {
680
+ "type": "integer"
681
+ },
682
+ "size": {
683
+ "type": "integer"
684
+ }
685
+ },
686
+ "additionalProperties": false
687
+ }
688
+ }
689
+ }
690
+ },
691
+ {
692
+ "if": {
693
+ "properties": {
694
+ "gui_element": {
695
+ "const": "Textarea"
696
+ }
697
+ },
698
+ "required": [
699
+ "gui_element"
700
+ ]
701
+ },
702
+ "then": {
703
+ "properties": {
704
+ "gui_attributes": {
705
+ "type": "object",
706
+ "properties": {
707
+ "cols": {
708
+ "type": "integer"
709
+ },
710
+ "rows": {
711
+ "type": "integer"
712
+ },
713
+ "width": {
714
+ "type": "string",
715
+ "pattern": "^[0-9]*%?$"
716
+ },
717
+ "wrap": {
718
+ "enum": [
719
+ "soft",
720
+ "hard"
721
+ ]
722
+ }
723
+ },
724
+ "additionalProperties": false
725
+ }
726
+ }
727
+ }
728
+ },
729
+ {
730
+ "if": {
731
+ "properties": {
732
+ "gui_element": {
733
+ "const": "Colorpicker"
734
+ }
735
+ },
736
+ "required": [
737
+ "gui_element"
738
+ ]
739
+ },
740
+ "then": {
741
+ "properties": {
742
+ "gui_attributes": {
743
+ "type": "object",
744
+ "properties": {
745
+ "ncolors": {
746
+ "type": "integer"
747
+ }
748
+ },
749
+ "additionalProperties": false
750
+ }
751
+ }
752
+ }
753
+ },
754
+ {
755
+ "if": {
756
+ "properties": {
757
+ "gui_element": {
758
+ "const": "Spinbox"
759
+ }
760
+ },
761
+ "required": [
762
+ "gui_element"
763
+ ]
764
+ },
765
+ "then": {
766
+ "properties": {
767
+ "gui_attributes": {
768
+ "type": "object",
769
+ "properties": {
770
+ "max": {
771
+ "type": "number"
772
+ },
773
+ "min": {
774
+ "type": "number"
775
+ }
776
+ },
777
+ "additionalProperties": false
778
+ }
779
+ }
780
+ }
781
+ },
782
+ {
783
+ "if": {
784
+ "properties": {
785
+ "gui_element": {
786
+ "enum": [
787
+ "List",
788
+ "Radio",
789
+ "Pulldown"
790
+ ]
791
+ }
792
+ },
793
+ "required": [
794
+ "gui_element"
795
+ ]
796
+ },
797
+ "then": {
798
+ "properties": {
799
+ "gui_attributes": {
800
+ "type": "object",
801
+ "properties": {
802
+ "hlist": {
803
+ "type": "string"
804
+ }
805
+ },
806
+ "required": [
807
+ "hlist"
808
+ ],
809
+ "additionalProperties": false
810
+ }
811
+ },
812
+ "required": [
813
+ "gui_attributes"
814
+ ]
815
+ }
816
+ },
817
+ {
818
+ "if": {
819
+ "properties": {
820
+ "gui_element": {
821
+ "const": "Searchbox"
822
+ }
823
+ },
824
+ "required": [
825
+ "gui_element"
826
+ ]
827
+ },
828
+ "then": {
829
+ "properties": {
830
+ "gui_attributes": {
831
+ "type": "object",
832
+ "properties": {
833
+ "numprops": {
834
+ "type": "integer"
835
+ }
836
+ },
837
+ "additionalProperties": false
838
+ }
839
+ }
840
+ }
841
+ },
842
+ {
843
+ "if": {
844
+ "properties": {
845
+ "gui_element": {
846
+ "enum": [
847
+ "Richtext",
848
+ "Date",
849
+ "TimeStamp",
850
+ "Geonames",
851
+ "Checkbox"
852
+ ]
853
+ }
854
+ },
855
+ "required": [
856
+ "gui_element"
857
+ ]
858
+ },
859
+ "then": {
860
+ "not": {
861
+ "required": [
862
+ "gui_attributes"
863
+ ]
864
+ }
865
+ }
866
+ }
867
+ ]
868
+ }
869
+ },
870
+ "type": "array",
871
+ "items": {
872
+ "$ref": "#/definitions/property"
873
+ }
874
+ }