Created
December 7, 2011 23:02
-
-
Save okram/1445183 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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