Question

Currently I use methods specific to the Titan like

TitanType name = graph.getType("name"); 

and

graph.makeKey("name").dataType(String.class).indexed(Vertex.class)

How can I replace this code with methods from Blueprints so it would work for non-Titan graph databases?

This post claims that it's not possible to translate createKeyIndex into makeKey? If not, what is the solution here?

Was it helpful?

Solution

If you are writing code that will work for any Blueprints-enabled graph, then you are a bit stuck in this regard. The variety of options when it comes to indexing available to Titan, Neo4j, OrientDB, etc. are too vast to generalize behind Blueprints. Blueprints only has the notion of key indices as a generalized approach, but that approach is generally not good enough for Titan users and they must drop down to the Titan API.

Your best option for this situation is to work with createKeyIndex and when not possible drop down for what you need done, drop down to the API of the underlying graph instance. That's a common practice and going forward to TinkerPop3 will be the only way to create an index and types.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top