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

DatatypeConstraint could produce missleading message

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • Jena 4.5.0
    • Jena 4.6.0
    • SHACL, ShEx
    • None
    • Patch

    Description

      Description:

      • SHACL implementation class DatatypeConstraint could return misleading message when datatype of the literal node does violates the shape. e.g:
        • `Got datatype xs:int : Node \"strValue2\"`
        • Current implementation does either quote expected datatype or actual datatype of the node. It all depends on prefix mapping!
      • Shape/constraint: https://www.w3.org/TR/shacl/#DatatypeConstraintComponent

      Possible solutions:

      • Always use expected data type:
        • Possible messages:
          • `Expected datatype xs:int : Node \"strValue2\"`,  
          • `Expected datatype <http://......./....> : Node \"strValue2\"`
        • Keeps possibility to use prefix
        • Somewhat consistent with ClassConstraint
        • Possible patch in attachments (not tested!).
      • Alternatively message could be similar to SHEX equivalent.

      Attachments

        1. DatatypeConstraint.patch
          1 kB
          Jakub Wach

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: