Assert.assertEquals(1, g.size());
}
@Test
public void testGetSubjectAndObjectNodes() {
RandomMGraph graph = new RandomMGraph(500, 20, new SimpleMGraph());
for (int j = 0; j < 200; j++) {
Triple randomTriple = graph.getRandomTriple();
GraphNode node = new GraphNode(randomTriple.getSubject(), graph);
Iterator<UriRef> properties = node.getProperties();
while (properties.hasNext()) {
UriRef property = properties.next();
Set<Resource> objects = createSet(node.getObjects(property));
Iterator<GraphNode> objectNodes = node.getObjectNodes(property);
while (objectNodes.hasNext()) {
GraphNode graphNode = objectNodes.next();
Assert.assertTrue(objects.contains(graphNode.getNode()));
}
}
}
for (int j = 0; j < 200; j++) {
Triple randomTriple = graph.getRandomTriple();
GraphNode node = new GraphNode(randomTriple.getObject(), graph);
Iterator<UriRef> properties = node.getProperties();
while (properties.hasNext()) {
UriRef property = properties.next();
Set<Resource> subjects = createSet(node.getSubjects(property));