Skip to content

Mapping SHACL Validation Report to Validation Error Format #17

Description

@nichtich

A SHACL Validation Report has multiple fields:

  • focusNode (a mandatory RDF term)
  • resultPath (optional SHACL property path) - can be serialized as SPARQL property path
  • value (an optional RDF term)
  • sourceShape (optional IRI of a SHACL Shape) - that caused the result
  • severity (Info/Warning/Violation) - of the shape that caused the result (therefore implied by sourceShape)
  • sourceConstraintComponent (optional Constraint Component IRI)
  • resultMessage (optional, one per language at most!)

The position of a SHACL violation would be:

  • dimension rdfterm : just the focus node
  • dimension triplepattern : focus node + resultPath + value => expressible as SPARQL Property Path Pattern with subject and object being RDF terms
  • SPARQL property path

The types of a SHACL violation would be:

  • sourceShape IRI
  • sourceConstraintComponent

Dimension triplepattern can be defined as space-separated list of:

triplepattern ::= subject SPACE Path SPACE object
SPACE ::= #20

Grammar from N-Triples 1.1 syntax but whitespace not allowed:

subject  ::=  IRIREF | BLANK_NODE_LABEL
object  ::=  IRIREF | BLANK_NODE_LABEL | literal

Grammar of property path expression is a subset of SPARQL Grammar, not allowing whitespace:

Path                  ::= PathSequence ( '|' PathSequence )*
PathSequence          ::= PathElt ( '/' PathElt )*
PathElt               ::= PathPrimary ( '?' | '*' | '+' )?
PathPrimary           ::= IRIREF | '(' Path ')' 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions