How to create edge class target different vetex class in orientdb?
How to create edge class target different vetex class in orientdb?
For example, a company has many shareholders, some are natural man, some are companies.
I need to create a edge class that target vertex type are natural man or company.
But I can only select one class in "From Vertex" dropbox
I'm using 2.2.x
– Dollyn
Aug 13 at 11:53
1 Answer
1
I don't know if I've undertsand correctly, please correct me if i'm wrong but, you want an edge that is able to connect a Shareholder (man or company) to an another company, an I right? If I am, try this:
create class Company extends V
insert into Company(name) values ("Company001"), ("Company002"), ("Company003")
create class Natuaral_Man extends V
insert into Natural_Man(name) values ("User001")
create class ShareHolderOf extends E
create edge ShareHolderOf from #22:0 to #18:0
create edge ShareHolderOf from #22:0 to #21:0
create edge ShareHolderOf from #20:0 to #21:0
this is what you get:
Hope it helps
Regards
hi, if we doing it this way, the source or target vertex class could be anything, without any constraint
– Dollyn
Sep 6 at 2:54
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Hi, what version are you using? Could you explain better? Thx
– Michela Bonizzi
Aug 11 at 3:36