Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .idea/cmem-plugin-reason.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p

## [Unreleased]

TODO: add at least one Added, Changed, Deprecated, Removed, Fixed or Security section
### Fixed

- Fix robot.jar vulnerabilities CVE-2026-54515, CVE-2026-9828.

## [2.2.5] 2026-03-01
### Changed

- Remove dependency inflection

## [2.2.6] 2026-06-29

### Fixed

Expand Down
4 changes: 4 additions & 0 deletions cmem_plugin_reason/doc/validate_doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ The following reasoner options are supported:
- [Structural Reasoner](http://owlcs.github.io/owlapi/apidocs_4/org/semanticweb/owlapi/reasoner/structural/StructuralReasoner.html) (structural)
- [Whelk](https://github.com/balhoff/whelk) (whelk)

⚠️ Only **HermiT** and **JFact** are recommended for consistency validation, since they are the
only reasoner options here that are complete OWL DL reasoners capable of generating explanations.
The remaining options are kept for backwards compatibility.

### Produce output graph

If enabled, an explanation graph is created.
Expand Down
13 changes: 11 additions & 2 deletions cmem_plugin_reason/plugin_reason.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Reasoning workflow plugin module"""

import re
from collections import OrderedDict
from collections.abc import Sequence
from pathlib import Path
Expand All @@ -25,7 +26,7 @@
MAX_RAM_PERCENTAGE_DEFAULT,
MAX_RAM_PERCENTAGE_PARAMETER,
ONTOLOGY_GRAPH_IRI_PARAMETER,
REASONER_PARAMETER,
REASON_REASONER_PARAMETER,
REASONERS,
VALIDATE_PROFILES_PARAMETER,
cancel_workflow,
Expand Down Expand Up @@ -152,7 +153,7 @@
IGNORE_MISSING_IMPORTS_PARAMETER,
ONTOLOGY_GRAPH_IRI_PARAMETER,
VALIDATE_PROFILES_PARAMETER,
REASONER_PARAMETER,
REASON_REASONER_PARAMETER,
MAX_RAM_PERCENTAGE_PARAMETER,
PluginParameter(
param_type=GraphParameterType(
Expand Down Expand Up @@ -390,6 +391,14 @@ def __init__( # noqa: PLR0913 C901
self.input_ports = FixedNumberOfInputs([])
self.output_port = None

@staticmethod
def underscore(word: str) -> str:
"""Make an underscored, lowercase form from the expression in the string"""
word = re.sub(r"([A-Z]+)([A-Z][a-z])", r"\1_\2", word)
word = re.sub(r"([a-z\d])([A-Z])", r"\1_\2", word)
word = word.replace("-", "_")
return word.lower()

def get_graphs(self, graphs: dict, missing: list) -> None:
"""Get graphs from CMEM"""
for iri, filename in graphs.items():
Expand Down
4 changes: 2 additions & 2 deletions cmem_plugin_reason/plugin_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
MAX_RAM_PERCENTAGE_DEFAULT,
MAX_RAM_PERCENTAGE_PARAMETER,
ONTOLOGY_GRAPH_IRI_PARAMETER,
REASONER_PARAMETER,
REASONERS,
VALIDATE_PROFILES_PARAMETER,
VALIDATE_REASONER_PARAMETER,
cancel_workflow,
create_xml_catalog_file,
get_file_with_datetime,
Expand All @@ -53,7 +53,7 @@
ONTOLOGY_GRAPH_IRI_PARAMETER,
MAX_RAM_PERCENTAGE_PARAMETER,
VALIDATE_PROFILES_PARAMETER,
REASONER_PARAMETER,
VALIDATE_REASONER_PARAMETER,
PluginParameter(
param_type=StringParameterType(),
name="md_filename",
Expand Down
Binary file modified cmem_plugin_reason/robot.jar
Binary file not shown.
12 changes: 11 additions & 1 deletion cmem_plugin_reason/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,23 @@
MAX_RAM_PERCENTAGE_DEFAULT = 20
URN_PATTERN = re.compile(r"^urn:[a-zA-Z0-9][a-zA-Z0-9-]*(:.+)?$", re.IGNORECASE)

REASONER_PARAMETER = PluginParameter(
REASON_REASONER_PARAMETER = PluginParameter(
param_type=ChoiceParameterType(REASONERS),
name="reasoner",
label="Reasoner",
description="Reasoner option.",
)

VALIDATE_REASONER_PARAMETER = PluginParameter(
param_type=ChoiceParameterType(REASONERS),
name="reasoner",
label="Reasoner",
description="""Reasoner option. Only "HermiT" and "JFact" are recommended for consistency
validation, since they are the only reasoners offered here that are complete OWL DL reasoners
capable of generating explanations. The remaining options are kept for backwards
compatibility.""",
)

ONTOLOGY_GRAPH_IRI_PARAMETER = PluginParameter(
param_type=GraphParameterType(classes=["http://www.w3.org/2002/07/owl#Ontology"]),
name="ontology_graph_iri",
Expand Down
1,047 changes: 503 additions & 544 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/test_reason.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def setup() -> Generator[None, Any]:
delete(REASON_RESULT_GRAPH_IRI)


@pytest.mark.parametrize("reasoner_parameter", list(REASONERS.keys()))
@pytest.mark.parametrize("reasoner_parameter", REASONERS)
def test_reason(setup: None, reasoner_parameter: str) -> None: # noqa: ARG001
"""Test reasoning"""
ReasonPlugin(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def setup() -> Generator[None, Any]:
delete_project(PROJECT_ID)


@pytest.mark.parametrize("reasoner_parameter", list(REASONERS.keys()))
@pytest.mark.parametrize("reasoner_parameter", REASONERS)
def test_validate(setup: None, reasoner_parameter: str) -> None: # noqa: ARG001
"""Test Validate"""
result = ValidatePlugin(
Expand Down
Loading