Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
06-08-2022 03:50 AM - edited 06-09-2022 08:40 AM
Hi,
A graph looks like this
A-B-C-D
A-E
A-F-G (A being a common node)
The nodes have a level property based on their position on the graph(A is lvl 1, B,E,F is lvl 2..etc). return the data present in a certain format
1st - return format is limited to 2 nodes (the 1st node can only be the nodes with lvl 1)
1st node | relationship name | 2nd node
A|r|B
A|r1|C
A|r|D ....
Query - match(a:node{lvl:"1"})-[r*1..3]->(b) return a.name,b.name,r (but I can't write the type of r as they are a list but for nodes C and D the type(r) should be their relationship with the previous node i.e in the return format for for A->C the type of relationship should be the same as B->C without creating a relationship)
2nd case similarly has a return format restricted to 3 nodes
Hence it should return
1st node| relationship name | 2nd node | relationship name | 3rd node
A|r|B|r1|C
A|r|B|r1|D
A|r|E|null|null (for relaitonships terminating at 2 nodes it should put null)
query (couldnt put null so those paths get ignored that stop at 2nd node)- match(a:node{lvl:"1"})-[r1]->(c)-[r*1..2]->(b) return a.name,type(r1),c.name,b.name,r (relationship type is the same as mentioned above)
Sorry for the long request but I wanted to cover my bases for all types of file format required from the stored data
All the sessions of the conference are now available online