org.jrdf.graph.operation
Interface Comparison

All Known Implementing Classes:
ComparisonImpl

public interface Comparison

Provides the ability to compare two graph with one another.

Version:
$Revision: 1804 $
Author:
Andrew Newman

Method Summary
 boolean areIsomorphic(Graph g1, Graph g2)
          Return true if both graphs are equivalent (isomorphic) to one another.
 boolean groundedGraphsAreEqual(Graph g1, Graph g2)
          Return true if both graphs are equivalent (isomophic) to one another.
 boolean isGrounded(Graph g)
          Returns true if the graph is grounded (does not contain blank nodes).
 

Method Detail

isGrounded

boolean isGrounded(Graph g)
                   throws GraphException
Returns true if the graph is grounded (does not contain blank nodes).

Parameters:
g - the graph to test.
Returns:
true if the graph is grounded (does not contain blank nodes).
Throws:
GraphException

areIsomorphic

boolean areIsomorphic(Graph g1,
                      Graph g2)
                      throws GraphException
Return true if both graphs are equivalent (isomorphic) to one another. That is, that the nodes in one graph map equivalently to nodes in the other. In a non-grounded graph (ones with blank nodes) nodes can map to other nodes with different values but are equivalent. This may inclue: <a>, <b>, <c> is equivalient to _x, <b>, <c>, where _x is a blank node or isomorphism could be limited to just blank nodes (not able to stand in place for URIs or Literals).

Parameters:
g1 - The first graph to test.
g2 - The second graph to test.
Returns:
true if they are equivalent.
Throws:
GraphException

groundedGraphsAreEqual

boolean groundedGraphsAreEqual(Graph g1,
                               Graph g2)
                               throws GraphException
Return true if both graphs are equivalent (isomophic) to one another. These graphs must contain only labelled nodes i.e. no blank nodes.

Parameters:
g1 - The first graph to test.
g2 - The second graph to test.
Returns:
true if they are equivalent.
Throws:
GraphException