Skip to content
stephen mallette edited this page Feb 2, 2016 · 105 revisions

IMPORTANT – TinkerPop is now a part of the Apache Software Foundation and TinkerPop 3.x is the latest incarnation of The TinkerPop. This project is TinkerPop 2.x and is no longer active.

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.6.02.5.02.4.02.3.12.3.02.2.02.1.02.0.00.70.60.50.40.30.20.1
Frames WikiDoc: 2.6.02.5.02.4.02.3.12.3.02.2.02.1.02.0.0

<dependency>
  <groupId>com.tinkerpop</groupId>
  <artifactId>frames</artifactId>
  <version>2.5.0</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) Factories should be reused for performance and memory conservation.

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.