what is difference b/w link and egde

20 views
Skip to first unread message

thulaseeswara reddy gajjala

unread,
Mar 15, 2017, 8:12:42 AM3/15/17
to OrientDB
hi
when we use edges and when we used links in real time scenarios.  Is there any difference from both
thanks

Luigi Dell'Aquila

unread,
Mar 15, 2017, 9:42:51 AM3/15/17
to orient-...@googlegroups.com
Hi,

A link is just a physical pointer, eg.

Record 1: {@rid: #12:0, name:"John" }
Record 2: {@rid: #12:1, name:"Frank", friendOf:#12:0 }

the friendOf attribute here is a link. Given Record 2, you can easily find Record 1 following the link, but if you only know Record 1 you have no information about connected nodes.

An edge is a bit more complex structure, it's actually a document:

Vertex 1: {@rid: #12:0, name:"John", out_friendOf:#13:0 }

Edge: {@rid: #13:0, out:#12:0, in:#12:1, since: 1/3/2015 }

Vertex 2: {@rid: #12:1, name:"Frank", in_friendOf:#13:0 }

As you can see, the underlying structure relies on links (out/in_friendOf on the vertices and out/in on the edge), but 
- the edge is a document, so it can have properties ("since" in this case)
- you have links on both sides, so you can efficiently traverse the edge in both directions

Thanks

Luigi


--

---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-database+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages