Join the free virtual developer conference on knowledge graphs and AI. This year's themes are: applications, AI engineering, data intelligence, graphs, and architecture.
I would like to know if it is possible to display a second level relation without creating it.
It is, imagine i have a three different nodes, A, B and C
I have a relation within A and B (B belongs to A), and another one between B and C (C belongs to B)
I want to display in the graph that C belongs to A. Do i need to create a direct relation between A and C, or is there any way to display that A belongs to C directly as it is a second level relation?
How about this one.
I used the APOC Virtual Nodes/Rels.
Anyway, It is possible
MATCH (a:Node {name:"A"})-[:BELONGS*2]-(c:Node)
WITH a, c, count(*) as count
CALL apoc.create.vNode([head(labels(a))],{name:a.name}) yield node as va
CALL apoc.create.vNode([head(labels(c))],{name:c.name}) yield node as vc
CALL apoc.create.vRelationship(va,"BELONGS",{count:count},vc) yield rel
RETURN va,vc,rel;