0

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 ...

Community
  • 1
  • 1
amine
  • 181
  • 1
  • 2
  • 9

1 Answers1

0

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.

Peter Neubauer
  • 6,311
  • 1
  • 21
  • 24
  • Sorry, I've not mentioned that I'm already creating the graph using embedded db. I'm not using REST, the application first do ETL then, interactive querying of the created db. Do you think that creating a new embedded db for each subgraph extraction is the best option. – amine Apr 26 '13 at 08:36