/** * Are the two models isomorphic? * The isomorphism is defined as a bijection between the anonymous * variables such that the statements are identical. * This is * described in * <a href="http://www.w3.org/TR/rdf-concepts#section-Graph-syntax"> * http://www.w3.org/TR/rdf-concepts#section-Graph-syntax * </a> */ static public boolean equals(Graph m1,Graph m2) { if ( m1 == m2 ) return true; return match(m1,m2) != null; }
/** * Return an isomorphism between the two models. * This function is nondeterministic in that it may return a * different bijection on each call, in cases where there are * multiple isomorphisms between the models. * @return <code>null</code> on failure or an array of related pairs (arrays of length 2) of anonymous nodes. <code>match(m1,m2)[i][0]</code> is from <code>m1</code>, and <code>match(m1,m2)[i][1]</code> is the corresponding node in <code>m2</code>. */ static public Node[][] match(Graph m1,Graph m2) { return new GraphMatcher(m1).match(new GraphMatcher(m2)); } /* NOTE: inner classes