Querying in-memory graphs using Cypher

Hi,

I am trying to create an in-memory graph for later processing. I started by the following query:

CALL apoc.graph.fromCypher(
'Match (p1:Person)-[r1:ACTED_IN]-(m1:Movie) where .... return * LIMIT 1000',
{},
'MyVirtualGraph',
{}
)
YIELD graph AS g
RETURN g;

Now, the virtual graph is successefully created and visualized, but I don't find out how to execute Cypher queries just over it and not over the whole database.

If this is not possible to do under Neo4j browser, is there a possibility to create and to query the virtual graph with a Java program ?

Please help !

1 Like

From what I read in the documentation, that does not seem possible. My interpretation is these are virtual graphs created for the purpose of visualization. It allows you to project your graph data to a representation that enhances visualization.

what are you trying to do? Was you goal to improve query performance or something else?

1 Like

Yeah I read almost all the documentation related to graphs creation in Neo4j and I figure out that this is not possible.

Since I am dealing with a very large data graph, I am trying to tranform the results of a cypher query into a graph "just like a view" and I need later to query this graph with other cypher queries. If this is not possible under Neo4J, is there an external API that allows to create such graph and to query it ?

I found that there were some method "apoc.graph.execute" that realises what I need but this method is no longer available (it was under Neo4j 3.???).