JasonG
JasonG

Reputation: 5962

TinkerPop Blueprints and Frames - How to treat data as collections

I found this question How to store and retrieve different types of Vertices with the Tinkerpop/Blueprints graph API?

But it's not a clear answer for me.

How do I query the 10 most recent articles vs the 10 most recently registered users for an api for instance? Put graphing aside for a moment as this stack must be able to handle both a collection/document paradigm as well as a graphing paradigm (relations between elements of these TYPES of collections). I've read everything including source and am getting closer but not quite there.

Closest document I've read is the multitenant article here: http://architects.dzone.com/articles/multitenant-graph-applications

But it focuses on using gremlin for graph segregation and querying which I'm hoping to avoid until I require analysis on the graphs.

I'm considering using cassandr/hadoop at this point with a reference to the graph id but I can see this biting me down the road.

Upvotes: 1

Views: 1173

Answers (2)

Sridhar Ramachandran
Sridhar Ramachandran

Reputation: 187

Indexes in Tinkerpop/Blueprints only support simple lookups based on exact matches of property keys.

If you want to find the 10 most recent articles, or articles with the phrase 'Foo Bar', you may have to maintain an external index using Lucene or Elastic Search. These technologies use inverted indexes which support term/phrase lookups, range queries, and wildcard searches, etc. You can store the vertex.getId() as the field in the indexed document to link back to the vertex in the graph database.

I have implemented something like this for my application which uses a Blueprints database (Bitsy) and a fancy index (Lucene). I have documented the high-level design to (a) keep the fancy index up-to-date using batch updates every few seconds and (b) ensure transactional consistency across the graph database and the fancy index. Hope this helps.

Upvotes: 1

JasonG
JasonG

Reputation: 5962

Answering my own question to this - The answer is indices.

https://github.com/tinkerpop/blueprints/wiki/Graph-Indices

Upvotes: 0

Related Questions