skohub-io / skohub-vocabs

A lightweight tool to publish SKOS Vocabularies
https://skohub.io/
Apache License 2.0
37 stars 25 forks source link

No meaningful error messages for violations in `sh:or` statemanet #306

Open sroertgen opened 6 months ago

sroertgen commented 6 months ago
          Thanks for reporting and fixing @thomschke!

@acka47

I stumbled across this by accident as well yesterday and think it has something to do with #284

We now have sh:or statements in our shacl graph for testing the presence of dct:title, skos:prefLabel and dc:title. The same for the description attributes. The library we are using for doing the shacl validation can handle the validation, but does not give good errors if something goes wrong in these sh:or statements therefore the null statement which you and @thomschke encountered.

This is unfortunate since you also don't get meaningful error messages if one of these attributes is missing. The lib is not returning the correct path to identify the node where an error occured.

The fix provided by @thomschke will help to run vocabs through the pipeline if just a warning occured, but we are getting unhelpful error messages for violations, e.g.

-----------Violation--------------
 Message:  []
 Path:  undefined
 Node, where the error occured:  https://hof-halle-wittenberg.github.io/type/
 Severity of error:  http://www.w3.org/ns/shacl#Violation

(a description is missing in this vocab, but you don't get a good hint from the shacl validation)

Originally posted by @sroertgen in https://github.com/skohub-io/skohub-vocabs/issues/305#issuecomment-2126459549

acka47 commented 5 months ago

a description is missing in this vocab, but you don't get a good hint from the shacl validation

Can this really be the source of the error? AFAICS, description is not mandatory, see https://github.com/skohub-io/skohub-shapes/blob/03905674a22a978288b56ca6709c604d0f7512a0/skohub.shacl.ttl#L62-L81