Skip to content

The Major Differences Between Blueprints 1.x and 2.x

okram edited this page Jun 7, 2012 · 10 revisions

Blueprints 2 introduced numerous changes to the Blueprints API. This page helps to explain these differences so updating code from Blueprints 1.x to Blueprints 2.x is as easy as possible.

KeyIndexableGraph and the new AutomaticIndices

There is no more notion of AutomaticIndex in Blueprints 2. Many graph databases such as DexGraph, IGGraph, and TitanGraph do not support the notion of arbitrary indexing. Instead, they simply allow an element to be indexed by its key/value property pairs. As such, KeyIndexableGraph provides an interface to this basic indexing functionality. To index a the name key of all vertices, simply do:

graph.createKeyIndex("name", Vertex.class);

Now, when graph.getVertices("name", "stephen") is evaluated, the name index is used. If no such key index was created, then a linear scan of all the vertices in the graph would occur. Thus, be sure to add the appropriate indices to make an n-lookup a log(n)-lookup.

Vertex/Edge API and the Direction Enum

BatchGraph and the Removal of TransactionalGraph Buffers

TransactionalGraph Semantics and ThreadedTransactionalGraph