project("p").by(__.values("a", "b") Only Outputs Single Property, Bug or Expected?
by()
modulators only grab the first item in the traversal provided to it so if you want all of them you need to provide your own reducing operator to convert all the items into a single one. typically this is done with fold()
:
by(__.values("localId", "uuid").fold())
e...Use of by()
by()
is a step modulator, meaning it modifies the step it is being applied to in some way by giving it some additional instruction. an easy example to see this with is groupCount()
:
gremlin> g.V().groupCount()
==>[v[1]:1,v[2]:1,v[3]:1,v[4]:1,v[5]:1,v[6]:1]
gremlin> g.V().groupCount()
==>[v[1]:1,v[2]:1,v[3]:1,v[4]:1,v[5]:1,v[6]:1]
groupCount()
without modulation implies the default behavior of grouping on the incoming traverser (i.e. the current Vertex
). Each Vertex
is simply counted once as a result as they are each unique entities. If we want to change that grouping behavior, we modulate that step with by()
, like:
```gremlin> g.V().groupCount().by(label)...@GremlinDSL support in the GremlinLangScriptEngine
GremlinLangScriptEngine
and the GremlinGroovyScriptEngine
.
https://github.com/ArcadeData/arcadedb/pull/1239...ScriptEngine
implementations are not meant to have complete feature parity. GremlinLangScriptEngine
does not process arbitrary code. It only processes Gremlin, which I tend to think is a good thing compared to GremlinGroovyScriptEngine
which will run any arbitrary code and is therefore a bit of a security risk. That said there is some untangling to do in Gremlin Server, ScriptEngines and the grammar and that's the main reason TinkerPop has not yet promoted GremlinLangScriptEngine
over its groovy counterpart despite it being more secure and generally more performant than both groovy and bytecode. This is the reason why we don't have much documentation on it.
I believe that you should be able to process Gremlin that originated from a DSL in the GremlinLangScriptEngine
but you couldn't do it in the fashion you can with groovy. To understand how it's worth noting that any DSL step is really just a compositions of standard Gremlin steps. in other words, a DSL step like:
g.persons()
might really just compose as:
g.V().hasLabel('person')
...RepeatStep does not appear to respect barriers
g.V(<ids>).repeat(out()).until(out().count().is(0)).toList()
g.V(<ids>).repeat(out()).until(out().count().is(0)).toList()
Trying to find a Vertex using a variable injected earlier in the traversal
to
Vertex. From business logic, I will know the ID of the from
Vertex for the new Edge . I am able to create the new Vertex without any issue, but when I am having trouble grabbing the from
Vertex to create the edge. Is there a way to do this/what am I doing wrong?
```g.inject(["myID": "2", "parentID": "1", "properties": ["key1":"value1"]]).
addV("MyVertex").as("newVertex").
property(id, select("myID"))....Individual Vertex per property or Vertex with grouped properties
Filter out empty results
Question on running queries in windows env.
RuntimeError: Event loop is closed
, but after troubleshooting I notice that my script ran just fine. It crashed after the script eded. I suppose I was just ignoring it at first, but should I? I'm using asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
. Should I just ignore the error or should I deal with it? if the latter, how?PropertiesStep.hashcode() not always unique
apply
method of the strategy I was getting the index of the PropertiesStep
instances using the indexOf
method:...PropertiesStep
under the same traversal.
I am not sure if we need to improve that part, a user might need to specify the Step they want by its index, or use ==
and compare by reference (you need the reference of the exact object in advance though). You may also rely on Step ID to identify some Step in such case as well....Trying to run a local version for a test, what is the correct serializer?
serializers:
section of the gremlin-conf.yaml
so I commented out to see if the defaults would work. The docker image loads fine, but then I can't seem to connect to it.
...adding edges to multiple vertices at once
Does .math() always return a Double?
Long tenHours = Long.valueOf(Duration.ofHours(10).toMillis());
g.withSideEffect("tenHours", tenHours).inject(1689570000000L).math("_ + tenHours").next().getClass()
Long tenHours = Long.valueOf(Duration.ofHours(10).toMillis());
g.withSideEffect("tenHours", tenHours).inject(1689570000000L).math("_ + tenHours").next().getClass()
Trying to update a property value based on another property
Casting issue with Gremlin Java
valueMap and Multivalues
AWS Neptune bulk load notifications
I was rather hoping to configure an SNS notification for say status change "LOAD_STARTED"... etc. The JSON given by the https: calls would be fine as having received the notification, I can use the standard calls to retrieve errors and more detailed information etc. Fairly standard pattern:
SNS->lambda function-><do something>
...VertexProgram filter graph before termination
Straightforward way to render a force directed graph svg/png