Creating a vertex of a specific OrientDB class

12 views
Skip to first unread message

Alvin Khaled

unread,
Sep 12, 2015, 1:59:00 AM9/12/15
to pacer-users
Is it possible to create an entry under a class that extends V?

Darrick Wiebe

unread,
Sep 12, 2015, 12:31:12 PM9/12/15
to Pacer Group
Orient exposes the ability to create a vertex with a custom class as follows:

graph = Pacer.orient
graph.tx { graph.create_vertex 'class:MyCustomClass' }

Cheers,
Darrick

On Sat, Sep 12, 2015 at 1:59 AM, Alvin Khaled <aak...@gmail.com> wrote:
Is it possible to create an entry under a class that extends V?

--
You received this message because you are subscribed to the Google Groups "pacer-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pacer-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alvin Khaled

unread,
Sep 12, 2015, 1:07:12 PM9/12/15
to pacer-users
Thanks Darrick!

Alvin Khaled

unread,
Sep 12, 2015, 1:34:12 PM9/12/15
to pacer-users
I suppose I should have ask this as well: Is there a "nice" way to filter by class?
My workaround is graph.v('@CLASS' => 'MyCustomClass')

Darrick Wiebe

unread,
Sep 12, 2015, 2:41:42 PM9/12/15
to Pacer Group
Right now there is not a lot of support for Orient's custom classes. I did a bit of experimentation around wrapping up some of the functionality, but didn't go very far with it. If you want to check it out and maybe extend it, the code is not very complex and exists in pacer-orient/graph.rb and pacer-orient/orient_type.rb.

Good luck!
Darrick

Topping Bowers

unread,
Sep 16, 2015, 9:50:24 AM9/16/15
to pacer-users
Sorry to be dence... I can now see how to use 'class:MyCustomClass' for vertexes... but I don't see how to do it for edges. You cannot say: v.add_edges_to('class:MyCustomEdgeClass') and if you add the label... v.add_edges_to('class:MyCustomEdgeClass') then it errors... doing this... v.add_edges_to('MyCustomEdgeClass') works... but it seems broken in the orient graph visualizer (can't unlink due to an 'undefined' class, etc).

Topper

Alvin Ali Khaled

unread,
Sep 16, 2015, 10:49:24 AM9/16/15
to pacer...@googlegroups.com
Try: g.create_edge(nil, from, to, 'EdgeClass')

You received this message because you are subscribed to a topic in the Google Groups "pacer-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pacer-users/5Jy-dHLvReA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pacer-users...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages