Integrate CustomVertexProgram to janusgraph


Nikita Pande
 

Hey Marc,

Thanks for help.
I just ran the sample vertex program and created a blog https://medium.com/@nikita15p/integrating-custom-vertex-program-with-janusgraph-33dce1deffda . Hope it helps others as well.

Regards,
Nikita


hadoopmarc@...
 

Answer to your other question:

What you do is certainly allowed, but has drawbacks compared to building a separate java package:
  • building janusgraph-core takes more time (slower development cycle)
  • giving different things the same name will cause confusion sooner or later

Best wishes,    Marc


hadoopmarc@...
 

Hi Nikita,

gremlin console does a lot of imports for you, but does not cover the full JanusGraph and TinkerPop APIs. So, sometimes you have to do an import yourself. In this case:

gremlin> import org.janusgraph.graphdb.olap.computer.*

Best wishes,     Marc


Nikita Pande
 
Edited

Hi @hadoopmarc,

I actually added a customVertexprogram in https://github.com/JanusGraph/janusgraph/tree/master/janusgraph-core/src/main/java/org/janusgraph/graphdb/olap/computer and then built janusgraph-core jar file. I added this jar file in the lib folder of jansugraph releases https://github.com/JanusGraph/janusgraph/releases/download/v0.6.0/janusgraph-0.6.0-doc.zip . However when I try to run this VertexProgram from gremlin console, it gives error:
gremlin> ComputerResult result = graph.compute().program(CustomVertexProgram.build().name("jane").create()).submit().get();
No such property: CustomVertexProgram for class: groovysh_evaluate
Type ':help' or ':h' for help.
Display stack trace? [yN]n

Am I allowed to add the vertex program in https://github.com/JanusGraph/janusgraph/tree/master/janusgraph-core/src/main/java/org/janusgraph/graphdb/olap/computer?
 


hadoopmarc@...
 

Yes, I forgot that one, VertexPrograms need to be written in java. If you are not familiar with setting up java projects, you can take a look at the examples at:

https://github.com/JanusGraph/janusgraph/tree/master/janusgraph-examples


Nikita Pande
 

Hey @hadoopmarc, currently only supported language for Vertex Program is java? 


hadoopmarc@...
 

The easiest way is to write your custom VertexProgram for TinkerPop. If it runs in TinkerPop, it will also run in JanusGraph.
There are other ways, though, see two examples in:
https://github.com/JanusGraph/janusgraph/tree/master/janusgraph-core/src/main/java/org/janusgraph/graphdb/olap/computer


Nikita Pande
 
Edited

What is the current method of integrating new VertexProgram as part of janusgraph. Is it getting the code in tinker pop and then building janusgraph code. Is java only supported language?