Package org.apache.clerezza.rdf.core.test

Examples of org.apache.clerezza.rdf.core.test.RandomMGraph


    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));
View Full Code Here

TOP

Related Classes of org.apache.clerezza.rdf.core.test.RandomMGraph

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.