Gremlin server plugin for running additional function on each vertex edge

Dear TinkerPop team,

I'm currently trying to wrap my head around a specific problem I've been trying to solve for a few days.

Basic overview:

Vertices and edges can have a code field, e.g.:
Vertex: a = True
Edge: a == True

While "travelling" over vertices, a custom script engine runs and saves the resulting variables with name and value into the current gremlin sack.

When an edge is reached, the script engine evaluates the expression and tells gremlin to continue or break the current path.


The script engine is written in Rust and works, the java bindings are not a problem either.

What I can't figure out and would really appreciate your help with, is the gremlin part of this project. As far as I know, I have to create a gremlin server plugin like GremlinServerGremlinPlugin.java in the tinkerpop github repository, but if and how I can inject this custom functionality, is beyond me.

Any hint would be highly appreciated.


Thanks
Volker
Solution
you understand them properly, but you perhaps didn't connect their use to your case. you would define a TraversalStrategy that replaces steps that traverse vertex/edge data like out() or inE() with your own implementation for those steps. in that way you will have access to the vertex/edge Traverser as it passes through the step. i suppose you could also consider adding a special step that wraps those steps or follows them depending on your needs. i'm not sure which is best offhand.
Was this page helpful?