Uploaded image for project: 'Apache Jena'
  1. Apache Jena
  2. JENA-2316

SHACL: SPARQL validation message formatting inconsistency

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • Jena 4.5.0
    • SHACL
    • 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)

      Attachments

        Activity

          People

            andy Andy Seaborne
            jak_ub Jakub Wach
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: