orientdb icon indicating copy to clipboard operation
orientdb copied to clipboard

Unable to create edges between edges in OrientDB 2.0.8 (which was possible in 2.0.6)

Open nagarajasr opened this issue 11 years ago • 4 comments

In OrientDB 2.0.6, it was possible to create an edge between two edges. However, the fix to issue #2796, provided by the commit 3b39ef6197313c5a432489362c2aeb6d40c094ee seems to have inadvertently broken this 'feature'.

in 2.0.6:

create class V1 extends V
create class E1 extends E
create vertex V1 (gives #11:0)
create vertex V1 (gives #11:1)
create edge E1 from #11:0 to #11:1 (gives #12:1)
create edge E1 from #11:0 to #11:2 (gives #12:2)
create edge E1 from #12:1 to #12:2
Created edge '[E1#12:3{out:#12:1,in:#12:2} v3]' in 0.036000 sec(s)

However, in 2.0.8, the last statement throws an IllegalArgumentException:

Error: com.orientechnologies.orient.core.exception.OCommandExecutionException: Error on execution of command: sql.create edge E1 from #24:0 to #24:1

Error: java.lang.IllegalArgumentException: Class 'E1' is not an instance of V

We would like to have the feature restored so that it may be possible to create edges between edges.

nagarajasr avatar May 04 '15 17:05 nagarajasr

What's the meaning on creating edges between edges?

lvca avatar May 04 '15 22:05 lvca

I would like to create an edge where the source and destination are themselves edges (instead of vertices). As described above, the statement "create edge E1 from #12:1 to #12:2" is trying to create an edge where #12:1 and #12:2 are themselves edges.

Let me try to describe my use case why I would need this 'feature'. In my domain model for a network, I have represented a circuit (which I call as parent circuit) between two ports as an edge in OrientDB. This circuit provides a certain capacity (or bandwidth). I need to divide this circuit capacity into smaller circuits (called child circuits) which may be allocated to different customers. I need to represent a relationship, the child circuit "depends on" the parent circuit. This requires to be able to create an edge between parent and child circuit, which are themselves edges. Note that this circuit hierarchy can run many levels deep.

nagarajasr avatar May 04 '15 23:05 nagarajasr

Edges against edges is out of Property Graph definition. In your domain you could simply create a new vertex of class "subgraph" and connect them using this vertex.

lvca avatar May 04 '15 23:05 lvca

Dear friends, dear lvca : The type of graph in which edges can have edges with edges is actually called : "Hyper Graph". Those edges who connect the edges only are called "Hyper Edges". The hyper graph is a proven and widely used extension to original Graph theory and recent network theory to follow. If i may i would suggest to include (reinclude) the feature as an extra feature named HYPERGRAPH to be enabled or disabled per database in run time.

emg110 avatar Dec 10 '17 16:12 emg110