diff --git a/cmem_plugin_reason/plugin_validate.py b/cmem_plugin_reason/plugin_validate.py index 1994c57..215f560 100644 --- a/cmem_plugin_reason/plugin_validate.py +++ b/cmem_plugin_reason/plugin_validate.py @@ -142,7 +142,7 @@ def get_graphs(self, graphs: dict, context: ExecutionContext) -> None: setup_cmempy_user_access(context.user) file.write(get(graph).text) - def validate(self, graphs: dict) -> None: + def explain(self, graphs: dict) -> None: """Reason""" data_location = f"{self.temp}/{graphs[self.ontology_graph_iri]}" utctime = str(datetime.fromtimestamp(int(time()), tz=UTC))[:-6].replace(" ", "T") + "Z" @@ -194,18 +194,21 @@ 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")] + if self.validate_profile: + values.append(valid_profiles) + paths.append(EntityPath(path="profile")) entities = [ Entity( uri="https://eccenca.com/plugin_validateontology/result", - values=[[text], valid_profiles], + values=values, ), ] - schema = EntitySchema( type_uri="https://eccenca.com/plugin_validateontology/type", - paths=[EntityPath(path="markdown"), EntityPath(path="profile")], + paths=paths, ) - return Entities(entities=entities, schema=schema) def execute(self, inputs: tuple, context: ExecutionContext) -> Entities | None: # noqa: ARG002 @@ -214,7 +217,7 @@ def execute(self, inputs: tuple, context: ExecutionContext) -> Entities | None: graphs = get_graphs_tree((self.ontology_graph_iri,)) self.get_graphs(graphs, context) create_xml_catalog_file(self.temp, graphs) - self.validate(graphs) + self.explain(graphs) if self.produce_graph: setup_cmempy_user_access(context.user) diff --git a/cmem_plugin_reason/utils.py b/cmem_plugin_reason/utils.py index 873a6ea..1bea3ca 100644 --- a/cmem_plugin_reason/utils.py +++ b/cmem_plugin_reason/utils.py @@ -55,8 +55,8 @@ param_type=IntParameterType(), name="max_ram_percentage", label="Maximum RAM Percentage", - description="Maximum heap size for the Java virtual machine in the DI container running the " - "reasoning process. ⚠️ Setting the percentage too high may result in an out of memory error.", + description="""Maximum heap size for the Java virtual machine in the DI container running the + reasoning process. ⚠️ Setting the percentage too high may result in an out of memory error.""", default_value=MAX_RAM_PERCENTAGE_DEFAULT, advanced=True, ) @@ -65,8 +65,8 @@ param_type=BoolParameterType(), name="validate_profile", label="Validate OWL2 profiles", - description="""Validate the input ontology against OWL profiles (DL, EL, QL, RL, and - Full) and annotate the result graph.""", + description="""Validate the input ontology against OWL profiles (DL, EL, QL, RL, and Full) and + annotate the result graph.""", default_value=False, )