-
Notifications
You must be signed in to change notification settings - Fork 38
Creating Frames
Bryn Cooke edited this page Jun 10, 2013
·
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 FramedGraph
is used. In FramedGraph
there are a collection of helpful methods which are demonstrated using the toy graph diagrammed below and the example Java code.
Graph graph = ... // get a reference to the graph
FramedGraph<Graph> framedGraph = new FramedGraphFactory.create(graph); // wrap the base graph
Person marko = framedGraph.getVertex(1, Person.class);
Person peter = framedGraph.getVertex(6, Person.class);
Iterable<Project> javaProjects = framedGraph.getVertices("lang","java", Project.class);
Knows markoKnowsVadas = framedGraph.getEdge(7, Direction.OUT, Knows.class);
Knows markoKnowsJosh = framedGraph.getEdge(8, Direction.OUT, Knows.class);