Multiple cardinality failed with EventStrategy

23 views
Skip to first unread message

Pavel Ershov

unread,
Feb 13, 2019, 8:57:01 AM2/13/19
to Gremlin-users
Sample of code

import org.apache.tinkerpop.gremlin.process.traversal.step.util.event.*
graph
= TinkerFactory.createTheCrew()
graph
.traversal().V().has('name', 'marko').property(VertexProperty.Cardinality.list, 'location','moscow')
strategy
= EventStrategy.build().addListener(new ConsoleMutationListener(graph)).create()
g
= graph.traversal().withStrategies(strategy)
g
.V().has('name', 'marko').property(VertexProperty.Cardinality.list, 'location','saint-petersburg')

gremlin> graph = TinkerFactory.createTheCrew()
==>tinkergraph[vertices:6 edges:14]
gremlin
> graph.traversal().V().has('name', 'marko').property(VertexProperty.Cardinality.list, 'location','moscow')
==>v[1]
gremlin
> strategy = EventStrategy.build().addListener(new ConsoleMutationListener(graph)).create()
==>EventStrategy
gremlin
> g = graph.traversal().withStrategies(strategy)
==>graphtraversalsource[tinkergraph[vertices:6 edges:14], standard]
gremlin
> g.V().has('name', 'marko').property(VertexProperty.Cardinality.list, 'location','saint-petersburg')
Multiple properties exist for the provided key, use Vertex.properties(location)
Type ':help' or ':h' for help.
Display stack trace? [yN]y
java
.lang.IllegalStateException: Multiple properties exist for the provided key, use Vertex.properties(location)
    at org
.apache.tinkerpop.gremlin.structure.Vertex$Exceptions.multiplePropertiesExistForProvidedKey(Vertex.java:179)
    at org
.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerVertex.property(TinkerVertex.java:75)
    at org
.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerVertex.property(TinkerVertex.java:43)
    at org
.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AddPropertyStep.sideEffect(AddPropertyStep.java:97)
    at org
.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SideEffectStep.processNextStart(SideEffectStep.java:39)
    at org
.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143)
    at org
.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal.hasNext(DefaultTraversal.java:192)
    at org
.apache.tinkerpop.gremlin.console.Console$_closure3.doCall(Console.groovy:214)
    at sun
.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun
.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java
.lang.reflect.Method.invoke(Method.java:498)
    at org
.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
    at groovy
.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)



Daniel Kuppitz

unread,
Feb 13, 2019, 8:31:27 PM2/13/19
to gremli...@googlegroups.com
At first, I thought it's just something not supported by ConsoleMutationListener, but it's, in fact, a bug deep in the core.


Cheers,
Daniel


--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/434c5397-c854-4856-ae4a-48146303ae5f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages