# Graph relationship filtering is not working

**URL:** <https://community.neo4j.com/t/graph-relationship-filtering-is-not-working/67036>\
**Category:** Neo4j Visualization Library (NVL)\
**Tags:** relationship, filtering\
**Created:** [March 26, 2024, 2:47pm UTC](https://community.neo4j.com/t/graph-relationship-filtering-is-not-working/67036 "2024-03-26T14:47:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dorazele](https://avatars.discourse-cdn.com/v4/letter/d/2bfe46/32.png) [@dorazele](https://community.neo4j.com/u/dorazele)\
**Post date:** [March 26, 2024, 2:47pm UTC](https://community.neo4j.com/t/graph-relationship-filtering-is-not-working/67036/1 "2024-03-26T14:47:12Z")

</div>

Hi everyone,

I have two types of nodes User and Action and one type of relationship called NEXT\_STEP which can be in between User and Action and Action and Action. Every relationship has three properties: step, addr and timestamp. I want to filter based on the addr property. I use the following query:

MATCH p=()-[r:NEXT\_STEP]-\>() WHERE r.addr = "####" RETURN p

When I return r it works well and shows only the filtered relations but when I return p the table is fine but the graph visualisation shows other relations as well that have different addr properties.

Does anyone have any idea why I can't present only the filtered relations in the graph visualisation?

Thank you for the help!

---

<div class="post-metadata">

**Author:** ![liebig](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/liebig/32/2964_2.png) [@liebig](https://community.neo4j.com/u/liebig)\
**Post date:** [March 26, 2024, 3:22pm UTC](https://community.neo4j.com/t/graph-relationship-filtering-is-not-working/67036/2 "2024-03-26T15:22:54Z")

</div>

Hi Dora,  
I assume you use the Neo4j Browser for visualization, right? Contrary to expectations, Neo4j Browser not only shows the selected relations between two nodes, but always all relations that exist between the nodes in the result set.  
A potential solution might be to project the result into a virtual graph - not really sure.  
Alternatively you could use SemSpect which allows to filter down relations by their attribute values (disclaimer, I am one of the SemSpect developers): [Neo4j Graph App | SemSpect](https://doc.semspect.de/docs/neo4j-graph-app/)

---

<div class="post-metadata">

**Author:** ![dorazele](https://avatars.discourse-cdn.com/v4/letter/d/2bfe46/32.png) [@dorazele](https://community.neo4j.com/u/dorazele)\
**Post date:** [March 26, 2024, 3:44pm UTC](https://community.neo4j.com/t/graph-relationship-filtering-is-not-working/67036/3 "2024-03-26T15:44:08Z")

</div>

Yes I tried it in Neo4j Browser I assumed it had to be something like that but I still thought they could be filtered somehow. I will have a look at SemSpect thank you.

---

<div class="post-metadata">

**Author:** ![andrew\_bowman](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/andrew_bowman/32/73_2.png) [@andrew\_bowman](https://community.neo4j.com/u/andrew_bowman)\
**Post date:** [March 26, 2024, 5:33pm UTC](https://community.neo4j.com/t/graph-relationship-filtering-is-not-working/67036/4 "2024-03-26T17:33:21Z")

</div>

The feature in question to connect result nodes can be easily disabled.

In the Neo4j Browser, open the Browser Settings pane (the gear icon in the lower left), then scroll to the end of that pane. There will be a checkbox reading "Connect result nodes". Uncheck that, and you will no longer see other existing relationships in graph result views aside from what you've explicitly queried for.

---

<div class="post-metadata">

**Author:** ![liebig](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/liebig/32/2964_2.png) [@liebig](https://community.neo4j.com/u/liebig)\
**Post date:** [March 26, 2024, 5:38pm UTC](https://community.neo4j.com/t/graph-relationship-filtering-is-not-working/67036/5 "2024-03-26T17:38:25Z")

</div>

Thanks for this hint.
