I am trying to get Adjacency-Matrix from neo4j graph. That matrix contains rich features. That mean, if two nodes are connected, then put type of the node ( type is a field of the node ) and edge type into corresponding cell. This is a sample matrix:
[
[0, 'node_1_type : edge_type : node_2_type', 0],
...
]
This is the cypher query which i am going to try. But i don't know how to get edge_type of the connected nodes.
MATCH (n)
WITH collect(n) AS Nodes
WITH [n IN Nodes |
[m IN Nodes |
CASE size((n)-[]->(m))
WHEN 0 THEN 0
ELSE n.type + ':' + 'edge-type ??' + ':' + m.type
END
]
] AS AdjacencyMatrix
RETURN AdjacencyMatrix;
Could you please help how to get edge type between connected nodes.