-
Notifications
You must be signed in to change notification settings - Fork 33
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
use case: local parameterised messages #158
Comments
There is nothing in the SHACL spec that prohibits or discourages using multiple languages for sh:message. It is up the implementation to pick (or ignore) such values. In our servlets, we use the accepted language from the HTTP request to pick the most suitable language, but I believe for example if the ontology only declares messages with "nl" as language and "nl" is not among the accepted languages, it may fall back to the default message. The assumption is that the default message in English is better than a custom language in Dutch unless the receiver is actually able to understand Dutch. (In your examples, note that the preferred namespace prefix for SHACL is "sh" and not "shacl".) |
The issue is that the spec does not provide a way how to get from the engine the parameters back to make correct and nice statements in any language, as illustrated. So in the light of a EU multilingual context providing error messages in the language of the data owner is important. Therefore thus this workaround. In addition, this also highlights that the error message returned from the engine is often not meaningfull for a data engineer. It needs the context from where this rule came from. Error messages that connect the two are needed in practice. I see the following options:
|
Our process to record suggestions for SHACL 1.2 is to open issues at https://github.com/w3c/shacl/issues This repo here is only for editorial changes to SHACL 1.0 and even those probably won't get done as the WG is closed. |
@bertvannuffelen Can you please clarify what you want?
Reading from the spec:
The only omission I see is that
|
@VladimirAlexiev sorry for the late reply. Thanks for taking this forward.
This is intentional: it will show the internal message from the SHACL engine. (same as omitting a sh:message.
That is intentional: it will show the message only in dutch and not the internal message from the SHACL engine. All these cases are to demonstrate the implementation behaviour, and each case,although expressing the same constraint, has a different message to the user. And these are unfortunately not translations from each others, but different values that come close to each other. Mostly loosing valuable information when using the sh:message construct.
correct, my point is not the absence of multilinguality, but the different handling of message in other languages than the engine implementation. I posted some possible solutions, but the one below corresponds to bullet point 2. If that could be realised, wonderfull.
|
As suggested in the issue SEMICeu/DCAT-AP#355 the contribution of a use case.
SHACL specifies that shacl:message overwrites the message generated by the engine.
Thus for the constraint
and the data
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.
The text was updated successfully, but these errors were encountered: