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

[jira] [Created] (JENA-1789) IsoMatcher can return "true" for non-isomorphic patterns.

Andy Seaborne created JENA-1789:
-----------------------------------

             Summary: IsoMatcher can return "true" for non-isomorphic patterns.
                 Key: JENA-1789
                 URL: https://issues.apache.org/jira/browse/JENA-1789
             Project: Apache Jena
          Issue Type: Bug
    Affects Versions: Jena 3.13.1
            Reporter: Andy Seaborne
            Assignee: Andy Seaborne


This should be false but it returns true:
{noformat}
    public static void main(String[] args) {
        Graph graph1 = SSE.parseGraph("(graph (?A :p1 ?B) (?B :p2 ?A))");
        Graph graph2 = SSE.parseGraph("(graph (?A :p1 ?B) (?A :p2 ?B))");
        IsoMatcher match = new IsoMatcher(tuplesTriples(graph1.find()), tuplesTriples(graph2.find()),
                                          new BNodeIsoWithVar(NodeUtils.sameValue));
        boolean b = match.match();
        System.out.println();
        System.out.println("IsoMatcher: "+b);
    }
{noformat}

BNodeIsoWithVar has the lines:
{noformat}
            if ( n1.isVariable() && n2.isVariable() )
                return mapping.makeIsomorphic(n1, n2) ;
{noformat}
added.

The bnode for variables case also fails.
{noformat}
        graph1 = SSE.parseGraph("(graph (<_:a> :p1 <_:b>) (<_:b> :p2 <_:a>))");
        graph2 = SSE.parseGraph("(graph (<_:a> :p1 <_:b>) (<_:a> :p2 <_:b>))");
{noformat}




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