You can't return data from a query that isn't in the graph. What you can do is MATCH
and then CREATE
the new graph that you want, like this:
MATCH (n1:NODE_TYPE)<-[:INTERACTION_NODE]-
(int:INTERACTION)
-[:INTERACTION_NODE]->(n2:NODE_TYPE)
WHERE n1 <> n2
CREATE (n1)-[r:something]->(n2)
RETURN n1, r, n2
Note this has the side-effect that not only was the data returned, it was created and written into your database.
But on the other hand, the data coming back from a RETURN
statement is always going to be tabular when it's printed out by the shell. If you want to visualize the results of a RETURN
as a graph, then you should use the web interface. If you use it, then the RETURN
statement above in my example will actually return a picture of a graph.