neo4j / neo4j-browser

Neo4j Browser is the general purpose user interface for working with Neo4j. Query, visualize, administrate and monitor the database.
https://neo4j.com
GNU General Public License v3.0
671 stars 345 forks source link

Incorrect Query Graph Visualization #1967

Closed reedwoodruff closed 3 months ago

reedwoodruff commented 3 months ago

Description

There is an issue when executing Cypher queries which attempt to filter out particular edges. When you have two edges between the nodes and attempt to filter one of them out, both edges are still returned. This issue is only on desktop Neo4j Browser version: 5.15.0. It does not occur in the Aura interface. The issue is only in the "Graph" view -- the "Table" view returns the correct results.

Reproduce Steps

First create the setup:

CREATE (n1:Word)
CREATE (n2:Word)
CREATE(n2)-[:Previous]->(n1)
CREATE(n1)-[:Next]->(n2)

Next run the query:

MATCH (a)-[b]-(c)
WHERE NOT(b:Previous)
RETURN a, b, c

Expected Behavior

Expected behavior is for only the "Next" relationship to appear in the graph visualization of the query results.

Current Behavior

Both the "Next" and the "Previous" relationship are visible in the graph view. (Again, this works as expected in the Aura environment and the Bloom environment) image

Your Environment

Neo4j Browser version: 5.15.0

Neo4j Server version: 5.19.0 (enterprise)

Neo4j Browser Changelog

Build number: 172 Build hash: 382b72525e2d9b64d0 Build date: 12/8/2023

software name version
OS Ubuntu
Web browser N/A
node.js
npm
yarn
Neo4j Browser 5.15.0
Neo4j 5.19.0
OskarDamkjaer commented 3 months ago

Hi! You've likely got the Connect result nodes setting turned on It'll fill in missing relationships in the visualisation, it's most notable when you do MATCH (n) RETURN n <-- you get a graph even though you only returned nodes. It's a confusing feature, which is why we've removed it in aura

reedwoodruff commented 3 months ago

Ah, you're right! Thank you for your help. Changing the setting produces the expected behavior.

OskarDamkjaer commented 3 months ago

happy to help!