Provides the interface and default implementation of graph isomorphism (matching for equality)..
match
Package ContainsThe following example, from the test suite, uses the simple grounded graph matcher to compare the two graphs it constructs.
IGraphMatcher matcher = new GroundedGraphMatcher(); Graph graphOne = new Graph(); graphOne.add(new Statement(new URINode(subject), new URINode(new URI(TestUtils.URI_PROP + "name")), new LiteralNode("Simon"))); graphOne.add(new Statement(new URINode(subject), new URINode(new URI(TestUtils.URI_PROP + "age")), new LiteralNode(new Long(38)))); graphOne.add(new Statement(new URINode(subject), new URINode(new URI(TestUtils.URI_PROP + "project")), new LiteralNode("Jazz Foundation"))); graphOne.add(new Statement(new URINode(subject), new URINode(new URI(TestUtils.URI_PROP + "stated")), new LiteralNode(new Date(2007,9,21)))); Graph graphTwo = new Graph(); graphTwo.add(new Statement(new URINode(subject), new URINode(new URI(TestUtils.URI_PROP + "name")), new LiteralNode("Simon"))); graphTwo.add(new Statement(new URINode(subject), new URINode(new URI(TestUtils.URI_PROP + "age")), new LiteralNode(new Long(38)))); graphTwo.add(new Statement(new URINode(subject), new URINode(new URI(TestUtils.URI_PROP + "project")), new LiteralNode("Jazz Foundation"))); graphTwo.add(new Statement(new URINode(subject), new URINode(new URI(TestUtils.URI_PROP + "stated")), new LiteralNode(new Date(2007,9,21)))); Assert.assertTrue(matcher.isIsomorphic(graphOne, graphTwo));
@since 0.1