Package com.hp.hpl.jena.gvs

Examples of com.hp.hpl.jena.gvs.FCAGraph


    clock.setTime(new W3CDateFormat()
    .parse("2006-05-02T02:16:00Z"));
    store.updateGraph(source, graphs[2]);
    Set<Source> sourceSet = new HashSet<Source>();
    sourceSet.add(source);
    FCAGraph retrievedGraph = store.getGraphOverTime(sourceSet).getGraph(
        new W3CDateFormat().parse("2006-05-01T16:31:00Z"));
    assertEquals(graphs[0], retrievedGraph);
    retrievedGraph = store.getGraphOverTime(sourceSet).getGraph(
        new W3CDateFormat().parse("2006-05-01T16:32:00Z"));
    assertEquals(graphs[1], retrievedGraph);
View Full Code Here


    Date date2 = new W3CDateFormat().parse("2006-05-01T16:32:00Z");
    clock.setTime(date2);
    store.updateGraph(source, graphs[1]);
    Set<Source> sourceSet = new HashSet<Source>();
    sourceSet.add(source);
    FCAGraph retrievedGraph = store.getGraphOverTime(sourceSet).getGraph(
        new W3CDateFormat().parse("2006-05-01T16:30:00Z"));
    assertEquals(graphs[0], retrievedGraph);
    retrievedGraph = store.getGraphOverTime(sourceSet).getGraph(date2);
    assertEquals(graphs[1], retrievedGraph);
  }
View Full Code Here

    // "N-TRIPLE");
    // m2.read(MinimumFailingGraphDetector.class.getResource("test14-2.nt").toString(),
    // "N-TRIPLE");
    m0 = LeanDiffPatch.leanify(m0);
    m1 = LeanDiffPatch.leanify(m1);
    FCAGraph g1 = new FCAGraphImpl(new JenaModelGraph(m0, true));
    // FCAGraph g2 = new JenaModelGraph(m1, true);
    FCAGraph[] graphs = new FCAGraph[2];
    graphs[0] = getGraphFromResource("test4-m0.rdf");
    graphs[1] = getGraphFromResource("test4-m1.rdf");
    // GraphLeanifier.makeLean(graphs[0]);
View Full Code Here

  public void testFromFiles6() throws Exception {
    for (int i = 0; i < 10; i++) {
      FCAGraph[] graphs = new FCAGraph[2];
      graphs[0] = getGraphFromResource("test6-m0.rdf");
      graphs[1] = getGraphFromResource("test6-m1.rdf");
      FCAGraph instead = getGraphFromResource("test6-instead-of-m1.rdf");
      assertEquals(instead, graphs[1]);
      performTestsWithGraphs(graphs);
    }
  }
View Full Code Here

  public void testFromFiles9() throws Exception {
    FCAGraph[] graphs = new FCAGraph[2];
    for (int i = 0; i < 10; i++) {
      graphs[0] = getGraphFromResource("test9-m0.rdf");
      graphs[1] = getGraphFromResource("test9-m1.rdf");
      FCAGraph wrongResult = getGraphFromResource("test9-m1-got.rdf");
      assertEquals(graphs[1], wrongResult);
      performTestsWithGraphs(graphs);
    }
  }
View Full Code Here

  public void testFromFiles10io() throws Exception {
    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    Source source = new SourceImpl("http://example.org/graph-source");
    FCAGraph orig = getGraphFromResource("test10-m0.rdf");
    clock.setTime(new Date());
    store.assertGraph(source, orig);
    FCAGraph retrived = store.getGraphOverTime(Collections.singleton(source))
        .getGraph(new Date());
    assertEquals(orig, retrived);
  }
View Full Code Here

  public void testFromFiles13() throws Exception {
    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    Source source = new SourceImpl("http://example.org/graph-source");
    FCAGraph orig = getGraphFromResource("test13.rdf");
    clock.setTime(new Date());
    store.assertGraph(source, orig);
    FCAGraph retrived = store.getGraphOverTime(Collections.singleton(source))
        .getGraph(new Date());
    assertEquals(orig, retrived);
  }
View Full Code Here

  public void testFromFiles14() throws Exception {
    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    Source source = new SourceImpl("http://example.org/graph-source");
    FCAGraph orig = getGraphFromResource("test14.rdf");
    clock.setTime(new Date());
    store.assertGraph(source, orig);
    FCAGraph retrived = store.getGraphOverTime(Collections.singleton(source))
        .getGraph(new Date());
    assertEquals(orig, retrived);
  }
View Full Code Here

  }

  public void testRepeated() throws Exception {
    JenaParameters.disableBNodeUIDGeneration = true;
    FCAGraph previousGraph = null;
    FCAGraph previousUnleanifiedGraph = null;
    // Model previousModel = null;

    for (int i = 0; i < 10; i++) {
      System.out.println("testing round " + i);
      Model model = ModelFactory.createDefaultModel();
      model.read(StoreTest.class.getResource("TestLeanError.rdf")
          .toString());

      FCAGraph unleanifiedGraph = new FCAGraphImpl(model);

      FCAGraph graph = new FCAGraphImpl(MoleculeBasedLeanifier
          .getLeanVersionOf(unleanifiedGraph));

      // FCAGraph graph = getGraphFromResource("test4-m0.rdf");
      if (previousGraph != null) {
        if (!graph.equals(previousGraph)) {
          System.out.println("Here we are!");
          System.out
              .println("Unleanified equals: "
                  + unleanifiedGraph
                      .equals(previousUnleanifiedGraph));
          System.out.println("current:" + graph.size());
          JenaUtil.getModelFromGraph(graph).write(System.out);
          System.out.println("previous:" + previousGraph.size());
          JenaUtil.getModelFromGraph(previousGraph).write(System.out);
          /*
           * PrintWriter pout = new PrintWriter(System.out); new
View Full Code Here

    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    Model model = modelWithStatements("_a dc:subject 'hello'; _a http://xmlns.com/foaf/0.1/mbox 'm'; _a http://xmlns.com/foaf/0.1/mbox 'n'");
    Date date1 = dateFormat.parse("20050607");
    Date date2 = dateFormat.parse("20060912");
    FCAGraph graph = new FCAGraphImpl(model);
    Source source = new SourceImpl("http://example.org/graph-source");
    clock.setTime(date1);
    store.updateGraph(source, graph);
    clock.setTime(date2);
    store.updateGraph(source, graph);;
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.gvs.FCAGraph

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.