1
votes

I am having conceptual difficulties with edges and links in OrientDB.

I have a graph that represents link layer and internet layer in a network. link_layer EXTENDS V nodes correspond to MAC addresses, net_layer EXTENDS V nodes correspond to IP addresses.

A communication relationship between two addresses is represented by an edge class conx EXTENDS E. There will be two separate conx edges that represent the same connection: conx 1 connecting MAC A to MAC B, and conx 2 connecting IP a to IP b that represent the same connection. This will create a graph that is partitioned into two separate subgraphs which do not interact (no MAC to IP edges)

Now I need some way to associate the two graphs together. I would like to connect the edges with a link relationship. Each edge could have a LINKLIST property that identifies all the other edges that this edge is identical to in different layers (say I add the TCP/Application layers later, this would be an n-to-n relationship)

So far so good. How do those links affect the graph? OrientDB documentation says that "With the Graph API, Edges are represented with two links stored on both vertices to handle the bidirectional relationship." If then try to interact with this database from the graph API, can LINK or LINKLIST properties be interpreted as edges? Can you even make a link between an edge and an edge? Ideally, it would not affect graph traversal...I'd like to be able to run graph analysis the link layer usage of my network separately from the internet layer.

Sorry for the broad questions, but I am in general just confused about how and why to use referenced relationships and if using them to connect edges in two otherwise unconnected graphs is valid.

1

1 Answers

2
votes

In general, a graph should be designed to best represent your scenario being described. It is therefore essential to identify the entities that will be represented by the various classes. Each class will have a relationship with another class, by edge or link.

Usually: An edge Defines a relationship between two vertices. For example, you define two vertices, Person and Car. You then define an Edge Drives. This edge ties the two vertices together. "Jane" Drives "Ford".

While: A Linklist is a list of classes associated with another class. A Car class might have a Linklist of parts from the Part class. A car Consists of multiple parts.

The edge / link should never be used to have a relationship with each other eg: edge to edge, and if you have this situation means that the graph has problems conceptual design.