I am working on an application which uses neo4j.
I have imported my Data Base in neo4j using CSV file and created the nodes and relations.
My Database contains 3 columns, Anumber,Bnumber and DateTime. This DB represents the calling history from ANUMBER -> BNUMBER
with DATETIME
So I have created the nodes and relations by using these commands on neo4j Browser
LOAD CSV WITH HEADERS FROM "file:///2.csv" AS ROW
CREATE (a:ANUMBER {aNumber:ROW.aNumber} )
CREATE (b:BNUMBER {bNumber:ROW.bNumber} )
MERGE (a)-[:CALLED]->(b);
This successfully created two nodes, one relation and 2 properties keys.
Now I am facing two issues.
First one is When I query data related to single node It creates new circle for every occurrence. I have used this query
MATCH p=(a:ANUMBER)-[r:CALLED]->(b:BNUMBER)
WHERE a.aNumber = "3217913664"
RETURN p
This results the correct response BUT it created new circle for every relation between 3217913664 and any other number. Please see the attached Image. I need to show one circle for 3217913664 and all of the edges goes out from single circle and created the required circle and edges. This image shows 23 nodes for 3217913664 BUT I only need to show one node for 3217913664 and other node as expected.
Second one is I need to show the all shortest path between two numbers. Lets say
123 called 456,789,000,222
000 called 333,555,999
999 called 963
456 called 963
123 called 963
So I need to find the all shortest path between 123 and 963, which are:
123 -> 000 -> 999 -> 963
123 -> 456 -> 963
123 -> 963
Any idea how can I solve these 2 problems. I have already implemented these scenarios using GraphStream BUT I need to implement the same use cases in neo4j using Cypher Query Language