You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Pavel Mikhailovskii (Jira)" <ji...@apache.org> on 2019/12/12 22:07:00 UTC

[jira] [Created] (JENA-1798) TDB1 converts small xsd:long literals into xsd:integer

Pavel Mikhailovskii created JENA-1798:
-----------------------------------------

             Summary: TDB1 converts small xsd:long literals into xsd:integer
                 Key: JENA-1798
                 URL: https://issues.apache.org/jira/browse/JENA-1798
             Project: Apache Jena
          Issue Type: Bug
          Components: TDB
            Reporter: Pavel Mikhailovskii


TDB1 converts small xsd:long literals, e.g. "1"^<xsd:long> to xsd:integer on read. This behavior is specific to TDB1. Even though that might be acceptable in most cases, it breaks validation of SHACL {{ sh:dataType xsd:long ;}} constraints. The following test demonstrates the issue:
{code:java}
    @Test public void longLiterals() {
        DatasetGraph dsg = TDBFactory.createDatasetGraph();
        Quad quad1 = SSE.parseQuad("(quad <g> <s> <p> \"1\"^^<http://www.w3.org/2001/XMLSchema#long>)");
        assertEquals(XSDDatatype.XSDlong, quad1.getObject().getLiteralDatatype());
        dsg.add(quad1);

        Quad quad2 = dsg.find().next();
        assertEquals(XSDDatatype.XSDlong, quad2.getObject().getLiteralDatatype());
    }
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)