We are looking at both Titan and the Tinkerpop stack for our NLP framework. I have been experimenting with Frames a bit. It looks like a very nice Object<->Graph mapper. However there is one feature that IMHO is sorely missing from it: support for inheritance. There are e few issues on github related to this (e.g. https://github.com/tinkerpop/frames/issues/15 and https://github.com/tinkerpop/frames/issues/25) but they only seem to partially address what I would consider proper support for inheritance.What I would like to see is the ability to store a vertex-property in the graph based on the type of the VertexFrame, and also the ability to use that property-value when instantiating VertexFrame to make it have the correct interface(s) for the type. There are a couple of ways to do this. One possibility is a scheme that looks like (for a Person that can have Animal(s) of different types as pets:@TypeField("type") // The field in which type-info is stored for animals.
//Since Animal does not have a TypeValue annotation, only subtypes of it can be instantiated (it's "abstract")
interface Animal { ... }
@TypeValue("dog") // So Dog-vertices have type=dog as property
interface Dog extends Animal { ... }
@TypeValue("cat")
interface Cat extends Animal { .... }
interface Person {
@Adjacency(label = "pet") Iterable<? extends Animal> getPets();
@Adjacency(label = "pet") void addPet(Animal animal);
}Frames can then use the @TypeField and @TypeValue annotations when storing (serializing) objects into the graph. When deserializing (e.g. calling getPets) Frames is able to attach the correct interface(s) to a VertexFrame when interfaces are annotated with TypeField?TypeValues anotations. For interfaces that don't have TypeField/TypeValue interfaces nothing changes.Comments? Is this something that others also see as useful for Frames? I'd be happy to invest some time in this, if the core developers can help me along, and are willing to accept patches that make this work.--
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.
For more options, visit https://groups.google.com/groups/opt_out.