diff --git a/CHANGELOG.md b/CHANGELOG.md index 69a9d0a..9defee2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,20 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](https://semver.org/) +## [1.0.0beta4] 2024-07-12 + +### Fixed + +- fixed errors on CMEM instances with self-signed/invalid certificates + +### Added + +- valid OWL profiles can be read on the Reason plugin input instead of validating the ontology in the plugin + +### Changed + +- use DCMI Metadata Terms for provenance +- new icons ## [1.0.0beta3] 2024-07-09 diff --git a/README.md b/README.md index 5aab7d9..15285c3 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,14 @@ parameters to include inferred axiom generators: Validate the input ontology against OWL profiles (DL, EL, QL, RL, and Full). The ontology is annotated in the output graph. +### Process valid OWL profiles from input + +If enabled along with the "Validate OWL2 profiles" parameter, the list of valid profiles is taken from the plugin input, +without validating the ontology against the profiles in the plugin. The inputs need to include the entity paths "profile" +for the valid profiles, and "ontology" for the ontology IRI. If the "Validate OWL2 profiles" parameter is enabled in the +"Validate" plugin, it can be directly connected to the input of the "Reason" plugin. + + ### Maximum RAM Percentage Maximum heap size for the Java virtual machine in the DI container running the reasoning process. @@ -138,7 +146,8 @@ Raise an error if inconsistencies are found. If enabled, the plugin does not out ### Validate OWL2 profiles Validate the input ontology against OWL profiles (DL, EL, QL, RL, and Full). The valid profiles are added to the output -Markdown file and the ontology is annotated in the output graph. The plugin outputs the profiles using the path "profile". +Markdown file and the ontology is annotated in the output graph. The plugin outputs the profiles with path "profile", +and the ontology IRI with path "ontology". ### Maximum RAM Percentage diff --git a/cmem_plugin_reason/file-icons--owl.svg b/cmem_plugin_reason/file-icons--owl.svg new file mode 100644 index 0000000..46edbe0 --- /dev/null +++ b/cmem_plugin_reason/file-icons--owl.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/cmem_plugin_reason/fluent--brain-circuit-24-regular.svg b/cmem_plugin_reason/fluent--brain-circuit-24-regular.svg new file mode 100644 index 0000000..4028190 --- /dev/null +++ b/cmem_plugin_reason/fluent--brain-circuit-24-regular.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/cmem_plugin_reason/plugin_reason.py b/cmem_plugin_reason/plugin_reason.py index a169214..63b482f 100644 --- a/cmem_plugin_reason/plugin_reason.py +++ b/cmem_plugin_reason/plugin_reason.py @@ -1,6 +1,8 @@ """Reasoning workflow plugin module""" +from collections.abc import Sequence from datetime import UTC, datetime +from os import environ from pathlib import Path from tempfile import TemporaryDirectory from time import time @@ -9,6 +11,7 @@ from cmem.cmempy.dp.proxy.graph import get from cmem_plugin_base.dataintegration.context import ExecutionContext from cmem_plugin_base.dataintegration.description import Icon, Plugin, PluginParameter +from cmem_plugin_base.dataintegration.entity import Entities from cmem_plugin_base.dataintegration.parameter.graph import GraphParameterType from cmem_plugin_base.dataintegration.plugins import WorkflowPlugin from cmem_plugin_base.dataintegration.types import BoolParameterType, StringParameterType @@ -26,16 +29,17 @@ get_provenance, post_profiles, post_provenance, - remove_temp, robot, send_result, validate_profiles, ) +environ["SSL_VERIFY"] = "false" + @Plugin( label="Reason", - icon=Icon(file_name="reason.png", package=__package__), + icon=Icon(file_name="fluent--brain-circuit-24-regular.svg", package=__package__), description="Performs OWL reasoning.", documentation="""A task performing OWL reasoning. With an OWL ontology and a data graph as input the reasoning result is written to a specified graph. The following reasoners are supported: @@ -162,6 +166,16 @@ description="", default_value=False, ), + PluginParameter( + param_type=BoolParameterType(), + name="input_profiles", + label="Process valid OWL profiles from input", + description="""If the "validate OWL profiles" parameter is enabled, take values from the + input (paths "profile" and "ontology") instead of running the validation in the plugin. + """, + default_value=False, + advanced=True, + ), ], ) class ReasonPlugin(WorkflowPlugin): @@ -188,6 +202,7 @@ def __init__( # noqa: PLR0913 sub_data_property: bool = False, sub_object_property: bool = False, validate_profile: bool = False, + input_profiles: bool = False, max_ram_percentage: int = MAX_RAM_PERCENTAGE_DEFAULT, ) -> None: self.axioms = { @@ -244,6 +259,7 @@ def __init__( # noqa: PLR0913 self.output_graph_iri = output_graph_iri self.reasoner = reasoner self.validate_profile = validate_profile + self.input_profiles = input_profiles self.max_ram_percentage = max_ram_percentage def get_graphs(self, graphs: dict, context: ExecutionContext) -> None: @@ -282,9 +298,8 @@ def reason(self, graphs: dict) -> None: f"--language-annotation rdfs:comment " f'"Reasoning result set of <{self.data_graph_iri}> and ' f'<{self.ontology_graph_iri}>" en ' - f'--link-annotation prov:wasDerivedFrom "{self.data_graph_iri}" ' - f"--link-annotation prov:wasDerivedFrom " - f'"{self.ontology_graph_iri}" ' + f'--link-annotation dc:source "{self.data_graph_iri}" ' + f'--link-annotation dc:source "{self.ontology_graph_iri}" ' f'--typed-annotation dc:created "{utctime}" xsd:dateTime ' f'--output "{self.temp}/result.ttl"' ) @@ -296,8 +311,32 @@ def reason(self, graphs: dict) -> None: raise OSError(response.stderr.decode()) raise OSError("ROBOT error") - def _execute(self, context: ExecutionContext) -> None: + def post_valid_profiles(self, inputs: Sequence[Entities], graphs: dict) -> None: + """Post valid profiles. Optionally get valid profiles from input.""" + if self.input_profiles: + values = next(inputs[0].entities).values + paths = [p.path for p in inputs[0].schema.paths] + validated_ontology = values[paths.index("ontology")][0] + valid_profiles = values[paths.index("profile")] + if validated_ontology != self.ontology_graph_iri: + raise ValueError( + "The ontology IRI validated with Validate differs from the input ontology IRI." + ) + else: + valid_profiles = validate_profiles(self, graphs) + post_profiles(self, valid_profiles) + + def _execute(self, inputs: Sequence[Entities], context: ExecutionContext) -> None: """`Execute plugin""" + if self.input_profiles: + if not inputs: + raise OSError( + 'Input entities needed if "Process valid OWL profiles from input" is enabled' + ) + paths = [p.path for p in inputs[0].schema.paths] + if "profile" not in paths or "ontology" not in paths: + raise ValueError("Invalid input for processing OWL profiles") + setup_cmempy_user_access(context.user) graphs = get_graphs_tree((self.data_graph_iri, self.ontology_graph_iri)) self.get_graphs(graphs, context) @@ -306,11 +345,10 @@ def _execute(self, context: ExecutionContext) -> None: setup_cmempy_user_access(context.user) send_result(self.output_graph_iri, Path(self.temp) / "result.ttl") if self.validate_profile: - post_profiles(self, validate_profiles(self, graphs)) + self.post_valid_profiles(inputs, graphs) post_provenance(self, get_provenance(self, context)) - remove_temp(self) - def execute(self, inputs: tuple, context: ExecutionContext) -> None: # noqa: ARG002 + def execute(self, inputs: Sequence[Entities], context: ExecutionContext) -> None: """Remove temp files on error""" with TemporaryDirectory() as self.temp: - self._execute(context) + self._execute(inputs, context) diff --git a/cmem_plugin_reason/plugin_validate.py b/cmem_plugin_reason/plugin_validate.py index 3fae982..6d33bff 100644 --- a/cmem_plugin_reason/plugin_validate.py +++ b/cmem_plugin_reason/plugin_validate.py @@ -1,6 +1,7 @@ """Ontology consistency validation workflow plugin module""" from datetime import UTC, datetime +from os import environ from pathlib import Path from tempfile import TemporaryDirectory from time import time @@ -38,16 +39,18 @@ validate_profiles, ) +environ["SSL_VERIFY"] = "false" + @Plugin( - label="Validate", + label="Validate OWL consistency", description="Validates the consistency of an OWL ontology.", documentation="""A task validating the consistency of an OWL ontology and generating an explanation if inconsistencies are found. The explanation can be written to the project as a Markdown file and/or to a specified graph. The Markdown string is also provided as an output entity using the path "text". The following reasoners are supported: ELK, Expression Materializing Reasoner, HermiT, JFact, Structural Reasoner and Whelk.""", - icon=Icon(package=__package__, file_name="validate.png"), + icon=Icon(file_name="file-icons--owl.svg", package=__package__), parameters=[ REASONER_PARAMETER, ONTOLOGY_GRAPH_IRI_PARAMETER, @@ -156,7 +159,7 @@ def explain(self, graphs: dict) -> None: f'--language-annotation rdfs:label "Ontology Validation Result {utctime}" en ' f"--language-annotation rdfs:comment " f'"Ontology validation of <{self.ontology_graph_iri}>" en ' - f'--link-annotation prov:wasDerivedFrom "{self.ontology_graph_iri}" ' + f'--link-annotation dc:source "{self.ontology_graph_iri}" ' f'--typed-annotation dc:created "{utctime}" xsd:dateTime ' f'--output "{self.temp}/output.ttl"' ) @@ -191,8 +194,8 @@ def add_profiles(self, valid_profiles: list) -> list: def make_entities(self, text: str, valid_profiles: list) -> Entities: """Make entities""" - values = [[text]] - paths = [EntityPath(path="markdown")] + values = [[text], [self.ontology_graph_iri]] + paths = [EntityPath(path="markdown"), EntityPath(path="ontology")] if self.validate_profile: values.append(valid_profiles) paths.append(EntityPath(path="profile")) diff --git a/cmem_plugin_reason/reason.png b/cmem_plugin_reason/reason.png deleted file mode 100644 index 4d479cb..0000000 Binary files a/cmem_plugin_reason/reason.png and /dev/null differ diff --git a/cmem_plugin_reason/utils.py b/cmem_plugin_reason/utils.py index 108cf8a..0cc8b7f 100644 --- a/cmem_plugin_reason/utils.py +++ b/cmem_plugin_reason/utils.py @@ -1,13 +1,10 @@ """Common constants and functions""" import json -import re import shlex -import unicodedata from collections import OrderedDict from pathlib import Path from secrets import token_hex -from shutil import rmtree from subprocess import CompletedProcess, run from xml.etree.ElementTree import Element, SubElement, tostring @@ -71,16 +68,6 @@ ) -def convert_iri_to_filename(value: str) -> str: - """Convert IRI to filename""" - value = unicodedata.normalize("NFKD", value).encode("ascii", "ignore").decode("ascii") - value = re.sub(r"\.", "_", value.lower()) - value = re.sub(r"/", "_", value.lower()) - value = re.sub(r"[^\w\s-]", "", value.lower()) - value = re.sub(r"[-\s]+", "-", value).strip("-_") - return value + ".nt" - - def create_xml_catalog_file(dir_: str, graphs: dict) -> None: """Create XML catalog file""" file_name = Path(dir_) / "catalog-v001.xml" @@ -103,12 +90,12 @@ def get_graphs_tree(graph_iris: tuple) -> dict: graphs = {} for graph_iri in graph_iris: if graph_iri not in graphs: - graphs[graph_iri] = convert_iri_to_filename(graph_iri) + graphs[graph_iri] = f"{token_hex(8)}.nt" tree = get_graph_import_tree(graph_iri) for value in tree["tree"].values(): for iri in value: if iri not in graphs: - graphs[iri] = convert_iri_to_filename(iri) + graphs[iri] = f"{token_hex(8)}.nt" return graphs @@ -122,14 +109,6 @@ def send_result(iri: str, filepath: Path) -> None: ) -def remove_temp(plugin: WorkflowPlugin) -> None: - """Remove temporary files""" - try: - rmtree(plugin.temp) - except (OSError, FileNotFoundError) as err: - plugin.log.warning(f"Cannot remove directory {plugin.temp} ({err})") - - def post_provenance(plugin: WorkflowPlugin, prov: dict | None) -> None: """Post provenance""" if not prov: @@ -141,7 +120,7 @@ def post_provenance(plugin: WorkflowPlugin, prov: dict | None) -> None: insert_query = f""" INSERT DATA {{ GRAPH <{plugin.output_graph_iri}> {{ - <{plugin.output_graph_iri}> + <{plugin.output_graph_iri}> <{prov["plugin_iri"]}> . <{prov["plugin_iri"]}> a <{prov["plugin_type"]}>, . diff --git a/cmem_plugin_reason/validate.png b/cmem_plugin_reason/validate.png deleted file mode 100644 index 5e9fb8c..0000000 Binary files a/cmem_plugin_reason/validate.png and /dev/null differ diff --git a/poetry.lock b/poetry.lock index bbffb6b..d192085 100644 --- a/poetry.lock +++ b/poetry.lock @@ -170,63 +170,63 @@ files = [ [[package]] name = "coverage" -version = "7.5.4" +version = "7.6.0" description = "Code coverage measurement for Python" optional = false python-versions = ">=3.8" files = [ - {file = "coverage-7.5.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6cfb5a4f556bb51aba274588200a46e4dd6b505fb1a5f8c5ae408222eb416f99"}, - {file = "coverage-7.5.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2174e7c23e0a454ffe12267a10732c273243b4f2d50d07544a91198f05c48f47"}, - {file = "coverage-7.5.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2214ee920787d85db1b6a0bd9da5f8503ccc8fcd5814d90796c2f2493a2f4d2e"}, - {file = "coverage-7.5.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1137f46adb28e3813dec8c01fefadcb8c614f33576f672962e323b5128d9a68d"}, - {file = "coverage-7.5.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b385d49609f8e9efc885790a5a0e89f2e3ae042cdf12958b6034cc442de428d3"}, - {file = "coverage-7.5.4-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:b4a474f799456e0eb46d78ab07303286a84a3140e9700b9e154cfebc8f527016"}, - {file = "coverage-7.5.4-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:5cd64adedf3be66f8ccee418473c2916492d53cbafbfcff851cbec5a8454b136"}, - {file = "coverage-7.5.4-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:e564c2cf45d2f44a9da56f4e3a26b2236504a496eb4cb0ca7221cd4cc7a9aca9"}, - {file = "coverage-7.5.4-cp310-cp310-win32.whl", hash = "sha256:7076b4b3a5f6d2b5d7f1185fde25b1e54eb66e647a1dfef0e2c2bfaf9b4c88c8"}, - {file = "coverage-7.5.4-cp310-cp310-win_amd64.whl", hash = "sha256:018a12985185038a5b2bcafab04ab833a9a0f2c59995b3cec07e10074c78635f"}, - {file = "coverage-7.5.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:db14f552ac38f10758ad14dd7b983dbab424e731588d300c7db25b6f89e335b5"}, - {file = "coverage-7.5.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3257fdd8e574805f27bb5342b77bc65578e98cbc004a92232106344053f319ba"}, - {file = "coverage-7.5.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3a6612c99081d8d6134005b1354191e103ec9705d7ba2754e848211ac8cacc6b"}, - {file = "coverage-7.5.4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d45d3cbd94159c468b9b8c5a556e3f6b81a8d1af2a92b77320e887c3e7a5d080"}, - {file = "coverage-7.5.4-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ed550e7442f278af76d9d65af48069f1fb84c9f745ae249c1a183c1e9d1b025c"}, - {file = "coverage-7.5.4-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:7a892be37ca35eb5019ec85402c3371b0f7cda5ab5056023a7f13da0961e60da"}, - {file = "coverage-7.5.4-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:8192794d120167e2a64721d88dbd688584675e86e15d0569599257566dec9bf0"}, - {file = "coverage-7.5.4-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:820bc841faa502e727a48311948e0461132a9c8baa42f6b2b84a29ced24cc078"}, - {file = "coverage-7.5.4-cp311-cp311-win32.whl", hash = "sha256:6aae5cce399a0f065da65c7bb1e8abd5c7a3043da9dceb429ebe1b289bc07806"}, - {file = "coverage-7.5.4-cp311-cp311-win_amd64.whl", hash = "sha256:d2e344d6adc8ef81c5a233d3a57b3c7d5181f40e79e05e1c143da143ccb6377d"}, - {file = "coverage-7.5.4-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:54317c2b806354cbb2dc7ac27e2b93f97096912cc16b18289c5d4e44fc663233"}, - {file = "coverage-7.5.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:042183de01f8b6d531e10c197f7f0315a61e8d805ab29c5f7b51a01d62782747"}, - {file = "coverage-7.5.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a6bb74ed465d5fb204b2ec41d79bcd28afccf817de721e8a807d5141c3426638"}, - {file = "coverage-7.5.4-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b3d45ff86efb129c599a3b287ae2e44c1e281ae0f9a9bad0edc202179bcc3a2e"}, - {file = "coverage-7.5.4-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5013ed890dc917cef2c9f765c4c6a8ae9df983cd60dbb635df8ed9f4ebc9f555"}, - {file = "coverage-7.5.4-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:1014fbf665fef86cdfd6cb5b7371496ce35e4d2a00cda501cf9f5b9e6fced69f"}, - {file = "coverage-7.5.4-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:3684bc2ff328f935981847082ba4fdc950d58906a40eafa93510d1b54c08a66c"}, - {file = "coverage-7.5.4-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:581ea96f92bf71a5ec0974001f900db495488434a6928a2ca7f01eee20c23805"}, - {file = "coverage-7.5.4-cp312-cp312-win32.whl", hash = "sha256:73ca8fbc5bc622e54627314c1a6f1dfdd8db69788f3443e752c215f29fa87a0b"}, - {file = "coverage-7.5.4-cp312-cp312-win_amd64.whl", hash = "sha256:cef4649ec906ea7ea5e9e796e68b987f83fa9a718514fe147f538cfeda76d7a7"}, - {file = "coverage-7.5.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:cdd31315fc20868c194130de9ee6bfd99755cc9565edff98ecc12585b90be882"}, - {file = "coverage-7.5.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:02ff6e898197cc1e9fa375581382b72498eb2e6d5fc0b53f03e496cfee3fac6d"}, - {file = "coverage-7.5.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d05c16cf4b4c2fc880cb12ba4c9b526e9e5d5bb1d81313d4d732a5b9fe2b9d53"}, - {file = "coverage-7.5.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c5986ee7ea0795a4095ac4d113cbb3448601efca7f158ec7f7087a6c705304e4"}, - {file = "coverage-7.5.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5df54843b88901fdc2f598ac06737f03d71168fd1175728054c8f5a2739ac3e4"}, - {file = "coverage-7.5.4-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:ab73b35e8d109bffbda9a3e91c64e29fe26e03e49addf5b43d85fc426dde11f9"}, - {file = "coverage-7.5.4-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:aea072a941b033813f5e4814541fc265a5c12ed9720daef11ca516aeacd3bd7f"}, - {file = "coverage-7.5.4-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:16852febd96acd953b0d55fc842ce2dac1710f26729b31c80b940b9afcd9896f"}, - {file = "coverage-7.5.4-cp38-cp38-win32.whl", hash = "sha256:8f894208794b164e6bd4bba61fc98bf6b06be4d390cf2daacfa6eca0a6d2bb4f"}, - {file = "coverage-7.5.4-cp38-cp38-win_amd64.whl", hash = "sha256:e2afe743289273209c992075a5a4913e8d007d569a406ffed0bd080ea02b0633"}, - {file = "coverage-7.5.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b95c3a8cb0463ba9f77383d0fa8c9194cf91f64445a63fc26fb2327e1e1eb088"}, - {file = "coverage-7.5.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:3d7564cc09dd91b5a6001754a5b3c6ecc4aba6323baf33a12bd751036c998be4"}, - {file = "coverage-7.5.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:44da56a2589b684813f86d07597fdf8a9c6ce77f58976727329272f5a01f99f7"}, - {file = "coverage-7.5.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e16f3d6b491c48c5ae726308e6ab1e18ee830b4cdd6913f2d7f77354b33f91c8"}, - {file = "coverage-7.5.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dbc5958cb471e5a5af41b0ddaea96a37e74ed289535e8deca404811f6cb0bc3d"}, - {file = "coverage-7.5.4-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:a04e990a2a41740b02d6182b498ee9796cf60eefe40cf859b016650147908029"}, - {file = "coverage-7.5.4-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:ddbd2f9713a79e8e7242d7c51f1929611e991d855f414ca9996c20e44a895f7c"}, - {file = "coverage-7.5.4-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:b1ccf5e728ccf83acd313c89f07c22d70d6c375a9c6f339233dcf792094bcbf7"}, - {file = "coverage-7.5.4-cp39-cp39-win32.whl", hash = "sha256:56b4eafa21c6c175b3ede004ca12c653a88b6f922494b023aeb1e836df953ace"}, - {file = "coverage-7.5.4-cp39-cp39-win_amd64.whl", hash = "sha256:65e528e2e921ba8fd67d9055e6b9f9e34b21ebd6768ae1c1723f4ea6ace1234d"}, - {file = "coverage-7.5.4-pp38.pp39.pp310-none-any.whl", hash = "sha256:79b356f3dd5b26f3ad23b35c75dbdaf1f9e2450b6bcefc6d0825ea0aa3f86ca5"}, - {file = "coverage-7.5.4.tar.gz", hash = "sha256:a44963520b069e12789d0faea4e9fdb1e410cdc4aab89d94f7f55cbb7fef0353"}, + {file = "coverage-7.6.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:dff044f661f59dace805eedb4a7404c573b6ff0cdba4a524141bc63d7be5c7fd"}, + {file = "coverage-7.6.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a8659fd33ee9e6ca03950cfdcdf271d645cf681609153f218826dd9805ab585c"}, + {file = "coverage-7.6.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7792f0ab20df8071d669d929c75c97fecfa6bcab82c10ee4adb91c7a54055463"}, + {file = "coverage-7.6.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d4b3cd1ca7cd73d229487fa5caca9e4bc1f0bca96526b922d61053ea751fe791"}, + {file = "coverage-7.6.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e7e128f85c0b419907d1f38e616c4f1e9f1d1b37a7949f44df9a73d5da5cd53c"}, + {file = "coverage-7.6.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:a94925102c89247530ae1dab7dc02c690942566f22e189cbd53579b0693c0783"}, + {file = "coverage-7.6.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:dcd070b5b585b50e6617e8972f3fbbee786afca71b1936ac06257f7e178f00f6"}, + {file = "coverage-7.6.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:d50a252b23b9b4dfeefc1f663c568a221092cbaded20a05a11665d0dbec9b8fb"}, + {file = "coverage-7.6.0-cp310-cp310-win32.whl", hash = "sha256:0e7b27d04131c46e6894f23a4ae186a6a2207209a05df5b6ad4caee6d54a222c"}, + {file = "coverage-7.6.0-cp310-cp310-win_amd64.whl", hash = "sha256:54dece71673b3187c86226c3ca793c5f891f9fc3d8aa183f2e3653da18566169"}, + {file = "coverage-7.6.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c7b525ab52ce18c57ae232ba6f7010297a87ced82a2383b1afd238849c1ff933"}, + {file = "coverage-7.6.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4bea27c4269234e06f621f3fac3925f56ff34bc14521484b8f66a580aacc2e7d"}, + {file = "coverage-7.6.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ed8d1d1821ba5fc88d4a4f45387b65de52382fa3ef1f0115a4f7a20cdfab0e94"}, + {file = "coverage-7.6.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:01c322ef2bbe15057bc4bf132b525b7e3f7206f071799eb8aa6ad1940bcf5fb1"}, + {file = "coverage-7.6.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:03cafe82c1b32b770a29fd6de923625ccac3185a54a5e66606da26d105f37dac"}, + {file = "coverage-7.6.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:0d1b923fc4a40c5832be4f35a5dab0e5ff89cddf83bb4174499e02ea089daf57"}, + {file = "coverage-7.6.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:4b03741e70fb811d1a9a1d75355cf391f274ed85847f4b78e35459899f57af4d"}, + {file = "coverage-7.6.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:a73d18625f6a8a1cbb11eadc1d03929f9510f4131879288e3f7922097a429f63"}, + {file = "coverage-7.6.0-cp311-cp311-win32.whl", hash = "sha256:65fa405b837060db569a61ec368b74688f429b32fa47a8929a7a2f9b47183713"}, + {file = "coverage-7.6.0-cp311-cp311-win_amd64.whl", hash = "sha256:6379688fb4cfa921ae349c76eb1a9ab26b65f32b03d46bb0eed841fd4cb6afb1"}, + {file = "coverage-7.6.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:f7db0b6ae1f96ae41afe626095149ecd1b212b424626175a6633c2999eaad45b"}, + {file = "coverage-7.6.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:bbdf9a72403110a3bdae77948b8011f644571311c2fb35ee15f0f10a8fc082e8"}, + {file = "coverage-7.6.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cc44bf0315268e253bf563f3560e6c004efe38f76db03a1558274a6e04bf5d5"}, + {file = "coverage-7.6.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:da8549d17489cd52f85a9829d0e1d91059359b3c54a26f28bec2c5d369524807"}, + {file = "coverage-7.6.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0086cd4fc71b7d485ac93ca4239c8f75732c2ae3ba83f6be1c9be59d9e2c6382"}, + {file = "coverage-7.6.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:1fad32ee9b27350687035cb5fdf9145bc9cf0a094a9577d43e909948ebcfa27b"}, + {file = "coverage-7.6.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:044a0985a4f25b335882b0966625270a8d9db3d3409ddc49a4eb00b0ef5e8cee"}, + {file = "coverage-7.6.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:76d5f82213aa78098b9b964ea89de4617e70e0d43e97900c2778a50856dac605"}, + {file = "coverage-7.6.0-cp312-cp312-win32.whl", hash = "sha256:3c59105f8d58ce500f348c5b56163a4113a440dad6daa2294b5052a10db866da"}, + {file = "coverage-7.6.0-cp312-cp312-win_amd64.whl", hash = "sha256:ca5d79cfdae420a1d52bf177de4bc2289c321d6c961ae321503b2ca59c17ae67"}, + {file = "coverage-7.6.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:d39bd10f0ae453554798b125d2f39884290c480f56e8a02ba7a6ed552005243b"}, + {file = "coverage-7.6.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:beb08e8508e53a568811016e59f3234d29c2583f6b6e28572f0954a6b4f7e03d"}, + {file = "coverage-7.6.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b2e16f4cd2bc4d88ba30ca2d3bbf2f21f00f382cf4e1ce3b1ddc96c634bc48ca"}, + {file = "coverage-7.6.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6616d1c9bf1e3faea78711ee42a8b972367d82ceae233ec0ac61cc7fec09fa6b"}, + {file = "coverage-7.6.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ad4567d6c334c46046d1c4c20024de2a1c3abc626817ae21ae3da600f5779b44"}, + {file = "coverage-7.6.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:d17c6a415d68cfe1091d3296ba5749d3d8696e42c37fca5d4860c5bf7b729f03"}, + {file = "coverage-7.6.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:9146579352d7b5f6412735d0f203bbd8d00113a680b66565e205bc605ef81bc6"}, + {file = "coverage-7.6.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:cdab02a0a941af190df8782aafc591ef3ad08824f97850b015c8c6a8b3877b0b"}, + {file = "coverage-7.6.0-cp38-cp38-win32.whl", hash = "sha256:df423f351b162a702c053d5dddc0fc0ef9a9e27ea3f449781ace5f906b664428"}, + {file = "coverage-7.6.0-cp38-cp38-win_amd64.whl", hash = "sha256:f2501d60d7497fd55e391f423f965bbe9e650e9ffc3c627d5f0ac516026000b8"}, + {file = "coverage-7.6.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:7221f9ac9dad9492cecab6f676b3eaf9185141539d5c9689d13fd6b0d7de840c"}, + {file = "coverage-7.6.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ddaaa91bfc4477d2871442bbf30a125e8fe6b05da8a0015507bfbf4718228ab2"}, + {file = "coverage-7.6.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c4cbe651f3904e28f3a55d6f371203049034b4ddbce65a54527a3f189ca3b390"}, + {file = "coverage-7.6.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:831b476d79408ab6ccfadaaf199906c833f02fdb32c9ab907b1d4aa0713cfa3b"}, + {file = "coverage-7.6.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:46c3d091059ad0b9c59d1034de74a7f36dcfa7f6d3bde782c49deb42438f2450"}, + {file = "coverage-7.6.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:4d5fae0a22dc86259dee66f2cc6c1d3e490c4a1214d7daa2a93d07491c5c04b6"}, + {file = "coverage-7.6.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:07ed352205574aad067482e53dd606926afebcb5590653121063fbf4e2175166"}, + {file = "coverage-7.6.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:49c76cdfa13015c4560702574bad67f0e15ca5a2872c6a125f6327ead2b731dd"}, + {file = "coverage-7.6.0-cp39-cp39-win32.whl", hash = "sha256:482855914928c8175735a2a59c8dc5806cf7d8f032e4820d52e845d1f731dca2"}, + {file = "coverage-7.6.0-cp39-cp39-win_amd64.whl", hash = "sha256:543ef9179bc55edfd895154a51792b01c017c87af0ebaae092720152e19e42ca"}, + {file = "coverage-7.6.0-pp38.pp39.pp310-none-any.whl", hash = "sha256:6fe885135c8a479d3e37a7aae61cbd3a0fb2deccb4dda3c25f92a49189f766d6"}, + {file = "coverage-7.6.0.tar.gz", hash = "sha256:289cc803fa1dc901f84701ac10c9ee873619320f2f9aff38794db4a4a0268d51"}, ] [package.extras] @@ -1033,13 +1033,13 @@ setuptools = "*" [[package]] name = "setuptools" -version = "70.2.0" +version = "70.3.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "setuptools-70.2.0-py3-none-any.whl", hash = "sha256:b8b8060bb426838fbe942479c90296ce976249451118ef566a5a0b7d8b78fb05"}, - {file = "setuptools-70.2.0.tar.gz", hash = "sha256:bd63e505105011b25c3c11f753f7e3b8465ea739efddaccef8f0efac2137bac1"}, + {file = "setuptools-70.3.0-py3-none-any.whl", hash = "sha256:fe384da74336c398e0d956d1cae0669bc02eed936cdb1d49b57de1990dc11ffc"}, + {file = "setuptools-70.3.0.tar.gz", hash = "sha256:f171bab1dfbc86b132997f26a119f6056a57950d058587841a0082e8830f9dc5"}, ] [package.extras] @@ -1059,13 +1059,13 @@ files = [ [[package]] name = "textual" -version = "0.71.0" +version = "0.72.0" description = "Modern Text User Interface framework" optional = false python-versions = "<4.0,>=3.8" files = [ - {file = "textual-0.71.0-py3-none-any.whl", hash = "sha256:60500cc63ffd98a4aff8679976a1530d5e99a881e13bb040d26558a2c45f49d8"}, - {file = "textual-0.71.0.tar.gz", hash = "sha256:a38a3bd7e450ed173b59ab1c93a3aa8174d95bc5c79647f220a50243236ce70a"}, + {file = "textual-0.72.0-py3-none-any.whl", hash = "sha256:a9886eb96bd6391b8795244d2b8fe592204556c42264ea7513a1211584e17366"}, + {file = "textual-0.72.0.tar.gz", hash = "sha256:14174ce8d49016a85aa6c0669d0881b5419e98cf46d429f263314295409ed262"}, ] [package.dependencies] @@ -1120,16 +1120,19 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "validators" -version = "0.28.3" +version = "0.32.0" description = "Python Data Validation for Humans™" optional = false python-versions = ">=3.8" files = [ - {file = "validators-0.28.3-py3-none-any.whl", hash = "sha256:53cafa854f13850156259d9cc479b864ee901f6a96e6b109e6fc33f98f37d99f"}, - {file = "validators-0.28.3.tar.gz", hash = "sha256:c6c79840bcde9ba77b19f6218f7738188115e27830cbaff43264bc4ed24c429d"}, + {file = "validators-0.32.0-py3-none-any.whl", hash = "sha256:e9ce1703afb0adf7724b0f98e4081d9d10e88fa5d37254d21e41f27774c020cd"}, + {file = "validators-0.32.0.tar.gz", hash = "sha256:9ee6e6d7ac9292b9b755a3155d7c361d76bb2dce23def4f0627662da1e300676"}, ] +[package.extras] +crypto-eth-addresses = ["eth-hash[pycryptodome] (>=0.7.0)"] + [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "ae1efe3e579bbb64c99746f66ee3582f56760e8c1499b99a46d72d4881133c38" +content-hash = "dd60fed6fb82110efd65529dc8d22611a4766eea672161415bc9d13410563804" diff --git a/pyproject.toml b/pyproject.toml index e58f4b7..619f358 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,8 +19,9 @@ homepage = "https://github.com/eccenca/cmem-plugin-reason" [tool.poetry.dependencies] # if you need to change python version here, change it also in .python-version python = "^3.11" -validators = "^0.28.3" +validators = "^0.32.0" pathvalidate = "^3.2.0" +defusedxml = "^0.7.1" [tool.poetry.dependencies.cmem-plugin-base] version = "^4.5.0" diff --git a/tests/test_elk.ttl b/tests/test_elk.ttl index 1323423..d848de9 100644 --- a/tests/test_elk.ttl +++ b/tests/test_elk.ttl @@ -4,14 +4,14 @@ @prefix xml: . @prefix xsd: . @prefix rdfs: . -@prefix prov: . +@prefix dc: . @prefix vocab: . @base . rdf:type owl:Ontology ; owl:imports vocab: ; rdfs:comment "Reasoning result set of and "@en ; - prov:wasDerivedFrom + dc:source , . ################################################################# diff --git a/tests/test_emr.ttl b/tests/test_emr.ttl index 9b64ec7..8a0f1f2 100644 --- a/tests/test_emr.ttl +++ b/tests/test_emr.ttl @@ -4,14 +4,14 @@ @prefix xml: . @prefix xsd: . @prefix rdfs: . -@prefix prov: . +@prefix dc: . @prefix vocab: . @base . rdf:type owl:Ontology ; owl:imports vocab: ; rdfs:comment "Reasoning result set of and "@en ; - prov:wasDerivedFrom + dc:source , . ################################################################# diff --git a/tests/test_hermit.ttl b/tests/test_hermit.ttl index 014cd0a..173d935 100644 --- a/tests/test_hermit.ttl +++ b/tests/test_hermit.ttl @@ -4,14 +4,14 @@ @prefix xml: . @prefix xsd: . @prefix rdfs: . -@prefix prov: . +@prefix dc: . @prefix vocab: . @base . rdf:type owl:Ontology ; owl:imports vocab: ; rdfs:comment "Reasoning result set of and "@en ; - prov:wasDerivedFrom + dc:source , . ################################################################# diff --git a/tests/test_jfact.ttl b/tests/test_jfact.ttl index 014cd0a..173d935 100644 --- a/tests/test_jfact.ttl +++ b/tests/test_jfact.ttl @@ -4,14 +4,14 @@ @prefix xml: . @prefix xsd: . @prefix rdfs: . -@prefix prov: . +@prefix dc: . @prefix vocab: . @base . rdf:type owl:Ontology ; owl:imports vocab: ; rdfs:comment "Reasoning result set of and "@en ; - prov:wasDerivedFrom + dc:source , . ################################################################# diff --git a/tests/test_reason.py b/tests/test_reason.py index 681da68..314c3a8 100644 --- a/tests/test_reason.py +++ b/tests/test_reason.py @@ -101,7 +101,7 @@ def test_validate(errors: str) -> str: if next(iter(result.entities)).values[0][0] != md_test: # type: ignore[union-attr] val_errors += 'EntityPath "markdown" output error. ' - if next(iter(result.entities)).values[1] != ["Full", "DL", "EL", "QL", "RL"]: # type: ignore[union-attr] + if next(iter(result.entities)).values[2] != ["Full", "DL", "EL", "QL", "RL"]: # type: ignore[union-attr] val_errors += 'EntityPath "profile" output error. ' if md_test != get_resource(PROJECT_ID, MD_FILENAME).decode(): diff --git a/tests/test_structural.ttl b/tests/test_structural.ttl index 5a0d45f..df51dc2 100644 --- a/tests/test_structural.ttl +++ b/tests/test_structural.ttl @@ -4,14 +4,14 @@ @prefix xml: . @prefix xsd: . @prefix rdfs: . -@prefix prov: . +@prefix dc: . @prefix vocab: . @base . rdf:type owl:Ontology ; owl:imports vocab: ; rdfs:comment "Reasoning result set of and "@en ; - prov:wasDerivedFrom + dc:source , . ################################################################# diff --git a/tests/test_validate_output.ttl b/tests/test_validate_output.ttl index 9a788ab..e2fb07a 100644 --- a/tests/test_validate_output.ttl +++ b/tests/test_validate_output.ttl @@ -1,13 +1,13 @@ @prefix dcterms: . @prefix owl: . -@prefix prov: . +@prefix dc: . @prefix rdfs: . @prefix xsd: . a owl:Ontology ; rdfs:comment "Ontology validation of "@en ; - prov:wasDerivedFrom . + dc:source . a owl:NamedIndividual, . diff --git a/tests/test_whelk.ttl b/tests/test_whelk.ttl index c304641..4341388 100644 --- a/tests/test_whelk.ttl +++ b/tests/test_whelk.ttl @@ -4,14 +4,14 @@ @prefix xml: . @prefix xsd: . @prefix rdfs: . -@prefix prov: . +@prefix dc: . @prefix vocab: . @base . rdf:type owl:Ontology ; owl:imports vocab: ; rdfs:comment "Reasoning result set of and "@en ; - prov:wasDerivedFrom + dc:source , . #################################################################