cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

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

nima
Node Link

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

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

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

1 ACCEPTED SOLUTION

@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.

View solution in original post

2 REPLIES 2

@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.

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