dsp-tools 9.1.0.post11__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.
- dsp_tools/__init__.py +4 -0
- dsp_tools/cli/args.py +36 -0
- dsp_tools/cli/call_action.py +51 -231
- dsp_tools/cli/call_action_files_only.py +101 -0
- dsp_tools/cli/call_action_with_network.py +207 -0
- dsp_tools/cli/create_parsers.py +156 -58
- dsp_tools/cli/entry_point.py +56 -26
- dsp_tools/cli/utils.py +87 -0
- dsp_tools/clients/CLAUDE.md +420 -0
- dsp_tools/clients/authentication_client.py +14 -0
- dsp_tools/clients/authentication_client_live.py +66 -0
- dsp_tools/{utils → clients}/connection.py +2 -18
- dsp_tools/clients/connection_live.py +233 -0
- dsp_tools/clients/fuseki_metrics.py +60 -0
- dsp_tools/clients/group_user_clients.py +35 -0
- dsp_tools/clients/group_user_clients_live.py +181 -0
- dsp_tools/clients/legal_info_client.py +23 -0
- dsp_tools/clients/legal_info_client_live.py +132 -0
- dsp_tools/clients/list_client.py +49 -0
- dsp_tools/clients/list_client_live.py +166 -0
- dsp_tools/clients/metadata_client.py +24 -0
- dsp_tools/clients/metadata_client_live.py +47 -0
- dsp_tools/clients/ontology_clients.py +49 -0
- dsp_tools/clients/ontology_create_client_live.py +166 -0
- dsp_tools/clients/ontology_get_client_live.py +80 -0
- dsp_tools/clients/permissions_client.py +68 -0
- dsp_tools/clients/project_client.py +16 -0
- dsp_tools/clients/project_client_live.py +66 -0
- dsp_tools/commands/create/communicate_problems.py +24 -0
- dsp_tools/commands/create/create.py +134 -0
- dsp_tools/commands/create/create_on_server/cardinalities.py +111 -0
- dsp_tools/commands/create/create_on_server/classes.py +99 -0
- dsp_tools/commands/create/create_on_server/complete_ontologies.py +116 -0
- dsp_tools/commands/create/create_on_server/default_permissions.py +134 -0
- dsp_tools/commands/create/create_on_server/group_users.py +165 -0
- dsp_tools/commands/create/create_on_server/lists.py +163 -0
- dsp_tools/commands/create/create_on_server/mappers.py +12 -0
- dsp_tools/commands/create/create_on_server/onto_utils.py +74 -0
- dsp_tools/commands/create/create_on_server/ontology.py +52 -0
- dsp_tools/commands/create/create_on_server/project.py +68 -0
- dsp_tools/commands/create/create_on_server/properties.py +119 -0
- dsp_tools/commands/create/exceptions.py +29 -0
- dsp_tools/commands/create/lists_only.py +66 -0
- dsp_tools/commands/create/models/create_problems.py +87 -0
- dsp_tools/commands/create/models/parsed_ontology.py +88 -0
- dsp_tools/commands/create/models/parsed_project.py +81 -0
- dsp_tools/commands/create/models/rdf_ontology.py +12 -0
- dsp_tools/commands/create/models/server_project_info.py +100 -0
- dsp_tools/commands/create/parsing/parse_lists.py +45 -0
- dsp_tools/commands/create/parsing/parse_ontology.py +243 -0
- dsp_tools/commands/create/parsing/parse_project.py +149 -0
- dsp_tools/commands/create/parsing/parsing_utils.py +40 -0
- dsp_tools/commands/create/project_validate.py +595 -0
- dsp_tools/commands/create/serialisation/ontology.py +119 -0
- dsp_tools/commands/create/serialisation/project.py +44 -0
- dsp_tools/commands/excel2json/CLAUDE.md +101 -0
- dsp_tools/commands/excel2json/json_header.py +57 -23
- dsp_tools/commands/excel2json/{new_lists → lists}/compliance_checks.py +26 -26
- dsp_tools/commands/excel2json/{new_lists/make_new_lists.py → lists/make_lists.py} +19 -18
- dsp_tools/commands/excel2json/{new_lists → lists}/models/input_error.py +1 -12
- dsp_tools/commands/excel2json/{new_lists → lists}/models/serialise.py +9 -5
- dsp_tools/commands/excel2json/{new_lists → lists}/utils.py +4 -4
- dsp_tools/commands/excel2json/models/input_error.py +31 -11
- dsp_tools/commands/excel2json/models/json_header.py +53 -15
- dsp_tools/commands/excel2json/models/ontology.py +4 -3
- dsp_tools/commands/excel2json/{lists.py → old_lists.py} +26 -112
- dsp_tools/commands/excel2json/project.py +78 -34
- dsp_tools/commands/excel2json/properties.py +57 -36
- dsp_tools/commands/excel2json/resources.py +32 -12
- dsp_tools/commands/excel2json/utils.py +20 -1
- dsp_tools/commands/excel2xml/__init__.py +2 -2
- dsp_tools/commands/excel2xml/excel2xml_cli.py +7 -15
- dsp_tools/commands/excel2xml/excel2xml_lib.py +138 -493
- dsp_tools/commands/excel2xml/propertyelement.py +5 -5
- dsp_tools/commands/{project → get}/get.py +29 -13
- dsp_tools/commands/get/get_permissions.py +257 -0
- dsp_tools/commands/get/get_permissions_legacy.py +89 -0
- dsp_tools/commands/{project/models → get/legacy_models}/context.py +6 -6
- dsp_tools/commands/{project/models → get/legacy_models}/group.py +5 -10
- dsp_tools/commands/{project/models → get/legacy_models}/listnode.py +5 -35
- dsp_tools/commands/{project/models → get/legacy_models}/model.py +1 -1
- dsp_tools/commands/{project/models → get/legacy_models}/ontology.py +9 -14
- dsp_tools/commands/{project/models → get/legacy_models}/project.py +13 -6
- dsp_tools/commands/{project/models → get/legacy_models}/propertyclass.py +9 -16
- dsp_tools/commands/{project/models → get/legacy_models}/resourceclass.py +8 -46
- dsp_tools/commands/{project/models → get/legacy_models}/user.py +19 -60
- dsp_tools/commands/get/models/permissions_models.py +10 -0
- dsp_tools/commands/id2iri.py +20 -10
- dsp_tools/commands/ingest_xmlupload/bulk_ingest_client.py +81 -56
- dsp_tools/commands/ingest_xmlupload/create_resources/apply_ingest_id.py +4 -10
- dsp_tools/commands/ingest_xmlupload/create_resources/upload_xml.py +97 -37
- dsp_tools/commands/ingest_xmlupload/create_resources/user_information.py +2 -2
- dsp_tools/commands/ingest_xmlupload/ingest_files/ingest_files.py +9 -10
- dsp_tools/commands/ingest_xmlupload/upload_files/filechecker.py +3 -3
- dsp_tools/commands/ingest_xmlupload/upload_files/input_error.py +2 -10
- dsp_tools/commands/ingest_xmlupload/upload_files/upload_failures.py +12 -2
- dsp_tools/commands/ingest_xmlupload/upload_files/upload_files.py +8 -9
- dsp_tools/commands/resume_xmlupload/resume_xmlupload.py +18 -18
- dsp_tools/commands/start_stack.py +126 -77
- dsp_tools/commands/update_legal/CLAUDE.md +344 -0
- dsp_tools/commands/update_legal/__init__.py +0 -0
- dsp_tools/commands/update_legal/core.py +182 -0
- dsp_tools/commands/update_legal/csv_operations.py +135 -0
- dsp_tools/commands/update_legal/models.py +87 -0
- dsp_tools/commands/update_legal/xml_operations.py +247 -0
- dsp_tools/commands/validate_data/CLAUDE.md +159 -0
- dsp_tools/commands/validate_data/__init__.py +0 -0
- dsp_tools/commands/validate_data/constants.py +59 -0
- dsp_tools/commands/validate_data/mappers.py +143 -0
- dsp_tools/commands/validate_data/models/__init__.py +0 -0
- dsp_tools/commands/validate_data/models/api_responses.py +45 -0
- dsp_tools/commands/validate_data/models/input_problems.py +119 -0
- dsp_tools/commands/validate_data/models/rdf_like_data.py +117 -0
- dsp_tools/commands/validate_data/models/validation.py +106 -0
- dsp_tools/commands/validate_data/prepare_data/__init__.py +0 -0
- dsp_tools/commands/validate_data/prepare_data/get_rdf_like_data.py +296 -0
- dsp_tools/commands/validate_data/prepare_data/make_data_graph.py +91 -0
- dsp_tools/commands/validate_data/prepare_data/prepare_data.py +184 -0
- dsp_tools/commands/validate_data/process_validation_report/__init__.py +0 -0
- dsp_tools/commands/validate_data/process_validation_report/get_user_validation_message.py +358 -0
- dsp_tools/commands/validate_data/process_validation_report/query_validation_result.py +507 -0
- dsp_tools/commands/validate_data/process_validation_report/reformat_validation_results.py +150 -0
- dsp_tools/commands/validate_data/shacl_cli_validator.py +70 -0
- dsp_tools/commands/validate_data/sparql/__init__.py +0 -0
- dsp_tools/commands/{xml_validate/sparql/resource_shacl.py → validate_data/sparql/cardinality_shacl.py} +45 -47
- dsp_tools/commands/validate_data/sparql/construct_shacl.py +92 -0
- dsp_tools/commands/validate_data/sparql/legal_info_shacl.py +36 -0
- dsp_tools/commands/validate_data/sparql/value_shacl.py +357 -0
- dsp_tools/commands/validate_data/utils.py +59 -0
- dsp_tools/commands/validate_data/validate_data.py +283 -0
- dsp_tools/commands/validate_data/validation/__init__.py +0 -0
- dsp_tools/commands/validate_data/validation/check_duplicate_files.py +55 -0
- dsp_tools/commands/validate_data/validation/check_for_unknown_classes.py +67 -0
- dsp_tools/commands/validate_data/validation/get_validation_report.py +94 -0
- dsp_tools/commands/validate_data/validation/validate_ontology.py +107 -0
- dsp_tools/commands/xmlupload/CLAUDE.md +292 -0
- dsp_tools/commands/xmlupload/make_rdf_graph/__init__.py +0 -0
- dsp_tools/commands/xmlupload/make_rdf_graph/constants.py +63 -0
- dsp_tools/commands/xmlupload/make_rdf_graph/jsonld_utils.py +44 -0
- dsp_tools/commands/xmlupload/make_rdf_graph/make_file_value.py +77 -0
- dsp_tools/commands/xmlupload/make_rdf_graph/make_resource_and_values.py +114 -0
- dsp_tools/commands/xmlupload/make_rdf_graph/make_values.py +262 -0
- dsp_tools/commands/xmlupload/models/bitstream_info.py +18 -0
- dsp_tools/commands/xmlupload/models/formatted_text_value.py +0 -25
- dsp_tools/commands/xmlupload/models/ingest.py +56 -70
- dsp_tools/commands/xmlupload/models/input_problems.py +6 -14
- dsp_tools/commands/xmlupload/models/lookup_models.py +21 -0
- dsp_tools/commands/xmlupload/models/permission.py +0 -39
- dsp_tools/commands/xmlupload/models/{deserialise/xmlpermission.py → permissions_parsed.py} +2 -2
- dsp_tools/commands/xmlupload/models/processed/__init__.py +0 -0
- dsp_tools/commands/xmlupload/models/processed/file_values.py +29 -0
- dsp_tools/commands/xmlupload/models/processed/res.py +27 -0
- dsp_tools/commands/xmlupload/models/processed/values.py +101 -0
- dsp_tools/commands/xmlupload/models/rdf_models.py +26 -0
- dsp_tools/commands/xmlupload/models/upload_clients.py +3 -3
- dsp_tools/commands/xmlupload/models/upload_state.py +2 -4
- dsp_tools/commands/xmlupload/prepare_xml_input/__init__.py +0 -0
- dsp_tools/commands/xmlupload/{ark2iri.py → prepare_xml_input/ark2iri.py} +1 -1
- dsp_tools/commands/xmlupload/prepare_xml_input/get_processed_resources.py +252 -0
- dsp_tools/commands/xmlupload/{iiif_uri_validator.py → prepare_xml_input/iiif_uri_validator.py} +2 -14
- dsp_tools/commands/xmlupload/{list_client.py → prepare_xml_input/list_client.py} +15 -10
- dsp_tools/commands/xmlupload/prepare_xml_input/prepare_xml_input.py +67 -0
- dsp_tools/commands/xmlupload/prepare_xml_input/read_validate_xml_file.py +58 -0
- dsp_tools/commands/xmlupload/prepare_xml_input/transform_input_values.py +118 -0
- dsp_tools/commands/xmlupload/resource_create_client.py +7 -468
- dsp_tools/commands/xmlupload/richtext_id2iri.py +37 -0
- dsp_tools/commands/xmlupload/stash/{construct_and_analyze_graph.py → analyse_circular_reference_graph.py} +64 -157
- dsp_tools/commands/xmlupload/stash/create_info_for_graph.py +53 -0
- dsp_tools/commands/xmlupload/stash/graph_models.py +13 -8
- dsp_tools/commands/xmlupload/stash/stash_circular_references.py +48 -115
- dsp_tools/commands/xmlupload/stash/stash_models.py +4 -9
- dsp_tools/commands/xmlupload/stash/upload_stashed_resptr_props.py +34 -40
- dsp_tools/commands/xmlupload/stash/upload_stashed_xml_texts.py +98 -108
- dsp_tools/commands/xmlupload/upload_config.py +8 -0
- dsp_tools/commands/xmlupload/write_diagnostic_info.py +14 -9
- dsp_tools/commands/xmlupload/xmlupload.py +214 -192
- dsp_tools/config/__init__.py +0 -0
- dsp_tools/config/logger_config.py +69 -0
- dsp_tools/{utils → config}/warnings_config.py +4 -1
- dsp_tools/error/__init__.py +0 -0
- dsp_tools/error/custom_warnings.py +39 -0
- dsp_tools/error/exceptions.py +204 -0
- dsp_tools/error/problems.py +10 -0
- dsp_tools/error/xmllib_errors.py +20 -0
- dsp_tools/error/xmllib_warnings.py +54 -0
- dsp_tools/error/xmllib_warnings_util.py +159 -0
- dsp_tools/error/xsd_validation_error_msg.py +19 -0
- dsp_tools/legacy_models/__init__.py +0 -0
- dsp_tools/{models → legacy_models}/datetimestamp.py +7 -7
- dsp_tools/{models → legacy_models}/langstring.py +1 -1
- dsp_tools/{models → legacy_models}/projectContext.py +4 -4
- dsp_tools/resources/schema/data.xsd +108 -83
- dsp_tools/resources/schema/lists-only.json +4 -23
- dsp_tools/resources/schema/project.json +80 -35
- dsp_tools/resources/schema/properties-only.json +1 -4
- dsp_tools/resources/start-stack/docker-compose.override-host.j2 +11 -0
- dsp_tools/resources/start-stack/docker-compose.yml +34 -30
- dsp_tools/resources/start-stack/dsp-app-config.json +45 -0
- dsp_tools/resources/start-stack/dsp-app-config.override-host.j2 +26 -0
- dsp_tools/resources/validate_data/api-shapes-resource-cardinalities.ttl +191 -0
- dsp_tools/resources/validate_data/api-shapes.ttl +804 -0
- dsp_tools/resources/validate_data/shacl-cli-image.yml +4 -0
- dsp_tools/resources/validate_data/validate-ontology.ttl +99 -0
- dsp_tools/utils/ansi_colors.py +32 -0
- dsp_tools/utils/data_formats/__init__.py +0 -0
- dsp_tools/utils/{date_util.py → data_formats/date_util.py} +13 -1
- dsp_tools/utils/data_formats/iri_util.py +30 -0
- dsp_tools/utils/{shared.py → data_formats/shared.py} +1 -35
- dsp_tools/utils/{uri_util.py → data_formats/uri_util.py} +12 -2
- dsp_tools/utils/fuseki_bloating.py +63 -0
- dsp_tools/utils/json_parsing.py +22 -0
- dsp_tools/utils/rdf_constants.py +42 -0
- dsp_tools/utils/rdflib_utils.py +10 -0
- dsp_tools/utils/replace_id_with_iri.py +66 -0
- dsp_tools/utils/request_utils.py +238 -0
- dsp_tools/utils/xml_parsing/__init__.py +0 -0
- dsp_tools/utils/xml_parsing/get_lookups.py +32 -0
- dsp_tools/utils/xml_parsing/get_parsed_resources.py +325 -0
- dsp_tools/utils/xml_parsing/models/__init__.py +0 -0
- dsp_tools/utils/xml_parsing/models/parsed_resource.py +76 -0
- dsp_tools/utils/xml_parsing/parse_clean_validate_xml.py +137 -0
- dsp_tools/xmllib/CLAUDE.md +302 -0
- dsp_tools/xmllib/__init__.py +49 -0
- dsp_tools/xmllib/general_functions.py +877 -0
- dsp_tools/xmllib/internal/__init__.py +0 -0
- dsp_tools/xmllib/internal/checkers.py +162 -0
- dsp_tools/xmllib/internal/circumvent_circular_imports.py +36 -0
- dsp_tools/xmllib/internal/constants.py +46 -0
- dsp_tools/xmllib/internal/input_converters.py +155 -0
- dsp_tools/xmllib/internal/serialise_file_value.py +57 -0
- dsp_tools/xmllib/internal/serialise_resource.py +177 -0
- dsp_tools/xmllib/internal/serialise_values.py +152 -0
- dsp_tools/xmllib/internal/type_aliases.py +11 -0
- dsp_tools/xmllib/models/config_options.py +28 -0
- dsp_tools/xmllib/models/date_formats.py +48 -0
- dsp_tools/xmllib/models/dsp_base_resources.py +1380 -400
- dsp_tools/xmllib/models/internal/__init__.py +0 -0
- dsp_tools/xmllib/models/internal/file_values.py +172 -0
- dsp_tools/xmllib/models/internal/geometry.py +162 -0
- dsp_tools/xmllib/models/{migration_metadata.py → internal/migration_metadata.py} +14 -10
- dsp_tools/xmllib/models/internal/serialise_permissions.py +66 -0
- dsp_tools/xmllib/models/internal/values.py +342 -0
- dsp_tools/xmllib/models/licenses/__init__.py +0 -0
- dsp_tools/xmllib/models/licenses/other.py +59 -0
- dsp_tools/xmllib/models/licenses/recommended.py +107 -0
- dsp_tools/xmllib/models/permissions.py +41 -0
- dsp_tools/xmllib/models/res.py +1782 -0
- dsp_tools/xmllib/models/root.py +313 -26
- dsp_tools/xmllib/value_checkers.py +310 -47
- dsp_tools/xmllib/value_converters.py +765 -8
- dsp_tools-18.3.0.post13.dist-info/METADATA +90 -0
- dsp_tools-18.3.0.post13.dist-info/RECORD +286 -0
- dsp_tools-18.3.0.post13.dist-info/WHEEL +4 -0
- {dsp_tools-9.1.0.post11.dist-info → dsp_tools-18.3.0.post13.dist-info}/entry_points.txt +1 -0
- dsp_tools/commands/project/create/project_create.py +0 -1107
- dsp_tools/commands/project/create/project_create_lists.py +0 -204
- dsp_tools/commands/project/create/project_validate.py +0 -453
- dsp_tools/commands/project/models/project_definition.py +0 -12
- dsp_tools/commands/rosetta.py +0 -124
- dsp_tools/commands/template.py +0 -30
- dsp_tools/commands/xml_validate/api_connection.py +0 -122
- dsp_tools/commands/xml_validate/deserialise_input.py +0 -135
- dsp_tools/commands/xml_validate/make_data_rdf.py +0 -193
- dsp_tools/commands/xml_validate/models/data_deserialised.py +0 -108
- dsp_tools/commands/xml_validate/models/data_rdf.py +0 -214
- dsp_tools/commands/xml_validate/models/input_problems.py +0 -191
- dsp_tools/commands/xml_validate/models/validation.py +0 -29
- dsp_tools/commands/xml_validate/reformat_validaton_result.py +0 -89
- dsp_tools/commands/xml_validate/sparql/construct_shapes.py +0 -16
- dsp_tools/commands/xml_validate/xml_validate.py +0 -151
- dsp_tools/commands/xmlupload/check_consistency_with_ontology.py +0 -253
- dsp_tools/commands/xmlupload/models/deserialise/deserialise_value.py +0 -236
- dsp_tools/commands/xmlupload/models/deserialise/xmlresource.py +0 -171
- dsp_tools/commands/xmlupload/models/namespace_context.py +0 -39
- dsp_tools/commands/xmlupload/models/ontology_lookup_models.py +0 -161
- dsp_tools/commands/xmlupload/models/ontology_problem_models.py +0 -178
- dsp_tools/commands/xmlupload/models/serialise/jsonld_serialiser.py +0 -40
- dsp_tools/commands/xmlupload/models/serialise/serialise_value.py +0 -51
- dsp_tools/commands/xmlupload/ontology_client.py +0 -92
- dsp_tools/commands/xmlupload/project_client.py +0 -91
- dsp_tools/commands/xmlupload/read_validate_xml_file.py +0 -99
- dsp_tools/models/custom_warnings.py +0 -31
- dsp_tools/models/exceptions.py +0 -90
- dsp_tools/resources/0100-template-repo/template.json +0 -45
- dsp_tools/resources/0100-template-repo/template.xml +0 -27
- dsp_tools/resources/start-stack/docker-compose-validation.yml +0 -5
- dsp_tools/resources/start-stack/start-stack-config.yml +0 -4
- dsp_tools/resources/xml_validate/api-shapes.ttl +0 -411
- dsp_tools/resources/xml_validate/replace_namespace.xslt +0 -61
- dsp_tools/utils/connection_live.py +0 -383
- dsp_tools/utils/iri_util.py +0 -14
- dsp_tools/utils/logger_config.py +0 -41
- dsp_tools/utils/set_encoder.py +0 -20
- dsp_tools/utils/xml_utils.py +0 -145
- dsp_tools/utils/xml_validation.py +0 -197
- dsp_tools/utils/xml_validation_models.py +0 -68
- dsp_tools/xmllib/models/file_values.py +0 -78
- dsp_tools/xmllib/models/resource.py +0 -415
- dsp_tools/xmllib/models/values.py +0 -428
- dsp_tools-9.1.0.post11.dist-info/METADATA +0 -130
- dsp_tools-9.1.0.post11.dist-info/RECORD +0 -167
- dsp_tools-9.1.0.post11.dist-info/WHEEL +0 -4
- dsp_tools-9.1.0.post11.dist-info/licenses/LICENSE +0 -674
- /dsp_tools/{commands/excel2json/new_lists → clients}/__init__.py +0 -0
- /dsp_tools/commands/{excel2json/new_lists/models → create}/__init__.py +0 -0
- /dsp_tools/commands/{project → create/create_on_server}/__init__.py +0 -0
- /dsp_tools/commands/{project/create → create/models}/__init__.py +0 -0
- /dsp_tools/commands/{project/models → create/parsing}/__init__.py +0 -0
- /dsp_tools/commands/{xml_validate → create/serialisation}/__init__.py +0 -0
- /dsp_tools/commands/{xml_validate/models → excel2json/lists}/__init__.py +0 -0
- /dsp_tools/commands/{xml_validate/sparql → excel2json/lists/models}/__init__.py +0 -0
- /dsp_tools/commands/excel2json/{new_lists → lists}/models/deserialise.py +0 -0
- /dsp_tools/commands/{xmlupload/models/deserialise → get}/__init__.py +0 -0
- /dsp_tools/commands/{xmlupload/models/serialise → get/legacy_models}/__init__.py +0 -0
- /dsp_tools/commands/{project/models → get/legacy_models}/helpers.py +0 -0
- /dsp_tools/{models → commands/get/models}/__init__.py +0 -0
|
@@ -0,0 +1,804 @@
|
|
|
1
|
+
@prefix sh: <http://www.w3.org/ns/shacl#> .
|
|
2
|
+
@prefix dash: <http://datashapes.org/dash#> .
|
|
3
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
4
|
+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
5
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
6
|
+
@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
7
|
+
@prefix knora-api: <http://api.knora.org/ontology/knora-api/v2#> .
|
|
8
|
+
|
|
9
|
+
@prefix api-shapes: <http://api.knora.org/ontology/knora-api/shapes/v2#> .
|
|
10
|
+
|
|
11
|
+
#########################################
|
|
12
|
+
# GENERAL SHAPES
|
|
13
|
+
#########################################
|
|
14
|
+
|
|
15
|
+
# Cardinalities for the Resources are validated through designated shapes for the cardinality violations.
|
|
16
|
+
# Adding cardinalities to properties here would lead to duplication of the error message,
|
|
17
|
+
# therefore only the content is validated with the shapes for the resources.
|
|
18
|
+
|
|
19
|
+
########################
|
|
20
|
+
# UNIQUE VALUE SHAPE
|
|
21
|
+
########################
|
|
22
|
+
|
|
23
|
+
api-shapes:UniqueValue_Shape
|
|
24
|
+
a sh:NodeShape ;
|
|
25
|
+
sh:targetClass knora-api:Resource ;
|
|
26
|
+
sh:sparql [
|
|
27
|
+
a sh:SPARQLConstraint ;
|
|
28
|
+
sh:select """
|
|
29
|
+
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
|
30
|
+
PREFIX knora-api: <http://api.knora.org/ontology/knora-api/v2#>
|
|
31
|
+
PREFIX api-shapes: <http://api.knora.org/ontology/knora-api/shapes/v2#>
|
|
32
|
+
|
|
33
|
+
SELECT $this ?path ?value WHERE {
|
|
34
|
+
|
|
35
|
+
$this ?path ?valueClass .
|
|
36
|
+
|
|
37
|
+
{
|
|
38
|
+
?prop rdfs:subPropertyOf knora-api:valueHas .
|
|
39
|
+
?valueClass ?prop ?value .
|
|
40
|
+
}
|
|
41
|
+
UNION
|
|
42
|
+
{
|
|
43
|
+
?valueClass knora-api:valueAsString|api-shapes:linkValueHasTargetID ?value .
|
|
44
|
+
}
|
|
45
|
+
FILTER NOT EXISTS { ?valueClass knora-api:valueHasComment ?value }
|
|
46
|
+
}
|
|
47
|
+
GROUP BY $this ?path ?value
|
|
48
|
+
HAVING (COUNT(?value) > 1)
|
|
49
|
+
""" ;
|
|
50
|
+
sh:severity sh:Violation ;
|
|
51
|
+
sh:message "A resource may not have the same property and value more than one time." ;
|
|
52
|
+
] .
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
########################
|
|
56
|
+
# GENERIC RESOURCE SHAPE
|
|
57
|
+
########################
|
|
58
|
+
|
|
59
|
+
api-shapes:Resource_Shape
|
|
60
|
+
a sh:NodeShape ;
|
|
61
|
+
sh:targetClass knora-api:Resource ;
|
|
62
|
+
sh:name "Validates generic properties of all Resources" ;
|
|
63
|
+
sh:property [
|
|
64
|
+
a sh:PropertyShape ;
|
|
65
|
+
sh:path rdfs:label ;
|
|
66
|
+
sh:datatype xsd:string ;
|
|
67
|
+
sh:pattern "\\s*\\S+\\s*" ;
|
|
68
|
+
dash:singleLine true ;
|
|
69
|
+
sh:severity sh:Violation ;
|
|
70
|
+
sh:message "The label must be a non-empty string without newlines."
|
|
71
|
+
] ,
|
|
72
|
+
[
|
|
73
|
+
# Currently StandOff are attached directly to the resource and not in a LinkValue,
|
|
74
|
+
# therefore we do not validate it like a normal link with a LinkValue
|
|
75
|
+
a sh:PropertyShape ;
|
|
76
|
+
sh:path knora-api:hasStandoffLinkTo ;
|
|
77
|
+
sh:class knora-api:Resource ;
|
|
78
|
+
sh:severity sh:Violation ;
|
|
79
|
+
sh:message "A stand-off link must target an existing resource."
|
|
80
|
+
] .
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
########################
|
|
84
|
+
# USER FACING VALUES
|
|
85
|
+
########################
|
|
86
|
+
|
|
87
|
+
# Cardinalities for Values are not evaluated separately and they can be included in this file.
|
|
88
|
+
# This however, will only work as long as the shapes for the knora-api:Value are not closed.
|
|
89
|
+
|
|
90
|
+
api-shapes:Value_ClassShape
|
|
91
|
+
a sh:NodeShape ;
|
|
92
|
+
sh:targetClass knora-api:Value ;
|
|
93
|
+
sh:property [
|
|
94
|
+
a sh:PropertyShape ;
|
|
95
|
+
sh:path knora-api:valueHasComment ;
|
|
96
|
+
sh:datatype xsd:string ;
|
|
97
|
+
sh:pattern "\\s*\\S+\\s*" ;
|
|
98
|
+
sh:minCount 0 ;
|
|
99
|
+
sh:maxCount 1 ;
|
|
100
|
+
sh:severity sh:Violation ;
|
|
101
|
+
sh:message "The comment on the value must be a non-empty string"
|
|
102
|
+
] .
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
api-shapes:BooleanValue_ClassShape
|
|
106
|
+
a sh:NodeShape ;
|
|
107
|
+
sh:name "Validates the properties used with this targetClass" ;
|
|
108
|
+
sh:targetClass knora-api:BooleanValue ;
|
|
109
|
+
sh:property [
|
|
110
|
+
a sh:PropertyShape ;
|
|
111
|
+
sh:path knora-api:booleanValueAsBoolean ;
|
|
112
|
+
sh:datatype xsd:boolean ;
|
|
113
|
+
sh:minCount 1 ;
|
|
114
|
+
sh:maxCount 1 ;
|
|
115
|
+
sh:severity sh:Violation ;
|
|
116
|
+
sh:message "A BooleanValue requires exactly one valid boolean"
|
|
117
|
+
] .
|
|
118
|
+
|
|
119
|
+
api-shapes:ColorValue_ClassShape
|
|
120
|
+
a sh:NodeShape ;
|
|
121
|
+
sh:name "Validates the properties used with this targetClass" ;
|
|
122
|
+
sh:targetClass knora-api:ColorValue ;
|
|
123
|
+
sh:property [
|
|
124
|
+
a sh:PropertyShape ;
|
|
125
|
+
sh:path knora-api:colorValueAsColor ;
|
|
126
|
+
sh:datatype xsd:string ;
|
|
127
|
+
sh:pattern "^#([0-9a-fA-F]{3}){1,2}$" ;
|
|
128
|
+
sh:minCount 1 ;
|
|
129
|
+
sh:maxCount 1 ;
|
|
130
|
+
sh:severity sh:Violation ;
|
|
131
|
+
sh:message "A ColorValue requires exactly one valid color"
|
|
132
|
+
] .
|
|
133
|
+
|
|
134
|
+
api-shapes:DateValue_ClassShape
|
|
135
|
+
a sh:NodeShape ;
|
|
136
|
+
sh:name "Validates the properties used with this targetClass" ;
|
|
137
|
+
sh:targetClass knora-api:DateValue ;
|
|
138
|
+
sh:property [
|
|
139
|
+
a sh:PropertyShape ;
|
|
140
|
+
sh:path knora-api:valueAsString ;
|
|
141
|
+
sh:datatype xsd:string ;
|
|
142
|
+
sh:pattern "\\s*\\S+\\s*" ;
|
|
143
|
+
sh:minCount 1 ;
|
|
144
|
+
sh:maxCount 1 ;
|
|
145
|
+
sh:severity sh:Violation ;
|
|
146
|
+
sh:message "A DateValue requires a valid Date"
|
|
147
|
+
] ,
|
|
148
|
+
[
|
|
149
|
+
a sh:PropertyShape ;
|
|
150
|
+
sh:path api-shapes:dateHasStart ;
|
|
151
|
+
sh:or (
|
|
152
|
+
[ sh:datatype xsd:gYear ]
|
|
153
|
+
[ sh:datatype xsd:gYearMonth ]
|
|
154
|
+
[ sh:datatype xsd:date ]
|
|
155
|
+
) ;
|
|
156
|
+
sh:severity sh:Violation ;
|
|
157
|
+
sh:message "The entered date cannot be parsed into a valid date. It may have issues with the month and/or day number."
|
|
158
|
+
] ,
|
|
159
|
+
[
|
|
160
|
+
a sh:PropertyShape ;
|
|
161
|
+
sh:path api-shapes:dateHasEnd ;
|
|
162
|
+
sh:or (
|
|
163
|
+
[ sh:datatype xsd:gYear ]
|
|
164
|
+
[ sh:datatype xsd:gYearMonth ]
|
|
165
|
+
[ sh:datatype xsd:date ]
|
|
166
|
+
) ;
|
|
167
|
+
sh:severity sh:Violation ;
|
|
168
|
+
sh:message "The entered date cannot be parsed into a valid date. It may have issues with the month and/or day number."
|
|
169
|
+
] ,
|
|
170
|
+
[
|
|
171
|
+
a sh:PropertyShape ;
|
|
172
|
+
sh:path api-shapes:dateHasStart ;
|
|
173
|
+
sh:lessThanOrEquals api-shapes:dateHasEnd ;
|
|
174
|
+
sh:severity sh:Violation ;
|
|
175
|
+
sh:message "The end date must be equal or later than the start date."
|
|
176
|
+
] ,
|
|
177
|
+
[
|
|
178
|
+
a sh:PropertyShape ;
|
|
179
|
+
sh:path api-shapes:dateHasStart ;
|
|
180
|
+
dash:coExistsWith api-shapes:dateHasEnd ;
|
|
181
|
+
sh:severity sh:Violation ;
|
|
182
|
+
sh:message "The start date may not be later than the end date. Please take a look if your eras are correct."
|
|
183
|
+
] .
|
|
184
|
+
|
|
185
|
+
api-shapes:DecimalValue_ClassShape
|
|
186
|
+
a sh:NodeShape ;
|
|
187
|
+
sh:name "Validates the properties used with this targetClass" ;
|
|
188
|
+
sh:targetClass knora-api:DecimalValue ;
|
|
189
|
+
sh:property [
|
|
190
|
+
a sh:PropertyShape ;
|
|
191
|
+
sh:path knora-api:decimalValueAsDecimal ;
|
|
192
|
+
sh:datatype xsd:decimal ;
|
|
193
|
+
sh:minCount 1 ;
|
|
194
|
+
sh:maxCount 1 ;
|
|
195
|
+
sh:severity sh:Violation ;
|
|
196
|
+
sh:message "A DecimalValue requires exactly one valid decimal"
|
|
197
|
+
] .
|
|
198
|
+
|
|
199
|
+
api-shapes:GeonameValue_ClassShape
|
|
200
|
+
a sh:NodeShape ;
|
|
201
|
+
sh:name "Validates the properties used with this targetClass" ;
|
|
202
|
+
sh:targetClass knora-api:GeonameValue ;
|
|
203
|
+
sh:property [
|
|
204
|
+
a sh:PropertyShape ;
|
|
205
|
+
sh:path knora-api:geonameValueAsGeonameCode ;
|
|
206
|
+
sh:datatype xsd:string ;
|
|
207
|
+
sh:pattern "^\\d+$" ;
|
|
208
|
+
sh:minCount 1 ;
|
|
209
|
+
sh:maxCount 1 ;
|
|
210
|
+
sh:severity sh:Violation ;
|
|
211
|
+
sh:message "The value must be a valid geoname code"
|
|
212
|
+
] .
|
|
213
|
+
|
|
214
|
+
api-shapes:GeomValue_ClassShape
|
|
215
|
+
a sh:NodeShape ;
|
|
216
|
+
sh:name "Validates the properties used with this targetClass" ;
|
|
217
|
+
sh:targetClass knora-api:GeomValue ;
|
|
218
|
+
sh:property [
|
|
219
|
+
a sh:PropertyShape ;
|
|
220
|
+
sh:path knora-api:geometryValueAsGeometry ;
|
|
221
|
+
sh:datatype xsd:string ;
|
|
222
|
+
sh:pattern "\\s*\\S+\\s*" ;
|
|
223
|
+
sh:minCount 1 ;
|
|
224
|
+
sh:maxCount 1 ;
|
|
225
|
+
sh:severity sh:Violation ;
|
|
226
|
+
sh:message "The value must be a valid geometry JSON object"
|
|
227
|
+
] .
|
|
228
|
+
|
|
229
|
+
api-shapes:IntervalValue_ClassShape
|
|
230
|
+
a sh:NodeShape ;
|
|
231
|
+
sh:name "Validates the properties used with this targetClass" ;
|
|
232
|
+
sh:targetClass knora-api:IntervalValue ;
|
|
233
|
+
sh:property [
|
|
234
|
+
a sh:PropertyShape ;
|
|
235
|
+
sh:path knora-api:intervalValueHasStart ;
|
|
236
|
+
sh:datatype xsd:decimal ;
|
|
237
|
+
sh:minInclusive 0 ;
|
|
238
|
+
sh:minCount 1 ;
|
|
239
|
+
sh:maxCount 1 ;
|
|
240
|
+
sh:severity sh:Violation ;
|
|
241
|
+
sh:message "The interval start must be a non-negative integer or decimal."
|
|
242
|
+
] ,
|
|
243
|
+
[
|
|
244
|
+
a sh:PropertyShape ;
|
|
245
|
+
sh:path knora-api:intervalValueHasEnd ;
|
|
246
|
+
sh:datatype xsd:decimal ;
|
|
247
|
+
sh:minExclusive 0 ;
|
|
248
|
+
sh:minCount 1 ;
|
|
249
|
+
sh:maxCount 1 ;
|
|
250
|
+
sh:severity sh:Violation ;
|
|
251
|
+
sh:message "The interval end must be an integer or decimal that is larger than 0."
|
|
252
|
+
] ,
|
|
253
|
+
|
|
254
|
+
[
|
|
255
|
+
sh:path knora-api:intervalValueHasStart ;
|
|
256
|
+
sh:lessThan knora-api:intervalValueHasEnd ;
|
|
257
|
+
sh:severity sh:Violation ;
|
|
258
|
+
sh:message "The start of the interval must be smaller than the end."
|
|
259
|
+
] .
|
|
260
|
+
|
|
261
|
+
api-shapes:IntValue_ClassShape
|
|
262
|
+
a sh:NodeShape ;
|
|
263
|
+
sh:name "Validates the properties used with this targetClass" ;
|
|
264
|
+
sh:targetClass knora-api:IntValue ;
|
|
265
|
+
sh:property [
|
|
266
|
+
a sh:PropertyShape ;
|
|
267
|
+
sh:path knora-api:intValueAsInt ;
|
|
268
|
+
sh:minCount 1 ;
|
|
269
|
+
sh:maxCount 1 ;
|
|
270
|
+
sh:severity sh:Violation ;
|
|
271
|
+
sh:message "An IntValue requires exactly one valid integer"
|
|
272
|
+
] ,
|
|
273
|
+
[
|
|
274
|
+
a sh:PropertyShape ;
|
|
275
|
+
sh:path knora-api:intValueAsInt ;
|
|
276
|
+
sh:datatype xsd:int ;
|
|
277
|
+
sh:severity sh:Violation ;
|
|
278
|
+
sh:message "The integer must be within the range of -2'147'483'648 and 2'147'483'647."
|
|
279
|
+
] .
|
|
280
|
+
|
|
281
|
+
##############
|
|
282
|
+
# LinkValue
|
|
283
|
+
# The target of the LinkValue is ontology specific.
|
|
284
|
+
# The Shape is constructed through the SPARQL queries
|
|
285
|
+
|
|
286
|
+
##############
|
|
287
|
+
# ListValue
|
|
288
|
+
# The target of the ListValue is ontology specific.
|
|
289
|
+
# The Shape is constructed through the SPARQL queries
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
api-shapes:SimpleTextValue_ClassShape
|
|
293
|
+
a sh:NodeShape ;
|
|
294
|
+
sh:name "Ensures that the properties for a simple text value are used" ;
|
|
295
|
+
sh:property [
|
|
296
|
+
# Because it is not a separate class we have to check the cardinality of the property
|
|
297
|
+
a sh:PropertyShape ;
|
|
298
|
+
sh:path knora-api:valueAsString ;
|
|
299
|
+
sh:datatype xsd:string ;
|
|
300
|
+
sh:minCount 1 ;
|
|
301
|
+
sh:maxCount 1 ;
|
|
302
|
+
sh:severity sh:Violation ;
|
|
303
|
+
sh:message "TextValue without formatting"
|
|
304
|
+
] ,
|
|
305
|
+
[
|
|
306
|
+
a sh:PropertyShape ;
|
|
307
|
+
sh:path knora-api:valueAsString ;
|
|
308
|
+
sh:datatype xsd:string ;
|
|
309
|
+
sh:pattern "\\s*\\S+\\s*" ;
|
|
310
|
+
dash:singleLine true ;
|
|
311
|
+
sh:severity sh:Violation ;
|
|
312
|
+
sh:message "The value must be a non-empty string without newlines."
|
|
313
|
+
] .
|
|
314
|
+
|
|
315
|
+
api-shapes:TextareaTextValue_ClassShape
|
|
316
|
+
a sh:NodeShape ;
|
|
317
|
+
sh:name "Ensures that the properties for a simple text value are used" ;
|
|
318
|
+
sh:property [
|
|
319
|
+
# Because it is not a separate class we have to check the cardinality of the property
|
|
320
|
+
a sh:PropertyShape ;
|
|
321
|
+
sh:path knora-api:valueAsString ;
|
|
322
|
+
sh:datatype xsd:string ;
|
|
323
|
+
sh:minCount 1 ;
|
|
324
|
+
sh:maxCount 1 ;
|
|
325
|
+
sh:severity sh:Violation ;
|
|
326
|
+
sh:message "TextValue without formatting"
|
|
327
|
+
] ,
|
|
328
|
+
[
|
|
329
|
+
a sh:PropertyShape ;
|
|
330
|
+
sh:path knora-api:valueAsString ;
|
|
331
|
+
sh:datatype xsd:string ;
|
|
332
|
+
sh:pattern "\\s*\\S+\\s*" ;
|
|
333
|
+
sh:severity sh:Violation ;
|
|
334
|
+
sh:message "The value must be a non-empty string"
|
|
335
|
+
] .
|
|
336
|
+
|
|
337
|
+
api-shapes:FormattedTextValue_ClassShape
|
|
338
|
+
a sh:NodeShape ;
|
|
339
|
+
sh:name "Ensures that the properties for a formatted text value are used" ;
|
|
340
|
+
sh:property [
|
|
341
|
+
# Because it is not a separate class we have to check the cardinality of the property
|
|
342
|
+
a sh:PropertyShape ;
|
|
343
|
+
sh:path knora-api:textValueAsXml ;
|
|
344
|
+
sh:datatype xsd:string ;
|
|
345
|
+
sh:minCount 1 ;
|
|
346
|
+
sh:maxCount 1 ;
|
|
347
|
+
sh:severity sh:Violation ;
|
|
348
|
+
sh:message "TextValue with formatting"
|
|
349
|
+
] ,
|
|
350
|
+
[
|
|
351
|
+
a sh:PropertyShape ;
|
|
352
|
+
sh:path knora-api:textValueAsXml ;
|
|
353
|
+
sh:datatype xsd:string ;
|
|
354
|
+
sh:pattern "\\s*\\S+\\s*" ;
|
|
355
|
+
sh:severity sh:Violation ;
|
|
356
|
+
sh:message "The value must be a non-empty string"
|
|
357
|
+
] .
|
|
358
|
+
|
|
359
|
+
api-shapes:TimeValue_ClassShape
|
|
360
|
+
a sh:NodeShape ;
|
|
361
|
+
sh:name "Validates the properties used with this targetClass" ;
|
|
362
|
+
sh:targetClass knora-api:TimeValue ;
|
|
363
|
+
sh:property [
|
|
364
|
+
a sh:PropertyShape ;
|
|
365
|
+
sh:path knora-api:timeValueAsTimeStamp ;
|
|
366
|
+
sh:datatype xsd:dateTimeStamp ;
|
|
367
|
+
sh:minCount 1 ;
|
|
368
|
+
sh:maxCount 1 ;
|
|
369
|
+
sh:severity sh:Violation ;
|
|
370
|
+
sh:message "A TimeValue requires exactly one valid xsd:dateTimeStamp"
|
|
371
|
+
] .
|
|
372
|
+
|
|
373
|
+
api-shapes:UriValue_ClassShape
|
|
374
|
+
a sh:NodeShape ;
|
|
375
|
+
sh:name "Validates the properties used with this targetClass" ;
|
|
376
|
+
sh:targetClass knora-api:UriValue ;
|
|
377
|
+
sh:property [
|
|
378
|
+
a sh:PropertyShape ;
|
|
379
|
+
sh:path knora-api:uriValueAsUri ;
|
|
380
|
+
sh:datatype xsd:anyURI ;
|
|
381
|
+
sh:minCount 1 ;
|
|
382
|
+
sh:maxCount 1 ;
|
|
383
|
+
sh:severity sh:Violation ;
|
|
384
|
+
sh:message "A UriValue requires exactly one valid xsd:anyURI"
|
|
385
|
+
] .
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
#########################################
|
|
389
|
+
# FILEVALUE
|
|
390
|
+
#########################################
|
|
391
|
+
|
|
392
|
+
api-shapes:FileValue_ClassShape
|
|
393
|
+
a sh:NodeShape ;
|
|
394
|
+
sh:targetClass knora-api:FileValue ;
|
|
395
|
+
sh:property [
|
|
396
|
+
a sh:PropertyShape ;
|
|
397
|
+
sh:path knora-api:hasPermissions ;
|
|
398
|
+
sh:minCount 0 ;
|
|
399
|
+
sh:maxCount 1 ;
|
|
400
|
+
sh:severity sh:Violation ;
|
|
401
|
+
sh:message "A FileValue may have at most one permission."
|
|
402
|
+
] ,
|
|
403
|
+
[
|
|
404
|
+
a sh:PropertyShape ;
|
|
405
|
+
sh:path knora-api:hasLicense ;
|
|
406
|
+
sh:minCount 1 ;
|
|
407
|
+
sh:maxCount 1 ;
|
|
408
|
+
sh:severity sh:Warning ;
|
|
409
|
+
sh:message "Files and IIIF-URIs require a reference to a license."
|
|
410
|
+
] ,
|
|
411
|
+
[
|
|
412
|
+
a sh:PropertyShape ;
|
|
413
|
+
sh:path knora-api:hasAuthorship ;
|
|
414
|
+
sh:datatype xsd:string ;
|
|
415
|
+
sh:minCount 1 ;
|
|
416
|
+
sh:severity sh:Warning ;
|
|
417
|
+
sh:message "Files and IIIF-URIs require at least one authorship."
|
|
418
|
+
] ,
|
|
419
|
+
[
|
|
420
|
+
a sh:PropertyShape ;
|
|
421
|
+
sh:path knora-api:hasAuthorship ;
|
|
422
|
+
sh:datatype xsd:string ;
|
|
423
|
+
sh:pattern "\\s*\\S+\\s*" ;
|
|
424
|
+
dash:singleLine true ;
|
|
425
|
+
sh:severity sh:Violation ;
|
|
426
|
+
sh:message "The authorship must be a non-empty string without newlines."
|
|
427
|
+
] ,
|
|
428
|
+
[
|
|
429
|
+
a sh:PropertyShape ;
|
|
430
|
+
sh:path knora-api:hasCopyrightHolder ;
|
|
431
|
+
sh:datatype xsd:string ;
|
|
432
|
+
sh:minCount 1 ;
|
|
433
|
+
sh:maxCount 1 ;
|
|
434
|
+
sh:severity sh:Warning ;
|
|
435
|
+
sh:message "Files and IIIF-URIs require a copyright holder."
|
|
436
|
+
] ,
|
|
437
|
+
[
|
|
438
|
+
a sh:PropertyShape ;
|
|
439
|
+
sh:path knora-api:hasCopyrightHolder ;
|
|
440
|
+
sh:datatype xsd:string ;
|
|
441
|
+
sh:pattern "\\s*\\S+\\s*" ;
|
|
442
|
+
dash:singleLine true ;
|
|
443
|
+
sh:severity sh:Violation ;
|
|
444
|
+
sh:message "The copyright holder must be a non-empty string without newlines."
|
|
445
|
+
] .
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
api-shapes:ArchiveFileValue_ClassShape
|
|
449
|
+
a sh:NodeShape ;
|
|
450
|
+
sh:name "Validates the class type" ;
|
|
451
|
+
sh:targetClass knora-api:ArchiveFileValue ;
|
|
452
|
+
sh:property [
|
|
453
|
+
a sh:PropertyShape ;
|
|
454
|
+
sh:path knora-api:fileValueHasFilename ;
|
|
455
|
+
sh:datatype xsd:string ;
|
|
456
|
+
sh:pattern ".+\\.(zip|tar|gz|z|tgz|gzip|7z)$" ;
|
|
457
|
+
sh:flags "i" ; # case insensitive
|
|
458
|
+
sh:minCount 1 ;
|
|
459
|
+
sh:maxCount 1 ;
|
|
460
|
+
sh:severity sh:Violation ;
|
|
461
|
+
sh:message """
|
|
462
|
+
An ArchiveRepresentation requires a file with one of the following extensions
|
|
463
|
+
'zip', 'tar', 'gz', 'z', 'tgz', 'gzip', '7z'.
|
|
464
|
+
"""
|
|
465
|
+
] .
|
|
466
|
+
|
|
467
|
+
api-shapes:AudioFileValue_ClassShape
|
|
468
|
+
a sh:NodeShape ;
|
|
469
|
+
sh:name "Validates the class type" ;
|
|
470
|
+
sh:targetClass knora-api:AudioFileValue ;
|
|
471
|
+
sh:property [
|
|
472
|
+
a sh:PropertyShape ;
|
|
473
|
+
sh:path knora-api:fileValueHasFilename ;
|
|
474
|
+
sh:datatype xsd:string ;
|
|
475
|
+
sh:pattern ".+\\.(mp3|wav)$" ;
|
|
476
|
+
sh:flags "i" ; # case insensitive
|
|
477
|
+
sh:minCount 1 ;
|
|
478
|
+
sh:maxCount 1 ;
|
|
479
|
+
sh:severity sh:Violation ;
|
|
480
|
+
sh:message "An AudioRepresentation requires a file with one of the following extensions 'mp3', 'wav'."
|
|
481
|
+
] .
|
|
482
|
+
|
|
483
|
+
api-shapes:DocumentFileValue_ClassShape
|
|
484
|
+
a sh:NodeShape ;
|
|
485
|
+
sh:name "Validates the class type" ;
|
|
486
|
+
sh:targetClass knora-api:DocumentFileValue ;
|
|
487
|
+
sh:property [
|
|
488
|
+
a sh:PropertyShape ;
|
|
489
|
+
sh:path knora-api:fileValueHasFilename ;
|
|
490
|
+
sh:datatype xsd:string ;
|
|
491
|
+
sh:pattern ".+\\.(pdf|doc|docx|xls|xlsx|ppt|pptx|epub)$" ;
|
|
492
|
+
sh:flags "i" ; # case insensitive
|
|
493
|
+
sh:minCount 1 ;
|
|
494
|
+
sh:maxCount 1 ;
|
|
495
|
+
sh:severity sh:Violation ;
|
|
496
|
+
sh:message """
|
|
497
|
+
A DocumentRepresentation requires a file with one of the following extensions
|
|
498
|
+
'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'epub'.
|
|
499
|
+
"""
|
|
500
|
+
] .
|
|
501
|
+
|
|
502
|
+
api-shapes:MovingImageFileValue_ClassShape
|
|
503
|
+
a sh:NodeShape ;
|
|
504
|
+
sh:name "Validates the class type" ;
|
|
505
|
+
sh:targetClass knora-api:MovingImageFileValue ;
|
|
506
|
+
sh:property [
|
|
507
|
+
a sh:PropertyShape ;
|
|
508
|
+
sh:path knora-api:fileValueHasFilename ;
|
|
509
|
+
sh:datatype xsd:string ;
|
|
510
|
+
sh:pattern ".+\\.mp4$" ;
|
|
511
|
+
sh:flags "i" ; # case insensitive
|
|
512
|
+
sh:minCount 1 ;
|
|
513
|
+
sh:maxCount 1 ;
|
|
514
|
+
sh:severity sh:Violation ;
|
|
515
|
+
sh:message "A MovingImageRepresentation requires a file with the extension 'mp4'."
|
|
516
|
+
] .
|
|
517
|
+
|
|
518
|
+
api-shapes:StillImageFileValue_ClassShape
|
|
519
|
+
a sh:NodeShape ;
|
|
520
|
+
sh:name "Validates the class type" ;
|
|
521
|
+
sh:targetClass knora-api:StillImageFileValue ;
|
|
522
|
+
sh:property [
|
|
523
|
+
a sh:PropertyShape ;
|
|
524
|
+
sh:path knora-api:fileValueHasFilename ;
|
|
525
|
+
sh:datatype xsd:string ;
|
|
526
|
+
sh:pattern ".+\\.(jpg|jpeg|png|tif|tiff|jp2|jpx)$" ; # jpx is the extension of the files returned by dsp-ingest
|
|
527
|
+
sh:flags "i" ; # case insensitive
|
|
528
|
+
sh:minCount 1 ;
|
|
529
|
+
sh:maxCount 1 ;
|
|
530
|
+
sh:severity sh:Violation ;
|
|
531
|
+
sh:message """
|
|
532
|
+
A StillImageFileValue requires a file with one of the extensions:
|
|
533
|
+
'jpg', 'jpeg', 'png', 'tif', 'tiff', 'jp2'.
|
|
534
|
+
"""
|
|
535
|
+
] .
|
|
536
|
+
|
|
537
|
+
api-shapes:StillImageExternalFileValue_ClassShape
|
|
538
|
+
a sh:NodeShape ;
|
|
539
|
+
sh:name "Validates the class type" ;
|
|
540
|
+
sh:targetClass knora-api:StillImageExternalFileValue ;
|
|
541
|
+
sh:property [
|
|
542
|
+
a sh:PropertyShape ;
|
|
543
|
+
sh:path knora-api:stillImageFileValueHasExternalUrl ;
|
|
544
|
+
sh:minCount 1 ;
|
|
545
|
+
sh:maxCount 1 ;
|
|
546
|
+
sh:severity sh:Violation ;
|
|
547
|
+
sh:message "StillImageExternalFileValue requires an external IIIF-URI"
|
|
548
|
+
] ,
|
|
549
|
+
[
|
|
550
|
+
a sh:PropertyShape ;
|
|
551
|
+
sh:path knora-api:stillImageFileValueHasExternalUrl ;
|
|
552
|
+
sh:datatype xsd:anyURI ;
|
|
553
|
+
sh:severity sh:Violation ;
|
|
554
|
+
sh:message "Your IIIF-URI contains characters that are not allowed in a URI."
|
|
555
|
+
] .
|
|
556
|
+
|
|
557
|
+
api-shapes:TextFileValue_ClassShape
|
|
558
|
+
a sh:NodeShape ;
|
|
559
|
+
sh:name "Validates the class type" ;
|
|
560
|
+
sh:targetClass knora-api:TextFileValue ;
|
|
561
|
+
sh:property [
|
|
562
|
+
a sh:PropertyShape ;
|
|
563
|
+
sh:path knora-api:fileValueHasFilename ;
|
|
564
|
+
sh:datatype xsd:string ;
|
|
565
|
+
sh:pattern ".+\\.(odd|rng|txt|xml|htm|html|xsd|xsl|csv|json)$" ;
|
|
566
|
+
sh:flags "i" ; # case insensitive
|
|
567
|
+
sh:minCount 1 ;
|
|
568
|
+
sh:maxCount 1 ;
|
|
569
|
+
sh:severity sh:Violation ;
|
|
570
|
+
sh:message """
|
|
571
|
+
A TextRepresentation requires a file with one of the following extensions
|
|
572
|
+
'odd', 'rng', 'txt', 'xml', 'htm', 'html', 'xsd', 'xsl', 'csv', 'json'.
|
|
573
|
+
"""
|
|
574
|
+
] .
|
|
575
|
+
|
|
576
|
+
|
|
577
|
+
#########################################
|
|
578
|
+
# KNORA-API IN-BUILT PROPERTIES
|
|
579
|
+
#########################################
|
|
580
|
+
|
|
581
|
+
# The following shapes are for properties that are used by several resources.
|
|
582
|
+
# Property shapes only used with one specific resource are defined with the shape for the resource.
|
|
583
|
+
|
|
584
|
+
api-shapes:hasComment_PropertyShape
|
|
585
|
+
a sh:PropertyShape ;
|
|
586
|
+
sh:path knora-api:hasComment ;
|
|
587
|
+
sh:node api-shapes:FormattedTextValue_ClassShape .
|
|
588
|
+
|
|
589
|
+
# dash:coExistsWith ensures that isPartOf also needs seqnum. There is no need for a second shape.
|
|
590
|
+
api-shapes:seqnum_PropShape
|
|
591
|
+
a sh:PropertyShape ;
|
|
592
|
+
sh:path knora-api:seqnum ;
|
|
593
|
+
dash:coExistsWith knora-api:isPartOf ;
|
|
594
|
+
sh:severity sh:Violation ;
|
|
595
|
+
sh:message """
|
|
596
|
+
The property seqnum and isPartOf (or sub-properties of them) must be used together.
|
|
597
|
+
This resource only used one of the properties.
|
|
598
|
+
""" .
|
|
599
|
+
|
|
600
|
+
|
|
601
|
+
#########################################
|
|
602
|
+
# DSP BUILT IN RESOURCES
|
|
603
|
+
#########################################
|
|
604
|
+
|
|
605
|
+
###########################
|
|
606
|
+
# LinkObj
|
|
607
|
+
|
|
608
|
+
api-shapes:LinkObj_ResourceShape
|
|
609
|
+
a sh:NodeShape ;
|
|
610
|
+
sh:name "Validates the LinkObj resource" ;
|
|
611
|
+
sh:targetClass knora-api:LinkObj ;
|
|
612
|
+
sh:property [
|
|
613
|
+
a sh:PropertyShape ;
|
|
614
|
+
sh:path knora-api:hasLinkTo ;
|
|
615
|
+
sh:class knora-api:LinkValue ;
|
|
616
|
+
sh:severity sh:Violation ;
|
|
617
|
+
sh:message "This property requires a LinkValue"
|
|
618
|
+
] ,
|
|
619
|
+
[
|
|
620
|
+
a sh:PropertyShape ;
|
|
621
|
+
sh:path knora-api:hasLinkTo ;
|
|
622
|
+
sh:node api-shapes:hasLinkTo_NodeShape
|
|
623
|
+
] ,
|
|
624
|
+
api-shapes:hasComment_PropertyShape .
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
api-shapes:hasLinkTo_NodeShape
|
|
628
|
+
a sh:NodeShape ;
|
|
629
|
+
sh:name "This ensures that the target of the property is of type Resource, i.e. exists in the graph." ;
|
|
630
|
+
sh:property [
|
|
631
|
+
a sh:PropertyShape ;
|
|
632
|
+
sh:path api-shapes:linkValueHasTargetID ;
|
|
633
|
+
sh:class knora-api:Resource ;
|
|
634
|
+
sh:severity sh:Violation ;
|
|
635
|
+
sh:message "Range is knora-api:Resource or a subclass."
|
|
636
|
+
] .
|
|
637
|
+
|
|
638
|
+
|
|
639
|
+
###########################
|
|
640
|
+
# Region
|
|
641
|
+
|
|
642
|
+
api-shapes:Region_ResourceShape
|
|
643
|
+
a sh:NodeShape ;
|
|
644
|
+
sh:name "Validates the Region resource" ;
|
|
645
|
+
sh:targetClass knora-api:Region ;
|
|
646
|
+
sh:property [
|
|
647
|
+
a sh:PropertyShape ;
|
|
648
|
+
sh:path knora-api:isRegionOf ;
|
|
649
|
+
sh:class knora-api:LinkValue ;
|
|
650
|
+
sh:severity sh:Violation ;
|
|
651
|
+
sh:message "This property requires a LinkValue"
|
|
652
|
+
] ,
|
|
653
|
+
[
|
|
654
|
+
a sh:PropertyShape ;
|
|
655
|
+
sh:path knora-api:isRegionOf ;
|
|
656
|
+
sh:node api-shapes:isRegionOf_NodeShape
|
|
657
|
+
] ,
|
|
658
|
+
[
|
|
659
|
+
a sh:PropertyShape ;
|
|
660
|
+
sh:path knora-api:hasColor ;
|
|
661
|
+
sh:class knora-api:ColorValue ;
|
|
662
|
+
sh:message "This property requires a ColorValue"
|
|
663
|
+
] ,
|
|
664
|
+
[
|
|
665
|
+
a sh:PropertyShape ;
|
|
666
|
+
sh:path knora-api:hasGeometry ;
|
|
667
|
+
sh:class knora-api:GeomValue ;
|
|
668
|
+
sh:message "This property requires a GeomValue"
|
|
669
|
+
] ,
|
|
670
|
+
api-shapes:hasComment_PropertyShape .
|
|
671
|
+
|
|
672
|
+
api-shapes:isRegionOf_NodeShape
|
|
673
|
+
a sh:NodeShape ;
|
|
674
|
+
sh:name "This ensures that the target of the property is of type Representation and exists in the graph." ;
|
|
675
|
+
sh:property [
|
|
676
|
+
a sh:PropertyShape ;
|
|
677
|
+
sh:path api-shapes:linkValueHasTargetID ;
|
|
678
|
+
sh:class knora-api:Representation ;
|
|
679
|
+
sh:severity sh:Violation ;
|
|
680
|
+
sh:message "http://api.knora.org/ontology/knora-api/v2#Representation"
|
|
681
|
+
] .
|
|
682
|
+
|
|
683
|
+
|
|
684
|
+
###########################
|
|
685
|
+
# Segment
|
|
686
|
+
|
|
687
|
+
# These shapes validate the generic properties of the Audio and Video Segment
|
|
688
|
+
# and need not be repeated for each segment type.
|
|
689
|
+
|
|
690
|
+
api-shapes:Segment_ResourceShape
|
|
691
|
+
a sh:NodeShape ;
|
|
692
|
+
sh:name "Validates the Region resource" ;
|
|
693
|
+
sh:targetClass knora-api:Segment ;
|
|
694
|
+
sh:property [
|
|
695
|
+
a sh:PropertyShape ;
|
|
696
|
+
sh:path knora-api:hasSegmentBounds ;
|
|
697
|
+
sh:class knora-api:IntervalValue ;
|
|
698
|
+
sh:severity sh:Violation ;
|
|
699
|
+
sh:message "This property requires an IntervalValue"
|
|
700
|
+
] ,
|
|
701
|
+
[
|
|
702
|
+
a sh:PropertyShape ;
|
|
703
|
+
sh:path knora-api:hasDescription ;
|
|
704
|
+
sh:node api-shapes:FormattedTextValue_ClassShape
|
|
705
|
+
] ,
|
|
706
|
+
[
|
|
707
|
+
a sh:PropertyShape ;
|
|
708
|
+
sh:path knora-api:hasTitle ;
|
|
709
|
+
sh:node api-shapes:SimpleTextValue_ClassShape
|
|
710
|
+
] ,
|
|
711
|
+
[
|
|
712
|
+
a sh:PropertyShape ;
|
|
713
|
+
sh:path knora-api:hasKeyword ;
|
|
714
|
+
sh:node api-shapes:SimpleTextValue_ClassShape
|
|
715
|
+
] ,
|
|
716
|
+
[
|
|
717
|
+
a sh:PropertyShape ;
|
|
718
|
+
sh:path knora-api:relatesTo ;
|
|
719
|
+
sh:class knora-api:LinkValue ;
|
|
720
|
+
sh:node api-shapes:relatesTo_NodeShape ;
|
|
721
|
+
sh:severity sh:Violation ;
|
|
722
|
+
sh:message "This property requires an LinkValue"
|
|
723
|
+
] ,
|
|
724
|
+
[
|
|
725
|
+
a sh:PropertyShape ;
|
|
726
|
+
sh:path knora-api:relatesTo ;
|
|
727
|
+
sh:node api-shapes:relatesTo_NodeShape
|
|
728
|
+
] ,
|
|
729
|
+
api-shapes:hasComment_PropertyShape .
|
|
730
|
+
|
|
731
|
+
api-shapes:relatesTo_NodeShape
|
|
732
|
+
a sh:NodeShape ;
|
|
733
|
+
sh:name "This ensures that the target of the property is of type Resource, i.e. exists in the graph." ;
|
|
734
|
+
sh:property [
|
|
735
|
+
a sh:PropertyShape ;
|
|
736
|
+
sh:path api-shapes:linkValueHasTargetID ;
|
|
737
|
+
sh:class knora-api:Resource ;
|
|
738
|
+
sh:severity sh:Violation ;
|
|
739
|
+
sh:message "Range is knora-api:Resource or a subclass."
|
|
740
|
+
] .
|
|
741
|
+
|
|
742
|
+
|
|
743
|
+
###########################
|
|
744
|
+
# AudioSegment
|
|
745
|
+
|
|
746
|
+
api-shapes:AudioSegment_ResourceShape
|
|
747
|
+
a sh:NodeShape ;
|
|
748
|
+
sh:name "Validates the AudioSegment resource" ;
|
|
749
|
+
sh:targetClass knora-api:AudioSegment ;
|
|
750
|
+
sh:property [
|
|
751
|
+
a sh:PropertyShape ;
|
|
752
|
+
sh:path knora-api:isAudioSegmentOf ;
|
|
753
|
+
sh:class knora-api:LinkValue ;
|
|
754
|
+
sh:severity sh:Violation ;
|
|
755
|
+
sh:message "This property requires a LinkValue"
|
|
756
|
+
] ,
|
|
757
|
+
[
|
|
758
|
+
a sh:PropertyShape ;
|
|
759
|
+
sh:path knora-api:isAudioSegmentOf ;
|
|
760
|
+
sh:node api-shapes:isAudioSegmentOf_NodeShape
|
|
761
|
+
] .
|
|
762
|
+
|
|
763
|
+
api-shapes:isAudioSegmentOf_NodeShape
|
|
764
|
+
a sh:NodeShape ;
|
|
765
|
+
sh:name "This ensures that the target of the property is of type AudioRepresentation and exists in the graph." ;
|
|
766
|
+
sh:property [
|
|
767
|
+
a sh:PropertyShape ;
|
|
768
|
+
sh:path api-shapes:linkValueHasTargetID ;
|
|
769
|
+
sh:class knora-api:AudioRepresentation ;
|
|
770
|
+
sh:severity sh:Violation ;
|
|
771
|
+
sh:message "http://api.knora.org/ontology/knora-api/v2#AudioRepresentation"
|
|
772
|
+
] .
|
|
773
|
+
|
|
774
|
+
|
|
775
|
+
###########################
|
|
776
|
+
# VideoSegment
|
|
777
|
+
|
|
778
|
+
api-shapes:VideoSegment_ResourceShape
|
|
779
|
+
a sh:NodeShape ;
|
|
780
|
+
sh:name "Validates the VideoSegment resource" ;
|
|
781
|
+
sh:targetClass knora-api:VideoSegment ;
|
|
782
|
+
sh:property [
|
|
783
|
+
a sh:PropertyShape ;
|
|
784
|
+
sh:path knora-api:isVideoSegmentOf ;
|
|
785
|
+
sh:class knora-api:LinkValue ;
|
|
786
|
+
sh:severity sh:Violation ;
|
|
787
|
+
sh:message "This property requires a LinkValue"
|
|
788
|
+
] ,
|
|
789
|
+
[
|
|
790
|
+
a sh:PropertyShape ;
|
|
791
|
+
sh:path knora-api:isVideoSegmentOf ;
|
|
792
|
+
sh:node api-shapes:isVideoSegmentOf_NodeShape
|
|
793
|
+
] .
|
|
794
|
+
|
|
795
|
+
api-shapes:isVideoSegmentOf_NodeShape
|
|
796
|
+
a sh:NodeShape ;
|
|
797
|
+
sh:name "This ensures that the target of the property is of type MovingImageRepresentation and exists in the graph." ;
|
|
798
|
+
sh:property [
|
|
799
|
+
a sh:PropertyShape ;
|
|
800
|
+
sh:path api-shapes:linkValueHasTargetID ;
|
|
801
|
+
sh:class knora-api:MovingImageRepresentation ;
|
|
802
|
+
sh:severity sh:Violation ;
|
|
803
|
+
sh:message "http://api.knora.org/ontology/knora-api/v2#MovingImageRepresentation"
|
|
804
|
+
] .
|