Skip to content
Bryn Cooke edited this page Jul 21, 2013 · 105 revisions

Frames exposes any Blueprints graph as a collection of interrelated domain objects. Frames makes heavy use of InvocationHandler, Proxy classes, and Annotations to allow a developer to frame a graph element (vertex or edge) in terms of a particular Java interface. With Frames, its easy to ensure that data within a graph is respective of a schema represented as a collection of annotated Java interfaces.

Please join the Gremlin users group at http://groups.google.com/group/gremlin-users for all TinkerPop related discussions.

Frames JavaDoc: 2.3.12.3.02.2.02.1.02.0.00.70.60.50.40.30.20.1
Frames WikiDoc: 2.3.12.3.02.2.02.1.02.0.0

<dependency>
  <groupId>com.tinkerpop</groupId>
  <artifactId>frames</artifactId>
  <version>2.4.0-SNAPSHOT</version>
</dependency>

Non-Maven users can get the raw release jars from Apache’s Central Repository. Snapshots can be obtained from Sonatype (see Maven Repositories for more information).

Here is an example Frame interface:

public interface Person {
  @Property("name")
  public String getName();

  @Adjacency(label="knows")
  public Iterable<Person> getKnowsPeople();

  @Adjacency(label="knows")
  public void addKnowsPerson(final Person person);

  @GremlinGroovy("it.out('knows').out('knows').dedup") //Make sure you use the GremlinGroovy module! #1
  public Iterable<Person> getFriendsOfAFriend()
}

Now you can use it to interact with the graph:

TinkerGraph graph = TinkerGraphFactory.createTinkerGraph(); //This graph is pre-populated.
FramedGraphFactory factory = new FramedGraphFactory(new GremlinGroovyModule()); //(1)

FramedGraph framedGraph = factory.create(graph); //Frame the graph

Person person = framedGraph.getVertex(1, Person.class);
person.getName(); // equals "marko"

Frames can be used with Rexster through the Rexster Kibbles Frames extension.
Clone this wiki locally