Gremlin's "mean" equivalent in Java (Blueprints 2.6)
I'm using OrientDB 2.1.6 and have the following Gremling example query:
This works great on the Gremlin shell, but I need to be able to use that from within Java. Using the Java Graph API I could translate most of it to
final GremlinPipeline<Long, Vertex> pipe = new GremlinPipeline<>(orientGraph); pipe.V("username", "testark").out("IsFriendsWith").property("height").????????
but not I cannot seem to find the equivalent of the mean function. My current workaround involves computing the mean "manually" based on the return value of property, but I'd obviously prefer to get that value from the database via Gremlin. Can anyone please point out to me what's the equivalent of mean?
The mean function is a method of gremlin-groovy so you won't find it on the Java side:
You would need to do as you are doing and manually calculate the mean.