[
https://issues.apache.org/jira/browse/JENA-1303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15932753#comment-15932753
]
Sergey Malinin edited comment on JENA-1303 at 3/20/17 2:52 PM:
---------------------------------------------------------------
Ok, how you could explain the next behavior, the output for same inserted data
is different for TDB Model and Jena InMemory model ?
Where is the bug in Jena TDB Storage or in Jena InMemory storage ?
Example:
{code}
Node ns = NodeFactory.createURI("a1");
Node np1 = NodeFactory.createURI("b1");
Node np2 = NodeFactory.createURI("b2");
RDFDatatype dt1 =
TypeMapper.getInstance().getSafeTypeByName("http://www.w3.org/2001/XMLSchema#positiveInteger");
Node o1 = NodeFactory.createLiteral("0241", null, dt1);
RDFDatatype dt2 =
TypeMapper.getInstance().getSafeTypeByName("http://www.w3.org/2001/XMLSchema#dateTime");
Node o2 = NodeFactory.createLiteral("2017-03-14T13:21:40.1700+01:00",
null, dt2);
String directory = "Dataset1" ;
Dataset dataset = TDBFactory.createDataset(directory) ;
dataset.begin(ReadWrite.WRITE) ;
Model tm = dataset.getDefaultModel() ;
Graph tg = tm.getGraph();
tg.add(new Triple(ns, np1, o1));
tg.add(new Triple(ns, np2, o2));
System.out.println("------Jena TDB ------------");
StmtIterator rs = tm.listStatements();
while (rs.hasNext()) {
System.out.println(rs.next().toString());
}
Model md = ModelFactory.createDefaultModel();
Graph g = md.getGraph();
g.add(new Triple(ns, np1, o1));
g.add(new Triple(ns, np2, o2));
System.out.println("------Jena Memory ------------");
rs = md.listStatements();
while (rs.hasNext()) {
System.out.println(rs.next().toString());
}
System.out.println("\nisIsomorphicWith = "+md.isIsomorphicWith(tm));
dataset.end() ;
dataset.close();
{code}
Output log
{code}
------Jena TDB ------------
[a1, b1, "241"^^http://www.w3.org/2001/XMLSchema#integer]
[a1, b2,
"2017-03-14T13:21:40.17+01:00"^^http://www.w3.org/2001/XMLSchema#dateTime]
------Jena Memory ------------
[a1, b2,
"2017-03-14T13:21:40.1700+01:00"^^http://www.w3.org/2001/XMLSchema#dateTime]
[a1, b1, "0241"^^http://www.w3.org/2001/XMLSchema#positiveInteger]
isIsomorphicWith = false
{code}
was (Author: smalinin):
Ok, how you could explain the next behavior, the output for same inserted data
is different for TDB Model and Jena InMemory model ?
Example:
{code}
Node ns = NodeFactory.createURI("a1");
Node np1 = NodeFactory.createURI("b1");
Node np2 = NodeFactory.createURI("b2");
RDFDatatype dt1 =
TypeMapper.getInstance().getSafeTypeByName("http://www.w3.org/2001/XMLSchema#positiveInteger");
Node o1 = NodeFactory.createLiteral("0241", null, dt1);
RDFDatatype dt2 =
TypeMapper.getInstance().getSafeTypeByName("http://www.w3.org/2001/XMLSchema#dateTime");
Node o2 = NodeFactory.createLiteral("2017-03-14T13:21:40.1700+01:00",
null, dt2);
String directory = "Dataset1" ;
Dataset dataset = TDBFactory.createDataset(directory) ;
dataset.begin(ReadWrite.WRITE) ;
Model tm = dataset.getDefaultModel() ;
Graph tg = tm.getGraph();
tg.add(new Triple(ns, np1, o1));
tg.add(new Triple(ns, np2, o2));
System.out.println("------Jena TDB ------------");
StmtIterator rs = tm.listStatements();
while (rs.hasNext()) {
System.out.println(rs.next().toString());
}
Model md = ModelFactory.createDefaultModel();
Graph g = md.getGraph();
g.add(new Triple(ns, np1, o1));
g.add(new Triple(ns, np2, o2));
System.out.println("------Jena Memory ------------");
rs = md.listStatements();
while (rs.hasNext()) {
System.out.println(rs.next().toString());
}
System.out.println("\nisIsomorphicWith = "+md.isIsomorphicWith(tm));
dataset.end() ;
dataset.close();
{code}
Output log
{code}
------Jena TDB ------------
[a1, b1, "241"^^http://www.w3.org/2001/XMLSchema#integer]
[a1, b2,
"2017-03-14T13:21:40.17+01:00"^^http://www.w3.org/2001/XMLSchema#dateTime]
------Jena Memory ------------
[a1, b2,
"2017-03-14T13:21:40.1700+01:00"^^http://www.w3.org/2001/XMLSchema#dateTime]
[a1, b1, "0241"^^http://www.w3.org/2001/XMLSchema#positiveInteger]
isIsomorphicWith = false
{code}
> Starting 0 in XSDnonNegativeInteger is badly interpreted
> --------------------------------------------------------
>
> Key: JENA-1303
> URL: https://issues.apache.org/jira/browse/JENA-1303
> Project: Apache Jena
> Issue Type: Bug
> Affects Versions: Jena 3.1.0, Jena 3.1.1, Jena 3.2.0
> Reporter: Gilles Habran
> Assignee: Andy Seaborne
>
> Hello,
> we are currently using Jena 2.7.2 and we need to upgrade to Jena 3.1.0. We
> cannot use 3.1.1+ because Oracle Jena Adapter does not support other version
> than 3.1.0.
> Here is a test to show the problem.
> Jena 2.7.2 returns true and Jena 3.1.0 returns false
> {code} Model model1 = ModelFactory.createDefaultModel();
> model1.add(model1.createResource("http://jena.apache.org/test"),
> model1.createProperty("http://jena.apache.org/size"),
> model1.createTypedLiteral("05", XSDDatatype.XSDnonNegativeInteger));
> Model model2 = ModelFactory.createDefaultModel();
> model2.add(model2.createResource("http://jena.apache.org/test"),
> model2.createProperty("http://jena.apache.org/size"),
> model2.createTypedLiteral("5", XSDDatatype.XSDnonNegativeInteger));
> Assert.assertTrue(model1.isIsomorphicWith(model2));{code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)