-
Notifications
You must be signed in to change notification settings - Fork 38
Home
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.0 – 2.5.0 – 2.4.0 – 2.3.1 – 2.3.0 – 2.2.0 – 2.1.0 – 2.0.0 – 0.7 – 0.6 – 0.5 – 0.4 – 0.3 – 0.2 – 0.1
Frames WikiDoc: 2.6.0 – 2.5.0 – 2.4.0 – 2.3.1 – 2.3.0 – 2.2.0 – 2.1.0 – 2.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.