You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 23, 2019. It is now read-only.
I wanted to create a graph without having to define node info and purely based on the list of relation info (linear).
for example, RelA,RelB,RelC,RelD, in this path, it involves 5 nodes (anonymous) and 4 defined edges.
what I did manually is below:
CREATE (n)-[:RelA]->(m)
MATCH (x)-[:RelA]->(n)
WITH n
CREATE (n)-[:RelB]->(m)
MATCH (x)-[:RelA]->(y)-[:RelB]->(n)
WITH n
CREATE (n)-[:RelC]->(m)
MATCH (x)-[:RelA]->(y)-[:RelB]->(z)-[:RelC]->(n)
WITH n
CREATE (n)-[:RelC]->(b)
The reason for the complicated matching is because there might be other paths which indicate a different branch, for example:
RelA,RelB1,RelC,RelD In this case, the starting node and 2nd node will be identical with the nodes created above, however, the 3rd node (after RelB1) is different from the 3rd node above. Consequently, the 4th and 5th Node will be different although the relation is the same. They are different because the starting point (3rd node) is different now.
The text was updated successfully, but these errors were encountered:
createRel does not allow anonymous node and also query can only take one statement. I'm wondering if there's easier way to achieve my goal. Maybe patch the path info using igraph first and then bulk load into Neo4j and remove node info?
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
I wanted to create a graph without having to define node info and purely based on the list of relation info (linear).
for example, RelA,RelB,RelC,RelD, in this path, it involves 5 nodes (anonymous) and 4 defined edges.
what I did manually is below:
CREATE (n)-[:RelA]->(m)
MATCH (x)-[:RelA]->(n)
WITH n
CREATE (n)-[:RelB]->(m)
MATCH (x)-[:RelA]->(y)-[:RelB]->(n)
WITH n
CREATE (n)-[:RelC]->(m)
MATCH (x)-[:RelA]->(y)-[:RelB]->(z)-[:RelC]->(n)
WITH n
CREATE (n)-[:RelC]->(b)
The reason for the complicated matching is because there might be other paths which indicate a different branch, for example:
RelA,RelB1,RelC,RelD In this case, the starting node and 2nd node will be identical with the nodes created above, however, the 3rd node (after RelB1) is different from the 3rd node above. Consequently, the 4th and 5th Node will be different although the relation is the same. They are different because the starting point (3rd node) is different now.
The text was updated successfully, but these errors were encountered: