Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-08-2022 02:21 PM
Browser displaying all relationships between two nodes, even when filtered.
This code shows the problem, if you have the time to run it I'd be very grateful.
merge (:Entity { name: 'Zara' } );
merge (:Age {value: '30-34'});
merge (:Gender {value: 'Female'});
merge (:Location {value: 'Johannesburg'});
match (e:Entity { name: 'Zara'})
match (a:Age { value: '30-34'})
match (g:Gender { value: 'Female'})
match (l:Location { value: 'Johannesburg'})
merge (e)-[:Question {Label: 'T1'}]->(a)
merge (e)-[:Question {Label: 'T1'}]->(g)
merge (e)-[:Question {Label: 'T1'}]->(l);
match (e:Entity { name: 'Zara'})
match (a:Age { value: '30-34'})
match (g:Gender { value: 'Female'})
match (l:Location { value: 'Johannesburg'})
merge (e)-[:Question {Label: 'T2'}]->(a)
merge (e)-[:Question {Label: 'T2'}]->(g)
merge (e)-[:Question {Label: 'T2'}]->(l);
MATCH p = (e:Entity)-[q:Question]->() where q.Label = 'T1' RETURN p
What I'd like is a single relationship displayed between the central "Entity" node and each of the surrounding nodes. What I'm getting is both the T1 and T2 relationships displayed....
Hopefully it will be a common error or design issue that people can have a laugh at as you point out my neo inexperience. Seriously, comments are very welcome.
Solved! Go to Solution.
03-08-2022 02:41 PM
There is a setting in Neo4j Browser that when set shows all the relationships between the returned nodes. You can disable it to get what you want. The setting is "Connect result nodes."
03-08-2022 02:41 PM
There is a setting in Neo4j Browser that when set shows all the relationships between the returned nodes. You can disable it to get what you want. The setting is "Connect result nodes."
03-08-2022 02:47 PM
Hello Gary,
Thank you - that does exactly what I wanted.
It is best practise not to do this?
01-04-2023 06:51 AM
It depends on your needs. I find both settings useful. Depends what I am doing. I leave it checked when I want to visualize data, as I only need to search fir nodes and the relationships are shown. I leave it unchecked when I want to see only the result of queries. In this case you need to return both nodes and relationships to visualize the relationships.
03-08-2022 02:56 PM
No worries. I had the same issue when starting.
It depends on your requirements. I like it checked most of the time, since I can query for nodes and it shows me all the relationships too. It helps visualize. I like it unchecked when I am querying for specific patterns, as you are doing.
03-08-2022 03:24 PM
Sounds good, thx again
All the sessions of the conference are now available online