Search code examples
orientdb

Unable to create edge from one node to other


How can I create a edge between 2 class instances in orientDb.

I have my class Xyz in Db with following properties

 #| RID     |name
--+---------+------------
 0|    #99:6|abc
 1|    #99:7|xyz
  1. Now when I try to create edge between both these nodes and I get following errors
orientdb> create edge E1 from #99:6 to #99:7

Error: com.orientechnologies.orient.core.exception.OCommandExecutionException:

E rror on execution of command: OCommandSQL [text=create edge E1 from #99:6 to #99 :7] Error: com.orientechnologies.orient.core.exception.OValidationException: The fie ld 'OGraphEdge.out' has been declared as LINK of type 'OGraphVertex' but the val ue is the document #99:6 of class 'Xyz' orientdb>

  1. Can I have set of labels/tags/properties to a edge?
  2. How can i create edges in java?Do we have some java api instead of calling SQL?

Solution

  • Seems that record #99:6 is of a class doesn't extend V (OGraphVertex).