In OrientDB, the idea Edge works like a connection between vertices with the assistance of certain properties. Edges and vertices are the fundamental segments of a chart data set. It applies polymorphism on Edges. The base class for an Edge is E. While actualizing edges, on the off chance that source or objective vertices are missing or don't exist, at that point the exchange will be rollback.
The accompanying assertion is the essential punctuation of Create Edge Command.
CREATE EDGE <class> [CLUSTER <cluster>] FROM <rid>|(<query>)|[<rid>]* TO <rid>|(<query>)|[<rid>]*
[SET <field> = <expression>[,]*]|CONTENT {<JSON>}
[RETRY <retry> [WAIT <pauseBetweenRetriesInMs]] [BATCH <batch-size>]
Following are the insights regarding the alternatives in the above language structure.
- <class> − Defines the class name for the edge.
- <cluster> − Defines the bunch wherein you need to store the edge.
- JSON − Provides JSON substance to establish as the precedent.
- RETRY − Defines the quantity of retries to endeavor in case of contention.
- Stand by − Defines an opportunity to defer between retries in milliseconds.
- Bunch − Defines whether it separates the order into more modest squares and the size of the groups.
Example
Execute the accompanying inquiry to make an edge E between two vertices #9:0 and #14:0.
orientdb> CREATE EDGE FROM #11:4 TO #13:2
In the event that the above inquiry is executed effectively, you will get the accompanying yield.
Created edge '[e[#10:0][#9:0->#14:0]]' in 0.012000 sec(s)
Execute the accompanying question to make another edge type and an edge of new sort.
orientdb> CREATE CLASS E1 EXTENDS E
orientdb> CREATE EDGE E1 FROM #10:3 TO #11:4
On the off chance that the above inquiry is executed effectively, you will get the accompanying yield.
Created edge '[e[#10:1][#10:3->#11:4]]' in 0.011000 sec(s)