Skip to content

Commit

Permalink
Hide focus nodes for property shapes, and indent shacl reports
Browse files Browse the repository at this point in the history
  • Loading branch information
avillar committed Nov 28, 2023
1 parent c9464af commit 6f9b4a5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ogc/bblocks/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 6f9b4a5

Please sign in to comment.