-
Notifications
You must be signed in to change notification settings - Fork 38
Creating Frames
okram edited this page May 15, 2012
·
11 revisions
When you develop a Frames-annotation Java interface, you provide it “life” by binding it to the underlying Blueprints graph. To make this binding, the FramesManager
is used. In FramesManager
there a collection of helpful methods which are articulate using the toy graph diagrammed below and the example Java code.
Graph graph = ... // get a reference to the graph
FramesManager manager = new FramesManager(graph); // create a manager for the graph
Person marko = manager.frame(graph.getVertex(1), Person.class);
Person peter = manager.frameVertex(6, Person.class);
Iterable<Project> javaProjects = manager.frameVertices(graph.getVertices("lang","java"), Project.class);
Knows markoKnowsVadas = manager.frame(graph.getEdge(7), Direction.OUT, Knows.class);
Knows markoKnowsJosh = manager.frameEdge(8, Direction.OUT, Knows.class);