Skip to content

Unexpected sh:or SHACL violation #98

@Sabachi

Description

@Sabachi

SHACL validation incorrectly creates a violation for the sh:or constraint when the NodeShape with the sh:or constraint also has a complex sh:property pointing towards a sh:node (Which is a NodeShape in itself).

Visit https://s.zazuko.com/RJmit for a minimum working example (mwe).
We expect the SHACL report to look like this:

{
    _:report a sh:ValidationReport ;
        sh:result [
            rdf:type sh:ValidationResult ;
            sh:resultSeverity sh:Violation ;
            sh:sourceConstraintComponent sh:NodeConstraintComponent ;
            sh:sourceShape <http://example.com/ns#educationPropShape> ;
            sh:focusNode <http://example.com/ns#Alice> ;
            sh:value <http://example.com/ns#bachelor> ;
            sh:detail [
                rdf:type sh:ValidationResult ;
                sh:resultSeverity sh:Violation ;
                sh:sourceConstraintComponent sh:MinCountConstraintComponent ;
                sh:sourceShape [
                    sh:path <http://example.com/ns#details> ;
                    sh:minCount 1 ;
                ] ;
                sh:focusNode <http://example.com/ns#bachelor> ;
                sh:resultPath <http://example.com/ns#details> ;
                sh:resultMessage "Less than 1 values" ;
            ] ;
            sh:resultPath <http://example.com/ns#education> ;
            sh:resultMessage "Value does not have shape <http://example.com/ns#bachelorNodeShape>" ;
        ] ;
        sh:conforms false .
}

In the mwe the sh:detail contains an additional SHACL violation that we don't expect to see in the SHACL report.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions