From 6f9b4a58451c0b24f89855b3a5a3302cc0ff1076 Mon Sep 17 00:00:00 2001 From: Alejandro Villar Date: Tue, 28 Nov 2023 12:34:31 +0100 Subject: [PATCH] Hide focus nodes for property shapes, and indent shacl reports --- ogc/bblocks/validate.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ogc/bblocks/validate.py b/ogc/bblocks/validate.py index 05e067b..de1c342 100644 --- a/ogc/bblocks/validate.py +++ b/ogc/bblocks/validate.py @@ -535,7 +535,8 @@ def validate_inner(): report.add_entry(ValidationReportEntry( section=ValidationReportSection.SHACL, - message=f"Validation result for {shacl_file}:\n{shacl_report}", + message=f"Validation result for {shacl_file}:\n" + f"{re.sub(r'^', ' ', shacl_report, flags=re.M)}", is_error=not shacl_conforms, payload={ 'op': 'shacl-report', @@ -849,7 +850,8 @@ def shacl_validate(g: Graph, s: Graph, ont_graph: Graph | None = None) \ 'advanced': True }) focus_nodes: dict[pyshacl.Shape, Sequence[Node]] = {shape: shape.focus_nodes(g) - for shape in validator.shacl_graph.shapes} + for shape in validator.shacl_graph.shapes + if not shape.is_property_shape} conforms, shacl_result, shacl_report = validator.run() return conforms, shacl_result, shacl_report, focus_nodes