epos-eu / EPOS-DCAT-AP

DCAT-AP extension for the EPOS solid Earth sciences community
MIT License
14 stars 61 forks source link

Provide extra context in the shapes-warning messages. #547

Open marc-portier opened 2 years ago

marc-portier commented 2 years ago

Many of the shacl validation tools produce (understandably) limited context in their reports.

(e.g. the cli of https://github.com/TopQuadrant/shacl or the online ux of https://www.itb.ec.europa.eu/shacl/any/upload)

Leading to less then helpful messages like:

I understand this limitation is coming (partly) from these tools, but at least the messages provided in the shapes.ttl could easily contain a better hint towards resolving things by adding more of the context into the message.

e.g. the current https://github.com/epos-eu/EPOS-DCAT-AP/blob/EPOS-DCAT-AP-shapes/epos-dcat-ap_shapes.ttl#L766

sh:message "Provider is recommended. Please fill in a value"@en  ;

changing that into

sh:message "schema:provider (of type schema:Person or schema:Organization) is recommended (for any epos:Webservice). Please fill in a value"@en  ;

would often avoid needing to lookup that kind of context in the shapes file, and thus shortening the roundtrip of try-validate-correct to a large extend

I'm happy to provide a pull request for this, provided it makes sense to the powers that be over here :)