0
votes

Is there any way to visualise (the actual graph) only a particular type of relationship in Neo4j using Cypher? For eg, consider the data model wherein the nodes can have three types of relationships, namely QR,QL and RL.

(A) -[QR]-> (B)
(A) -[QL]-> (B)
(A) -[RL]-> (B)

Suppose that two nodes have all the three types of relationships between them and say I want to highlight only the QR relationships in the entire graph. Now if I run

"MATCH p=(n)-[r:QR]->(m) RETURN p LIMIT 10;"

it does give me the required result in tabular form. However, the visualisation part is not as required. It shows all the relationships between A and B (oi61.tinypic.com/219qmgm.jpg) but I want it to show only the QR relations between A and B. Can anyone please help me on this? Thanks in advance! :)

2
What do you mean by visalisation? An actual graph? Some text format? Please specify that in your question. What are you running your queries against?user1019830
By visualisation, I meant the actual graph.sgp
What about just MATCH (n)-[r:QR]->(m) RETURN r LIMIT 10? The expression p = ... assigns any path between n and m to the variable p. That's not necessarily the single relation between them.user1019830
I think I understand your problem now. When you return r or any relation in the Neo4j browser, you get back both nodes involved, plus all the relations between them. Here, these multiple relations are on top of each other in the GUI, so you can only click the one the "top". The actual result is showed in the tabular data, which will be correct. The GUI isn't then "correct" about the actual data returned, since it shows slightly more data.user1019830
No. Not that I know of. It's the way the browser is designed.user1019830

2 Answers

1
votes

Well, kinda.

In that you can do it in Gephi, which will import a Neo4j database after you get the plugin, and that can filter the data in a variety of ways, including what you want.

0
votes

There's no way with the Neo4J browser to visually filter the result.

Either you visualize the result from the Cypher query with a third party tool or you write your self the code to do that.