У меня есть график с тремя метками A, B и C и тремя отношениями R1, R2 и R3
Label with A has 1 node -> A1
Label with B has 2 nodes -> B1, B2, B3
Label with C has 2 nodes -> C1, C2, C3
B1, B2, B3 has relationship R1 with node A1.
B1 has relationship R2 with node C1
B2 has relationship R2 with node C2
A1 has relationship R3 with node C1
A1 has relationship R3 with node C3
Теперь, когда у A1 есть связь с B1, B2, B3.
Как мы можем обновить отношения A1 так, чтобы это было подмножество отношений между B1, B2, B3 с C1, C2 и C3.
Так что в приведенном выше примере мы можем создать запрос в Neo4j, которыйудалит дополнительное отношение А1 и добавит отсутствующее отношение?
Окончательный ответ будет:
A1 has relationship R3 with node C1 (As B1 has relationship with C1, and B1 has relationship with A1)
A1 relationship will be deleted with node C3 (As A1 has relationship with B1, B2 and B3 but none of them has relationship with C3)
A new relationship A1 with node C2 will be added. (As A1 has relationship with B2 and B2 has relationship with C2, which is missing for A1)
Спасибо за помощь.