Package org.wymiwyg.rdf.graphs

Examples of org.wymiwyg.rdf.graphs.Graph


  @Test
  public void testFile15() {
    JenaParameters.disableBNodeUIDGeneration = true;
    for (int i = 0; i < 50; i++) {
      log.debug("round " + i);
      Graph g = getGraphFromResource("test15.rdf");
      // System.out.println("Graph with " + g.size() + " triples");
      // JenaUtil.getModelFromGraph(g).write(System.out, "N-TRIPLE");
      Graph gLeanified = makeLean(g);
      // System.out.println("Graph with " + gLeanified.size() + "
      // triples");
      // JenaUtil.getModelFromGraph(gLeanified)
      // .write(System.out, "N-TRIPLE");
      Graph doubleLeanifiedGraph = makeLean(gLeanified);
      boolean equals = gLeanified.equals(doubleLeanifiedGraph);
      assertTrue(equals);
    }
  }
View Full Code Here


  }
  @Test
  public void testFile3Alt() {
    JenaParameters.disableBNodeUIDGeneration = true;
    for (int i = 0; i < 1; i++) {
      Graph g = getGraphFromResource("test3-m1-alt.rdf");
      Graph gLean = getGraphFromResource("test3-m1-lean.rdf");
      Graph gLeanified = makeLean(g);
      // JenaUtil.getModelFromGraph(gLeanified).write(System.out, "N3");
      assertEquals(gLeanified, gLean);
    }
  }
View Full Code Here

      assertEquals(gLeanified, gLean);
    }
  }
  @Test
  public void testDec() throws IOException {
    Graph prob1Graph = getGraphFromResource("prob1.rdf");
    ReferenceGroundedDecomposition dec = new ReferenceGroundedDecompositionImpl(
        prob1Graph);
    // JenaUtil.getModelFromGraph(prob1Graph).write(System.out);
    // ReferenceGroundedUtil.print(dec, new PrintWriter(System.out));
    Graph prob1GraphRec = ReferenceGroundedUtil.reconstructGraph(dec);
    /*
     * for (FunctionallyGroundedNode fgNode :
     * dec.getFunctionallyGroundedNodes()) { for (NonTerminalMolecule
     * ntMolecule : fgNode.getGroundingMolecules()) {
     * System.out.println("Non-Terminal Molecule");
     * JenaUtil.getModelFromGraph(ntMolecule).write(System.out); } }
     */
    // JenaUtil.getModelFromGraph(prob1GraphRec).write(System.out);
    ReferenceGroundedDecomposition recDec = new ReferenceGroundedDecompositionImpl(
        prob1GraphRec);
    // ReferenceGroundedUtil.print(recDec, new PrintWriter(System.out));
    Graph recDecRec2 = new NaturalizedGraph(ReferenceGroundedUtil
        .reconstructGraph(recDec));
    Graph recDecRec = new NaturalizedGraph(new SimpleGraph(), recDec
        .getFunctionallyGroundedNodes());
    // System.out.println(recDecRec2.equals(recDecRec));
    // JenaUtil.getModelFromGraph(recDecRec).write(System.out);
    Graph recDecRecLean = MoleculeBasedLeanifier
        .getLeanVersionOf(recDecRec);
    // JenaUtil.getModelFromGraph(recDecRecLean).write(System.out);
  }
View Full Code Here

  }

  @Test
  public void testProb1() throws IOException {
    for (int i = 0; i < 5; i++) {
      Graph prob1Graph = getGraphFromResource("prob1.rdf");
      ReferenceGroundedDecomposition dec = new ReferenceGroundedDecompositionImpl(
          prob1Graph);
      // JenaUtil.getModelFromGraph(prob1Graph).write(System.out);
      // ReferenceGroundedUtil.print(dec, new PrintWriter(System.out));
      Graph prob1GraphRec = ReferenceGroundedUtil.reconstructGraph(dec);
      // JenaUtil.getModelFromGraph(prob1GraphRec).write(System.out);

      Graph leanifiedGraph = makeLean(prob1Graph);
      dec = new ReferenceGroundedDecompositionImpl(leanifiedGraph);
      // ReferenceGroundedUtil.print(dec, new PrintWriter(System.out));
      Graph doubleLeanifiedGraph = makeLean(leanifiedGraph);
      dec = new ReferenceGroundedDecompositionImpl(doubleLeanifiedGraph);
      // ReferenceGroundedUtil.print(dec, new PrintWriter(System.out));
      boolean equals = leanifiedGraph.equals(doubleLeanifiedGraph);
      if (!equals) {
        JenaUtil.getModelFromGraph(leanifiedGraph).write(System.out);
View Full Code Here

  }
 
  @Test
  public void testConsistencyRandom() {
    Model randomModel = null;
    Graph randomGraph;
    try {
      for (int i = 0; i < 5; i++) {
        randomModel = ModelCreationUtil.createRandomModel((int) (Math
            .random() * 200));
        randomGraph = JenaUtil.getGraphFromModel(randomModel, true);
        Graph leanifiedGraph = makeLean(randomGraph);
        Graph doubleLeanifiedGraph = makeLean(leanifiedGraph);
        boolean equals = leanifiedGraph.equals(doubleLeanifiedGraph);
        if (!equals) {
          randomModel.write(System.out);
        }
        assertTrue(equals);
View Full Code Here

TOP

Related Classes of org.wymiwyg.rdf.graphs.Graph

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.