Skip to content

Instantly share code, notes, and snippets.

@okram
Created December 7, 2011 23:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save okram/1445183 to your computer and use it in GitHub Desktop.
Save okram/1445183 to your computer and use it in GitHub Desktop.
AuditGraph graph = new AuditGraph(new Neo4jGraph("/tmp/hmp")); // realize that you can do the graph stacking as in: new SchemaGraph(new AuditGraph(new Neo4jGraph("/tmp/hmp"))
graph.setUser("bim"); // this name is recorded with a representation (i.e. who created this representation?)
graph.inThePresentMoment(true); // our perspective is startTime:System.currentTimeMillis() and endTime:startTime+1
Vertex marko = graph.addVertex(null);
Vertex sumit = graph.addVertex(null);
graph.addEdge(null, marko, sumit, "knows");
assertTrue(count(graph.getVertices()) == 2)
graph.inThePresentMoment(false);
graph.setTimeWindow(0l, 10l); // we are now looking at the state of the graph in the 1970s (0-10 milliseconds)
assertTrue(count(graph.getVertices()) == 0)
// If you are not in the present moment (graph.inThePresentMoment(false)),
// then you need to provide a timeframe for graph reads.
// As it stands, all mutations are with respects to the present moment.
// Time windows are only for reading the past.
// "What did the graph look like during some past window of time?"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment