[ 
https://issues.apache.org/jira/browse/JENA-1303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15925780#comment-15925780
 ] 

Gilles Habran commented on JENA-1303:
-------------------------------------

Dear [~andy.seaborne],

thank you for this information. We currently have a problem with 
inconsistencies between isIsomorphicWith and contains(Statement) from the class 
Model.

For example, we have an initial RDF file that we load in two different 
repositories (Fedora and Virtuoso). In Fedora, the RDF doc is stored as-is, in 
Virtuoso the triples are stored individually and the leading zero disappears.
It follows that this triple is stored differently in Fedora and Virtuoso :
<ontology:resource_legal_number_natural_celex 
rdf:datatype="http://www.w3.org/2001/XMLSchema#positiveInteger";>0241</ontology:resource_legal_number_natural_celex>

In our application, we retrieve the RDF from Fedora and the triples from 
Virtuoso, load them in Jena models and compare them to check that no triple is 
missing.
We used to use the method isIsomorphicWith from Model. Now we tried to use a 
more custom method to loop through all the statements of a model (from Virtuoso 
or Fedora) and check if they are found in the other model.
For this, we use Model.contains(Statement) and we now have inconsistency in the 
results.

Model.isIsomorphicWith(other model) will return false.
But each statement of both model is found in the other model.

This is because of the class XSDBaseNumericType.java in the method 
isEqual(LiteralLabel, LiteralLabel).
When we arrive in this method, the two arguments are as follows :
value1 = "241^^http://www.w3.org/2001/XMLSchema#positiveInteger";
value2 = "0241^^http://www.w3.org/2001/XMLSchema#positiveInteger";

when we store those values in Number, the leading zero is lost.
n1 = 241
n2 = 241

The initial problem for us is that our triple store Virtuoso removes the 
leading zero when the value is inserted in the repository but getting two 
different results with the method contains and isomorphicwith doesn't seem 
right either


> 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)

Reply via email to