[
https://issues.apache.org/jira/browse/JENA-1798?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Pavel Mikhailovskii updated JENA-1798:
--------------------------------------
Description:
TDB1 converts small xsd:long literals, e.g. "1"^<xsd:long> to xsd:integer. 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}
was:
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}
> 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
> Priority: Minor
>
> TDB1 converts small xsd:long literals, e.g. "1"^<xsd:long> to xsd:integer.
> 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)