Question

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.

Était-ce utile?

La solution 2

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

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

Autres conseils

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top