0
votes

My graph consists only of nodes with the label Tag, which are joined by a relationship :CONNECTED_TO.

(:Tag)-[:CONNECTED_TO]-(:Tag)

In addition, :CONNECTED_TO has a property called count_question, which is an int value.

Now I would like to visualize my graph with neovis.js. Therefore I would like to visualize every node from my network but only those relationships whose value for the count_question property matches a certain value.

I already tried to query my graph as followed

MATCH (t1:Tag)-[c:CONNECTED_TO]-(t2:Tag) 
WHERE c.count_question > 50 
AND id(t1) > id(t2)
RETURN t1, c, t2

But this will only give me the nodes who are linked by the relationship and not every node.

So how do I query by graph correctly, or is there a way to do this with neovis.js?

1

1 Answers

0
votes

if you want all the :Tag nodes, including the ones that are not connected, try

MATCH (t1:Tag)
OPTIONAL MATCH (t1)-[c:CONNECTED_TO]->(t2:Tag) 
WHERE c.count_question > 50 
RETURN t1, c, t2