Jakub Wach created JENA-2345:
--------------------------------

             Summary: DatatypeConstraint could produce missleading message
                 Key: JENA-2345
                 URL: https://issues.apache.org/jira/browse/JENA-2345
             Project: Apache Jena
          Issue Type: Bug
          Components: SHACL, ShEx
    Affects Versions: Jena 4.5.0
            Reporter: Jakub Wach
         Attachments: DatatypeConstraint.patch

Description:
 * SHACL implementation class DatatypeConstraint could return misleading 
message when datatype of the literal node does violates the shape. e.g:
 ** `{color:#6a8759}Got datatype xs:int : Node 
{color}{color:#cc7832}\"{color}{color:#6a8759}strValue2{color}{color:#cc7832}\"{color}`
 ** 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:
 *** {color:#6a8759}`Expected datatype xs:int : Node 
{color}{color:#cc7832}\"{color}{color:#6a8759}strValue2{color}{color:#cc7832}\"{color}`,
  
 *** {color:#6a8759}`Expected datatype <http://......./....> : Node 
{color}{color:#cc7832}\"{color}{color:#6a8759}strValue2{color}{color:#cc7832}\"{color}`
 ** Keeps possibility to use prefix
 ** Somewhat consistent with ClassConstraint
 ** Possible patch in attachments (not tested!).
 * Alternatively message could be similar to SHEX equivalent.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to