This command creates a new Edge into the database. Edges, together with Vertices, are the main components of a Graph. OrientDB supports polymorphism on edges. The base class is "E" (before 1.4 was called "OGraphEdge"). Look also how to Create Vertex.
NOTE: While running as distributed, edge creation could be done in two steps (create+update). This could break some constraint defined at Edge's class level. To avoid this kind of problem disable the constrains in Edge's class. | |
---|---|
CREATE EDGE <class> [CLUSTER <cluster>] FROM <rid>|(<query>)|[<rid>]* TO <rid>|(<query>)|[<rid>]*
[SET <field> = <expression>[,]*]|CONTENT {<JSON>}
[RETRY <retry> [WAIT <pauseBetweenRetriesInMs]]
Where:
create edge from #10:3 to #11:4
create class E1 extends E
create edge E1 from #10:3 to #11:4
create edge E1 cluster EuropeEdges from #10:3 to #11:4
create edge from #10:3 to #11:4 set brand = 'fiat'
create edge E1 from #10:3 to #11:4 set brand = 'fiat', name = 'wow'
create edge Watched from (select from account where name = 'Luca') to (select from movies where type.name = 'action')
create edge E from #22:33 to #22:55 content { "name" : "Jay", "surname" : "Miner" }
To know more about other SQL commands look at SQL commands.