Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve validation messages, especially when a validation error is experienced. #1

Open
henrietteharmse opened this issue Mar 14, 2022 · 1 comment

Comments

@henrietteharmse
Copy link
Contributor

henrietteharmse commented Mar 14, 2022

Currently there is no why to provide a concise error message when validation fails. I.e., if we use the organization shape and data that is missing is thedct:title for organisation:

@prefix : <http://purl.org/ejp-rd/metadata-model/v1/example-rdf/> .
@prefix dct:   <http://purl.org/dc/terms/> .
@prefix foaf:  <http://xmlns.com/foaf/0.1/> .

:ErdriDOR  a  foaf:Organisation ;
  dct:spatial  :ErdriDORLocation ;
  foaf:page    <https://eu-rd-platform.jrc.ec.europa.eu/erdridor/> .

:ErdriDORLocation a dct:Location ;
  dct:title  "Italy" .

with shape mapping, it results in this short message:

:ErdriDOR@!:organisationShape when detail=false. The ! indicates that there is an issue with the organisationShape. However, it does not tell you why validation failed. This is the intended purpose of detail=true. But this currently returns this very unhelpful message:

:ErdriDOR@!:organisationShape
   # Error matching expression.
   #  Error: es.weso.rbe.NonNullableError: Required properties not found: <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>{0,0},dct:title,dct:description*,dct:spatial*,foaf:page*
   # Regular expression: <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>,dct:title,dct:description*,dct:spatial*,foaf:page*
   # Properties found: {| <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> -> 1, dct:spatial -> 1, foaf:page -> 1 |}
   # Extra symbols: dct:title/1 
   # Open?: false
   # 
   #  Attempt: Attempt: [<http://purl.org/ejp-rd/metadata-model/v1/example-rdf/ErdriDOR>,<http://purl.org/ejp-rd/metadata-model/v1/shex/organisationShape>]
   # path:  
   #  Candidate line:
   #  Candidate line:
   # <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Organisation> as <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>/[<http://xmlns.com/foaf/0.1/Organisation>]

This messages comes form the underlying Shex validation library used. Currently there seems to be no easy way to improve these validation error messages. See this issue.

@henrietteharmse henrietteharmse changed the title Improve error messages, especially when a validation error is experienced. Improve validation messages, especially when a validation error is experienced. Mar 14, 2022
@labra
Copy link

labra commented Mar 15, 2022

Thanks for using the ShEx-s library. Your are right that the current natural language description of the errors should be improved.

There is also the possibility that the generated result shape map in ShEx-s is generated in JSON which could later be converted to a more helpful message if you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants