skohub-io / skohub-vocabs

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

fix validation report #305

Closed thomschke closed 1 month ago

thomschke commented 1 month ago

After forking skohub-pages and change something, github actions aborts with validation error:

 ERROR  UNKNOWN

TypeError: Cannot read properties of null (reading 'value')
    at validate (/app/src/validate.js:65:23)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Object.exports.onPreBootstrap (/app/gatsby-node.js:117:9)
    at runAPI (/app/node_modules/gatsby/src/utils/api-runner-node.js:509:16)
acka47 commented 1 month ago

I get the same error in the skohub.io instance, see https://skohub.io/build/?id=f1a3c5ff-0fcb-4dc6-9823-8b7ab59ba90a.

Assigning @sroertgen for review.

sroertgen commented 1 month 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)

sroertgen commented 1 month ago

I will merge this now, but open an issue to think and discuss about handling the violations