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

dcat-ap-SHACL.ttl uses <https://purl.eu/ns/shacl#message> instead of shacl:message for validation messages #355

Open
pmaria opened this issue Feb 28, 2024 · 2 comments
Labels
future-work this topic will be dealt in the future status:resolution-proposed

Comments

@pmaria
Copy link

pmaria commented Feb 28, 2024

dcat-ap-SHACL.ttl uses <https://purl.eu/ns/shacl#message> instead of shacl:message for validation messages:

<https://purl.eu/ns/shacl#message> "Maximally 1 values allowed for type"@en .

Is this intended? https://purl.eu/ns/shacl#message is not dereferenceable.

@bertvannuffelen
Copy link
Contributor

@pmaria This is due a limitation of SHACL specification, to enable multilingual messages in combination with the engine message.

SHACL specifies that shacl:message overwrites the message generated by the engine.

Thus for the constraint

https://semiceu.github.io//DCAT-AP/releases/3.0.0#AgentShape/236f0210baaf149903750c43bbe7012c21debb2a> 
   rdfs:seeAlso "https://semiceu.github.io//DCAT-AP/releases/3.0.0#Agent.type";
  shacl:description "A type of the agent that makes the Catalogue or Dataset available."@en;
  shacl:maxCount 1;
  shacl:name "type"@en;
  shacl:path dc:type.

and the data

<https://test.com/id/agent/1221> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Agent> .
<https://test.com/id/agent/1221> <http://xmlns.com/foaf/0.1/name> "agent 1"@en .
<https://test.com/id/agent/1221> <http://purl.org/dc/terms/type> "type ORG A".
<https://test.com/id/agent/1221> <http://purl.org/dc/terms/type> "type ORG B" . 

The SHACL engine will result a precise message that indicates there are 2 values, instead of 1.
" Property may only have 1 value, but found 2" .

If you perform the replacement shacl:message, the message will be: "Maximally 1 values allowed for type".

This happens even if you add a shacl:message in another language that is not provided by the engine. The overwrite will happen.

As the engine message is more detailed and better pinpointing the error, but we also want to support multilingual messages we added an extra property.

You can try it with the ITB testbed which uses the reference SHACL library as it backbone.

Testbed Instance: https://www.itb.ec.europa.eu/shacl/any/upload.

@pmaria
Copy link
Author

pmaria commented Feb 28, 2024

@bertvannuffelen thanks for the quick and clarifying response.

This might be an interesting issue to raise on https://github.com/w3c/shacl/issues for the possible new SHACL 1.2 WG.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
future-work this topic will be dealt in the future status:resolution-proposed
Projects
None yet
Development

No branches or pull requests

2 participants