Date
1 - 8 of 8
Integrate CustomVertexProgram to janusgraph
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?
|
|
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
Hey @hadoopmarc, currently only supported language for Vertex Program is java?
|
|
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 |
|
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@...
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 |
|
hadoopmarc@...
Answer to your other question:
What you do is certainly allowed, but has drawbacks compared to building a separate java package:
Best wishes, Marc |
|
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 |
|