Search code examples
neo4jneomodel

How does the neo4j browser draw the object relationships?


When I run a query such as match (n) return n all of the nodes are returned, however, the relationships and how the nodes are connected does not appear to be in the response data. However, the graph manages to draw the full data model with relationships.

What is the browser doing to gather together this information, or am I missing how this can be obtained from the response data?

I have been using neomodel to query the data, however the inflate method walks the structure and returns too slowly. I would like to achieve a similar response without the need to walk the entire structure and was wondering what the recommended approach was?


Solution

  • [EDITED]

    The neo4j browser has an "autoComplete" setting (labelled "Connect result nodes" in the latest version) that enables/disables querying for the relationships between the nodes in every result set. (Click on the gear icon in the leftmost panel of the browser to see the settings.)

    In other words, the neo4j browser has to perform extra queries to get those relationships -- they are not returned for free when a query just asks for nodes.

    If you are curious how autoComplete is implemented, here is a link to some of the actual code.