gremlin-scala
gremlin-scala copied to clipboard
Support for list types with cardinality
Hi,
Please see the following SO question. This happened when using Seq
and List
for properties on my CC.
https://stackoverflow.com/questions/56568962/unsupported-property-value-type-java-util-linkedhashmap-when-writing-to-neptune
I was able to step through your code, and it appears that for a List
type addVertex
proceeds to add the whole list as a property which is unsupported. Is there a way to make it iterate through and add all said items to the property the Gremlin way i.e.
g.addV("person").property("friend", "john").property("friend","joe")
from the stack overflow question: Unsupported property value type: java.util.LinkedHashMap
I don't have a working neptune setup, but a plain scala List
might work. If not, here's the relevant sections in the macro:
https://github.com/mpollmeier/gremlin-scala/blob/2e32ae0/macros/src/main/scala/gremlin/scala/Marshallable.scala#L178-L179
https://github.com/mpollmeier/gremlin-scala/blob/2e32ae0/macros/src/main/scala/gremlin/scala/Marshallable.scala#L110-L120
Thanks, will try this and get back to you
Plain scala List
didnt work. Even Map
doesn't work. Seems like a neptune feature gap, but will try and confirm this.
From Neptune team:
Neptune supports Single and Set cardinality properties when using the Gremlin property() step etc. It currently does not support List cardinality. Now those are all 'TinkerPop' types. What Neptune also does not support is arbitrary Java data types
So as I first suggested, the issue is addVertex/marshaller does not support translating lists to list cardinality properties, or sets to set cardinality properties but instead tries to just shove the whole object in.
Also from Neptune team
You should not assume hosted graph databases which have to be more language agnostic will support native programming language complex types such as maps and hashes.