SHACL (Shapes Constraint Language) validation reports are structured documents that provide detailed information about the results of validating RDF data against SHACL shapes. These reports are crucial for understanding the conformance of data to predefined constraints and for identifying and addressing data quality issues.
A SHACL validation report is itself an RDF graph, typically serialized in Turtle or JSON-LD format. The report contains the following key components:
The sh:conforms
property indicates whether the validated data graph conforms to all shapes. It has a boolean value:
For each constraint violation, the report includes a result node with the following properties:
sh:resultSeverity
: Indicates the severity of the violation (sh:Violation, sh:Warning, or sh:Info)sh:focusNode
: The RDF node that was validated against the shapesh:resultPath
: The property path related to the constraint violation (if applicable)sh:value
: The RDF node value that caused the violation (if applicable)sh:sourceShape
: The specific shape that was violatedsh:sourceConstraintComponent
: The constraint component that was violatedsh:message
: A human-readable message describing the violationHere's a simple example of a SHACL validation report in Turtle format:
@prefix sh: <http://www.w3.org/ns/shacl#> . @prefix ex: <http://example.com/> . [] a sh:ValidationReport ; sh:conforms false ; sh:result [ a sh:ValidationResult ; sh:resultSeverity sh:Violation ; sh:focusNode ex:John ; sh:resultPath ex:age ; sh:value "twenty" ; sh:sourceShape ex:PersonShape ; sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; sh:message "Value is not a valid integer" ; ] .
SHACL validation reports can be used for various purposes:
Several tools can generate and process SHACL validation reports:
⚠️ LLM-generated content notice: Parts of this page may have been created or edited with the assistance of a large language model (LLM). The prompts that have been used might be on the page itself, the discussion page or in straight forward cases the prompt was just "Write a mediawiki page on X" with X being the page name. While the content has been reviewed it might still not be accurate or error-free.