Package com.hp.hpl.jena.gvs

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


    store.assertGraph(authorizationSource, new FCAGraphImpl(authorizationModel));
   
    Set<Source> sources = new HashSet<Source>();
    sources.add(authenticationSource);
    sources.add(authorizationSource);
    GraphOverTime configGOT = store.getGraphOverTime(sources );
    //JenaUtil.getModelFromGraph(configGOT.getGraph(new Date())).write(System.out);
    Configuration.setConfiguration(new GVSConfiguration(configGOT,
        "gvs"));
    Policy.setPolicy(new DefaultPolicy(configGOT));
  }
View Full Code Here


    if (trustedSources.contains(identity)) {
      Set<Source> newTrustedSources = new HashSet<Source>(trustedSources);
      newTrustedSources.add(identity);
      trustedSources = newTrustedSources;
    }
    GraphOverTime trustedGOT = store.getGraphOverTime(trustedSources);
    Configuration.setConfiguration(new GVSConfiguration(trustedGOT,
        "GVS-Auth"));
    Policy.setPolicy(new DefaultPolicy(trustedGOT));
    Map<String, Handler> prefixHandlerMap = new HashMap<String, Handler>();
    Enumeration<URL> basePathURLEnum = GVSServerLauncher.class
View Full Code Here

   *
   */
  private static void action(SortedSet<Assertion> assertions) {
    Store store = new MemoryStoreImpl();
    CannedDataReader.addToStrore(store, assertions);
    GraphOverTime got = store.getGraphOverTime(Collections
        .singleton((Source) new SourceImpl(baseURLString + "danbri")));
    got.getGraph(new Date());
  }
View Full Code Here

    //ToyClock clock = new ToyClock();
    Store store = getStoreImpl(null);
    String baseURLString = "http://localhost/";
    CannedDataReader.readCannedData(store, new File("testdata"),
        baseURLString);
    GraphOverTime got = store.getGraphOverTime(Collections
        .singleton((Source) new SourceImpl(baseURLString + "danbri")));
    // one milli after last modification
    Iterator<Date> followingChanges = got.followingChanges(dateFormat
        .parse("19980920123559999"));
    // should get last modification
    assertEquals(dateFormat.parse("19980920123600000"), followingChanges
        .next());
    // eralier one
View Full Code Here

    //ToyClock clock = new ToyClock();
    Store store = getStoreImpl(new ToyClock());
    String baseURLString = "http://localhost/";
    CannedDataReader.readCannedData(store, new File("testdata"),
        baseURLString);
    GraphOverTime got = store.getGraphOverTime(Collections
        .singleton((Source) new SourceImpl(baseURLString + "danbri")));
    // one milli after last modification
    Iterator<Date> followingChanges = got.followingChanges(dateFormat
        .parse("19980920123600000"));
    Date nextDate = followingChanges.next();
    assertEquals(dateFormat.parse("20060920123618661"), nextDate);
  }
View Full Code Here

    //ToyClock clock = new ToyClock();
    Store store = getStoreImpl(new ToyClock());
    String baseURLString = "http://localhost/";
    CannedDataReader.readCannedData(store, new File("testdata"),
        baseURLString);
    GraphOverTime got = store.getGraphOverTime(Collections
        .singleton((Source) new SourceImpl(baseURLString + "danbri")));
    //filter by a resource present only in the older version
    got = got.filter(Collections.singleton((GroundedNode)new NamedNodeImpl("mailto:danbri@porklips.org")));
    // one milli after last modification
    Iterator<Date> followingChanges = got.followingChanges(dateFormat
        .parse("19980920123600000"));
    assertFalse(followingChanges.hasNext());
    Iterator<Date> previousChanges = got.previousChanges(dateFormat
        .parse("19980920123600000"));
    assertTrue(previousChanges.hasNext());
  }
View Full Code Here

    Source source = new SourceImpl("http://example.org/graph-source");
    clock.setTime(date1);
    store.updateGraph(source, graph);
    clock.setTime(date2);
    store.updateGraph(source, graph);;
    GraphOverTime got = store.getGraphOverTime(Collections
        .singleton(source));
    Iterator<Date> followingChanges = got.followingChanges(dateFormat
        .parse("20060101"));
    assertFalse(followingChanges.hasNext());
  }
View Full Code Here

   * @param cannedVersionDate
   * @return
   */
  private boolean isDefaultConfigLoadingNeeded(Store store,
      Date cannedVersionDate) {
    GraphOverTime configOverTime = store.getGraphOverTime(Collections
        .singleton(defaultConfigSource));
    Iterator<Date> followingChanges = configOverTime
        .followingChanges(new Date(cannedVersionDate.getTime() - 1));
    return !followingChanges.hasNext();
  }
View Full Code Here

  }
 
  public void testAuthorizedPut() throws Exception {
    //testing
    GraphOverTime trustedGOT = new MemoryStoreImpl().getGraphOverTime(new HashSet<Source>());
    Policy orig = Policy.getPolicy();
    Policy.setPolicy(new DefaultPolicy(trustedGOT));
    //Policy.setPolicy(orig);
    Policy.setPolicy(null);
    Policy.setPolicy(new NoRestrictionsPolicy());
View Full Code Here

    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    String baseURLString = "http://localhost/";
    CannedDataReader.readCannedData(store, new File("testdata"),
        baseURLString);
    GraphOverTime got = store.getGraphOverTime(Collections
        .singleton((Source) new SourceImpl(baseURLString + "danbri")));
    // one milli after last modification
    Iterator<Date> previousChanges = got.previousChanges(dateFormat
        .parse("20060920123618662"));
    // should get last modification
    assertEquals(dateFormat.parse("20060920123618661"), previousChanges
        .next());
    // eralier one
View Full Code Here

TOP

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

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.