Excluded Relations being displayed in the Graph UI, but missing in Response

Sample Data:

CREATE (n:Node {node_id : 'node-1'});
CREATE (n:Node {node_id : 'node-2'});
CREATE (n:Node {node_id : 'node-3'});

MATCH (s:Node {node_id: 'node-1'}), (d:Node {node_id: 'node-2'}) CREATE (s)-[:HAS_RELATION {relation_id: 'r1'}]->(d);
MATCH (s:Node {node_id: 'node-1'}), (d:Node {node_id: 'node-2'}) CREATE (s)-[:HAS_RELATION {relation_id: 'r2'}]->(d);

MATCH (s:Node {node_id: 'node-2'}), (d:Node {node_id: 'node-3'}) CREATE (s)-[:HAS_RELATION {relation_id: 'r1'}]->(d);
MATCH (s:Node {node_id: 'node-2'}), (d:Node {node_id: 'node-3'}) CREATE (s)-[:HAS_RELATION {relation_id: 'r2'}]->(d);

Goal

Searching for all the paths with relation_id: r1 (we're not interested in any other relations in the returned path)

Query

MATCH p=(s:Node)-[r:HAS_RELATION*1..10]->(d:Node)
WHERE s.node_id = "node-1" AND ALL (r IN relationships(p) WHERE r.relation_id = 'r1')
RETURN DISTINCT p

Problem

image
Although the returned graph shows that it returns all paths, the result data only contains relations with relation_id: r1.
image

Is there any reason for this ? I mean since it might be misleading, is there any way to only show the returned paths in the result ?

Thanks

@nima

Yep, it's not so easy to found. You must go on "Browser settings" on left sidebar (the Gear icon), and deselect the checkbox "Connect result nodes" at the end of the panel.

1 Like

@giuseppe.villani Thanks for the help :slight_smile: imo, it should have been disabled by default, since it could be misleading (what you see is not the actual result)