This is an absolute newbie question. I am familiar with the adjacency matrix representation of a graph aka excel spreadsheet (can be made into a CSV file) with rows (nodes) and columns (weight of connection between the appropriate indexed nodes). All I want to do is to import this into some Neo4J facility and visualize it using the original GraphViz representations [circular, spring, radial, etc.] I am confused by all the different platforms/frameworks associated with N4J. Please provide me with commented stepwise instructions. I tried searching for "adjacency matrix" in these blogs, N4J site, as well as global Google search associating the term with Neo4J but all to no avail-- discussions center around exporting the data as an adjacency matrix ..Your smart realtime search as I type shows me 'similar' queries except they deal with "export", I want to import. Thank you in advance and I apologize if I have broken any blogging conventions, etc. This is the first time this fossil has blogged in 5 years...
Hi,I am new to Neo4j and still trying to understand it.I have an adjacency matrix of size 600*600 which i want to import to neo4j and build the graph and then i need to perform node2vec on it.I tried with the above code to import adjacency matrix but it shows 'no changes,no records'.Any help on this matter would be appreciated.
Thanks
Can you post the cypher code you used and the csv file?
Hi,
with 11 as noOfNodes
unwind range(1,noOfNodes) as index
create(n:Node{id: index})
load csv from "file:///book4.csv" as line
with line skip 1
with line, toInteger(line[0]) as startNode, size(line)-1 as noOfRelationships
match(n:Node{id: startNode})
unwind range(1, noOfRelationships) as index
match(m:Node{id: index})
create(n)-[r:REL]->(m)
set r.strength = toFloat(line[index])
Sorry cant share the excel here,but i tried with a small adjacency matrix 11*11 which is like this
0
0
0
0.402892
0
0.202454
0
0
0.134067
0
0.196873
0
0
0
0.394285
0
0.287661
0
0
0.186636
0
0.249018
0
0
0
0.245561
0
0
0.218978
0
0
0
0
0.402892
0.394285
0.245561
0
0.304217
0.266478
0.270659
0.366501
0.241004
0.403725
0.211862
0
0
0
0.304217
0
0.169691
0.197938
0
0
0
0.160712
0.202454
0.287661
0
0.266478
0.169691
0
0.320572
0.208562
0
0.214771
0
0
0
0.218978
0.270659
0.197938
0.320572
0
0
0.240021
0.163761
0.282782
0
0
0
0.366501
0
0.208562
0
0
0.167866
0
0.203796
0.134067
0.186636
0
0.241004
0
0
0.240021
0.167866
0
0.176603
0
0
0
0
0.403725
0
0.214771
0.163761
0
0.176603
0
0.233268
0.196873
0.249018
0
0.211862
0.160712
0
0.282782
0.203796
0
0.233268
0
Ok. Look at the original excel I uploaded. It has a header row and a header column. Each is a sequential list of integers starting a lt one. The column numbers are used to match the nodes before creating the relationship. Try fixing your spreadsheet and try the import again. Let me know if it doesn’t work.
Hi, i tried with the headers too. still it shows (no changes,no records).Thanks in advance for your help
0
1
2
3
4
5
6
7
8
9
10
11
0
0
0
0
0.402892
0
0.202454
0
0
0.134067
0
0.196873
0
1
0
0
0
0.394285
0
0.287661
0
0
0.186636
0
0.249018
0
2
0
0
0
0.245561
0
0
0.218978
0
0
0
0
0
3
0.402892
0.394285
0.245561
0
0.304217
0.266478
0.270659
0.366501
0.241004
0.403725
0.211862
0.285246
4
0
0
0
0.304217
0
0.169691
0.197938
0
0
0
0.160712
0
5
0.202454
0.287661
0
0.266478
0.169691
0
0.320572
0.208562
0
0.214771
0
0
6
0
0
0.218978
0.270659
0.197938
0.320572
0
0
0.240021
0.163761
0.282782
0.207581
7
0
0
0
0.366501
0
0.208562
0
0
0.167866
0
0.203796
0
8
0.134067
0.186636
0
0.241004
0
0
0.240021
0.167866
0
0.176603
0
0
9
0
0
0
0.403725
0
0.214771
0.163761
0
0.176603
0
0.233268
0
10
0.196873
0.249018
0
0.211862
0.160712
0
0.282782
0.203796
0
0.233268
0
0
11
0
0
0
0.285246
0
0
0.207581
0
0
0
0
0
Hi,
I got it now,I made mistake in entering the correct number of nodes.It would be really helpful if you could describe how to use nodetovec algorithm on a very huge number of nodes
Thanks once again for your help
I have not used the nodetovec algorithm. Maybe you can find some useful guidance in the GDS documentation, though I did not see nodetovec included. From my quick glance on what it is, it would be an algorithm you would need to develop using the Neo4j API so you can traverse your graph. In my opinion it is not something you can achieve using cypher.
Maybe the original poster @wallputer of this message can provide some insight.
Do you have starting point?