I have big table (>100mi rows) with 2 columns, each row represents 1 connection between same data types.
person | friend
userId1 | userId2
userId1 | userId3
userId1 | userId4
userId2 | userId4
…
I tested this data in neo4j (loaded it with command):
LOAD CSV WITH HEADERS FROM 'file:///out-edges.csv' AS row
MERGE (f:Person {hash: row.Friend})
MERGE (p:Person {hash: row.Person})
MERGE (p)<-[:FRIEND]-(f)
And after queried whole graph with:
MATCH (p:Person)<-[:FRIEND*1..15]-(f:Person)
RETURN p, f
In dgraph i can’t understand how to make recursive connection using this table.
I tried to create mutation like:
{"hash": ..., friend:{"hash": ...}}
And after query it with:
query {
q(func: has(friend) {
hash
friend {
hash
}
}
}
But it doesn’t work like i expected. Dgraph returns a lot of edges but not connected between recursively. Just 1 edge per table’s row.
Could you help me to understand how to implement the same task on dgraph? Thanks.