inheritance of edges & vertices

82 views
Skip to first unread message

Philipp Kraus

unread,
Jul 21, 2020, 11:13:38 AM7/21/20
to Gremlin-users
Hello,

I'm starting with Gremlin (and Janugraph), so my question is how I can add inheritances to my vertex and edge definition, because I'm building a complex system and I would like to define a strict graph schema.

In Java I would like to write

abstract class BaseNode extend V 
{
    public final UUID creator;
    public final Date insertedAt;
}

class User extends BaseNode
{
     public String name;
}

So how can I implement this via a groovy gremlin script? Tanks a lot

Joshua Shinavier

unread,
Jul 21, 2020, 1:11:13 PM7/21/20
to gremli...@googlegroups.com
Hi Phillipp,

Have you tried Ferma? I have not, but based on its similarity to TinkerPop2's Frames, and good documentation, I think it might fit your needs. It does provide inheritance, via Java class extension, for vertex types (frames), and as far as I can tell, edge frames as well. Note also Totorom, though the latter has not been maintained in some time.

I am not aware of any mainstream property graph schema *language* which supports inheritance. A language I wrote for company use did support vertex type inheritance for a time, but this was driven by my bias as the designer rather than a business need. These days, I prefer algebraic schemas, and composition over inheritance for most things. However, an ORM framework in Java, with OO-style inheritance, might be just what you need.

Josh



--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/c4189ce5-cb75-453e-927b-07b4298b0a0bn%40googlegroups.com.

Philipp Kraus

unread,
Jul 21, 2020, 5:09:02 PM7/21/20
to Gremlin-users
This seems to be nice, I will take a look. But at the moment IÄm using Go, Java and Python, sometimes I need also JavaScript, so It would be helpful if there is a general solution for different programming languages

Joshua Shinavier

unread,
Jul 21, 2020, 6:09:51 PM7/21/20
to gremli...@googlegroups.com
There is really no unifying schema API across all of those languages right now, although the next best thing might be to generate equivalent ORM code into each target language based on a single schema. If/when I can finally release Dragon, we will at least have a framework for doing that. A one-way mapping would need to be written to generate Ferma frames definitions in Java, as well as whatever may exist in Go or Python. Anyone know of similar tools in those languages?



Reply all
Reply to author
Forward
0 new messages