Package org.wymiwyg.rdf.molecules.functref.impl

Examples of org.wymiwyg.rdf.molecules.functref.impl.ReferenceGroundedDecompositionImpl


  private static boolean useDefaultOntology = true;

  public static MoleculeDiff getDiff(Model m1, Model m2) {
    return new MoleculeDiffImpl(
        (new ReferenceGroundedDecompositionImpl(
            new AnonymizedGraph(JenaUtil
                .getGraphFromModel(m1, ontology,
                    useDefaultOntology)))),
        (new ReferenceGroundedDecompositionImpl(
            new AnonymizedGraph(JenaUtil
                .getGraphFromModel(m2, ontology,
                    useDefaultOntology)))));
  }
View Full Code Here


                .getGraphFromModel(m2, ontology,
                    useDefaultOntology)))));
  }

  public static Model patch(Model m, MoleculeDiff diff) {
    ReferenceGroundedDecomposition resultDec = diff.patch(new ReferenceGroundedDecompositionImpl(
            new AnonymizedGraph(JenaUtil
                .getGraphFromModel(m, ontology,
                    useDefaultOntology))));
    return JenaUtil.getModelFromGraph(new DeAnonymizedGraph(ReferenceGroundedUtil.reconstructGraph(resultDec)));
  }
View Full Code Here

          System.out.println("same again");
        } else {
          System.out.println("different graph");
        }
      }
      ReferenceGroundedDecomposition dec = new ReferenceGroundedDecompositionImpl(
          g);
      Graph gRec = ReferenceGroundedUtil.reconstructGraph(dec);
      assertTrue("same opinion", g.equals(gRec) == JenaUtil
          .getModelFromGraph(g).isIsomorphicWith(
              JenaUtil.getModelFromGraph(gRec)));
View Full Code Here

    }
  }
  @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);
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);
        JenaUtil.getModelFromGraph(doubleLeanifiedGraph).write(
View Full Code Here

TOP

Related Classes of org.wymiwyg.rdf.molecules.functref.impl.ReferenceGroundedDecompositionImpl

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.