Skip to content

SPARQL Constraint Violations Cause Display Error and Incorrect Failure Count #14

@EttoreM

Description

@EttoreM

Description

When a SHACL shape with a SPARQL constraint (sh:sparql) detects a violation, the failed check is not counted in the validation summary statistics.

Image

Also, after typing y to see the details, the validator crashes with a TypeError if no sh:description is provided to the NodeShape.

Image

Steps to Reproduce

  • Create a SHACL shape with a sh:sparql constraint that detects a violation
Example SHACL Shape:
turtlefive-safes-crate:AgentProjectIntersection
    a sh:NodeShape ;
    sh:name "Agent Project Membership Validation" ;
    sh:target [ ... ] ;
    sh:sparql [
        a sh:SPARQLConstraint ;
        sh:message "Validation message" ;
        sh:select "SELECT $this WHERE { ... }" ;
        sh:severity sh:Violation ;
    ] .
  • Run the validator on an RO-Crate that violates this constraint
  • Observe the error when attempting to view validation details (see images below)

Expected Behavior

  • The validation should report the failure
  • The failed check should be counted in the summary statistics
  • The violation details should be displayed without errors

Actual Behavior

  • The validation correctly detects the failure (final status shows "FAILED")
  • The summary shows "0 FAILED Checks" instead of counting the SPARQL constraint violation
  • When attempting to display details, a TypeError occurs.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions