Skip to content

Commit 451179d

Browse files
committed
Fix return of rdf validation
1 parent b0e1247 commit 451179d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ogc/bblocks/validation/rdf.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ def validate(self, filename: Path, output_filename: Path, report: ValidationRepo
368368
additional_shacl_closures = [c if is_url(c) else self.bblock.files_path.joinpath(c)
369369
for c in additional_shacl_closures]
370370

371+
shacl_errors_found = False
371372
for shacl_file, shacl_graph in self.shacl_graphs.items():
372373

373374
try:
@@ -381,6 +382,9 @@ def validate(self, filename: Path, output_filename: Path, report: ValidationRepo
381382
shacl_conforms, shacl_result, shacl_report, focus_nodes = shacl_validate(
382383
graph, shacl_graph, ont_graph=ont_graph)
383384

385+
if not shacl_conforms:
386+
shacl_errors_found = True
387+
384388
report.add_entry(ValidationReportEntry(
385389
section=ValidationReportSection.SHACL,
386390
message=f"Validation result for {shacl_file}:\n"
@@ -450,6 +454,7 @@ def validate(self, filename: Path, output_filename: Path, report: ValidationRepo
450454
'shaclFile': str(shacl_file),
451455
}
452456
))
457+
shacl_errors_found = True
453458
except ReportableRuntimeError as e:
454459
report.add_entry(ValidationReportEntry(
455460
section=ValidationReportSection.SHACL,
@@ -462,4 +467,6 @@ def validate(self, filename: Path, output_filename: Path, report: ValidationRepo
462467
'shaclFile': str(shacl_file),
463468
}
464469
))
470+
shacl_errors_found = True
471+
return not shacl_errors_found
465472
return None

0 commit comments

Comments
 (0)