Migrating from frames to ferma

35 views
Skip to first unread message

Johannes Schüth

unread,
Jun 9, 2015, 4:55:58 AM6/9/15
to ferma...@syncleus.com
Hi,

i'm currently researching what is needed to migrate from frames to ferma. 

  • Gremlin support
The GremlinGroovy is not available. What would be the replacement for this annotation?

  • Abstract classes / JavaHandler
The example states that it is possible to create abstract classes instead of interfaces:

public abstract class Person extends VertexFrame

Unfortunately this is not working for me since VertexFrame is an Interface. Is there an extrastep needed?

I would like to add methods to my abstract class in order to replace the methods using the JavaHandler  annotation. 

  • FrameInitializer

    With frames i used a FrameInitializer to set a uuid for each element i created. How can this be achieved using ferma?

Johannes

fre...@gmail.com

unread,
Jun 9, 2015, 10:36:11 AM6/9/15
to ferma...@syncleus.com
Hi. Currently there is no replacement for the GremlinGroovy annotation as Ferma was designed to favor performance it wasn't really a high priority. I am not opposed to adding it to the library however. But for now the way that is handled is by adding a method body and putting your gremlin code in there. Should only take one line so really shouldn't be much additional effort.

You should extend from AbstractVertexFrame instead of VertexFrame when implementing abstract classes. If you do that it should work, though IIRC you don't NEED to extend from AbstractVertexFrame, if instead you "implement" VertexFrame it will still technically work you just wont have some of the functionality provided by the abstract class available to you, which is probably what you need. So your best bet is to just extend from AbstractVertexFrame, let me know if that does what you're looking for.

In Ferma we use the ClassInitializer class to accomplish something similar. If you want to implement some sort of custom initialization that occurs whenever your class is newly created then you would implement a version of this class and pass it into the add method you use to create the class. For example FramedGraph.addFramedVertex() takes a ClassInitalizer.

https://github.com/Syncleus/Ferma/blob/master/src/main/java/com/syncleus/ferma/ClassInitializer.java

I know these answers were a bit brief so please let me know if they helped. I'd be more than happy to go into more detail for you if it would be helpful.

Johannes Schüth

unread,
Jun 12, 2015, 8:31:31 AM6/12/15
to ferma...@syncleus.com
Hi,

thank you for your detailed answer. I don't have any more questions at the moment. I assume once i changed my queries to java based gremlin code even a migration from Totorom to Ferma should be a no brainer.

I'm currently experimenting with the gremlin API. I'm used to neo4j cypher so even simple tasks are now a little bit complicated for me at the moment.

Thanks again

Johannes

Jeffrey Freeman

unread,
Jun 12, 2015, 11:38:25 AM6/12/15
to ferma...@syncleus.com, j.sc...@jotschi.de
No problem please don't hesitate to ask if you have any questions. We also have a room on Freenode that is usually relatively active. The room is #dANN (one of our old projects but the room seems to be the center for all chit chat for all projects).
Reply all
Reply to author
Forward
0 new messages