Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
Patch
Description
It seems that SparqlValidation class inconsistently formats the nodes in the messages while reporting the issues:
- default message "SPARQL SELECT constraint for" uses ShLib.displayStr(valueNode)
- custom message provided in sh:message is using NodeFmtLib.str
The issues:
- Inconsistency
- On the default settings there is no difference.
- However, ShLib formats nodes (at least references) according to the ShLib.nodeFmtAbbrev (it is not final).
- Two separate formatter instances could present different and inconsistent results.
- Why static non-configurable formatting of nodes might be a bad idea?
- Apart from possibility to formatting the literals (dates) in a controllable and configurable way...
- Bnode labels are also affected. Default (NodeToLabel) formatting is using X00/X00X000 escaping (by default this is the way how bnode labels are presented in those messages). This escaping is non-deterministic (unlike UTF8).
- Ability in ShLib to modify the NodeFormatterTTL addressed those issues (although static configuration has its own issues) by making it at least controllable (e.g. by using NodeToLabel.createBNodeByLabelAsGiven).
Path for that possibly very simple fix is provided.
Way to reproduce issue: JENA-2315 (just comment sh:message in shape definition)