gbv / validation-server

Web service to validate data with support of multiple schema languages
https://format.gbv.de/validate/
MIT License
2 stars 1 forks source link

Validate RDF-Formats defined with SHACL/SheX #70

Open nichtich opened 1 year ago

nichtich commented 1 year ago

SHACL and SheX can be used to check RDF data. There is a node implementation for SHACL.

This feature lacks a use case with an actual data format defined by a SHACL and/or SheX schema. Suggestions?

nichtich commented 1 year ago

See SHACL result report for error responses. position consists of focusNode and and optional resultPath and value. In addition there is a sourceConstraintComponent (type of error).

To transform JSON result of SHACL validation use jq:

.results.bindings[]|{ 
  message:.message.value,
  type:.type.value,
  position: (
    if .node.type=="uri" then 
     { uri: .node.value, rdfterm: ("<"+.node.value+">") }
    else {} end
    + if .path then
    { "shacl-path":.path }
    else {} end
  )
}

To include resultPath, another locator language must be defined on top of SHACL property path.

nichtich commented 9 months ago

First use case could be validation of SKOS via https://github.com/skohub-io/shapes.

Apart from mapping SHACL result report to validation server errors, the validation of SKOS requires an encoding parameter, e.g.