I have two question please, if that's alright?
- I was wondering how to call (use) my own custom written java code in gremlin server script engine please? so, for example, I think Stephen Mallette wrote some java functions, which are called inside of gremlin server script folder, here is a link to his functions:
And then in Gremlin Server script folder, generateModern(final TinkerGraph g)
was use as below:
globals << [hook : [
onStartUp: { ctx ->
ctx.logger.info("Loading 'modern' graph data.")
org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory.generateModern(graph)
}
] as LifeCycleHook]
How to I replace this with my own written java functions please, in a way that gremlin server will understand my java functions and read them at runtime? Do I need to compile my functions into a Jar file and put in the Lib folder?
- I am connecting to Gremlin Server via a Java program i built and not Gremlin console. How do i reference and use the graph object variable in my java program. I can only see and use the graph traversal source object variable (g), which is expose in the script file i.e.
globals << [g: graph.traversal()]
How do I expose the graph object variable i.e. graph
so that i can use it in my Java program?
Many thanks