[
https://issues.apache.org/jira/browse/JENA-1303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15926339#comment-15926339
]
Andy Seaborne edited comment on JENA-1303 at 3/15/17 3:22 PM:
--------------------------------------------------------------
Javadoc on {{GraphMatcher.containsSameTerm}}:
{noformat}
/** Special "contains" test that always provide "same term",
* not "sameValueAs" semantics on the containment.
* @param otherm
* @param triple
* @return
*/
{noformat}
and code:
{noformat}
private static boolean containsSameTerm(Graph otherm, Triple triple) {
boolean b = otherm.contains(triple) ;
Node o = triple.getObject() ;
if ( !o.isConcrete() || !o.isLiteral() )
return b ;
if ( ! b )
return false ;
// Force to same term when o is a ground literal.
ExtendedIterator<Triple> iter = otherm.find(triple) ;
while (iter.hasNext()) {
Triple t = iter.next() ;
if ( t.getObject().equals(o) )
return true ;
}
return false ;
}
{noformat}
which is trying to provide "sameTerm" semantics while trying to utilize
efficiency that might be provided by {{Model.contains}}.
"contains" false => same term is false.
"contains" true => means term is true if and only if it is a URI or blank node.
Otherwise "contains" true and literal requires checking the literal object with
".equals".
[Commit
3ea2542|https://github.com/apache/jena/commit/3ea2542c307a491071e9ee113841ea2c44f30334]
was (Author: andy.seaborne):
Javadoc on {{GraphMatcher.containsSameTerm}}:
{noformat}
/** Special "contains" test that always provide "same term",
* not "sameValueAs" semantics on the containment.
* @param otherm
* @param triple
* @return
*/
{noformat}
and code:
{noformat}
private static boolean containsSameTerm(Graph otherm, Triple triple) {
boolean b = otherm.contains(triple) ;
Node o = triple.getObject() ;
if ( !o.isConcrete() || !o.isLiteral() )
return b ;
if ( ! b )
return false ;
// Force to same term when o is a ground literal.
ExtendedIterator<Triple> iter = otherm.find(triple) ;
while (iter.hasNext()) {
Triple t = iter.next() ;
if ( t.getObject().equals(o) )
return true ;
}
return false ;
}
{noformat}
which is trying to provide "sameTerm" semantics while trying to utilize
efficiency that might be provided by {{Model.contains}}.
"contains" false => same term is false.
"contains" true => means term is true if and only if it is a URI or blank node.
Otherwise "contains" true and literal requires checking the literal object with
".equals".
> 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)