amine
amine

Reputation: 191

Interactive Querying of Neo4j extracted subgraph

I need to extract a subgraph (a subset of nodes and edges) based on a user defined conditions such as attributes values and labels. This is already feasible using either a query language such as cypher or gremlin, or simply coded using a java methods.

However, since I'm dealing with large graphs, I wish to keep the extracted subgraph for further querying, and even iterate the subextraction-querying process.

I've seen these discussions : Extract subgraph in neo4j , Extracting subgraph from neo4j database. However, I couldn't figure out the answer for my case.

I was thinking of some alternatives :

  1. Building a new index each time I need to extract a subgraph
  2. Use a cache to store the nodes/edges which might be useful for arithmetic computation such as average etc.
  3. Create a new instance of embedded ne4j, however this is really costly !

Another point, is getByID cheaper than index lookup. I know this depends on the case: large graphs or small index ...

Upvotes: 0

Views: 392

Answers (1)

Peter Neubauer
Peter Neubauer

Reputation: 6331

You could just create a new neo4j java embedded database to hold your results and query further? No need to boot up another server IMHO.

Also, getByID is generally cheaper than index lookup, since you avoid the index roundtrip. Index lookups are great for more complax lookups like text matching etc.

Upvotes: 0

Related Questions