Expecting java.lang.ArrayList/java.lang.List instead of java.lang.String. Where am I going wrong?
Solution
A few things you should know based on your needs:
1. with JanusGraph you can't store
2. multi-properties aren't
3. Gremlin has no steps that can help you detect a type. Whatever type detection you would do, it would have to happen in the client application (technically what you are doing when you call
4. Using just Gremlin It's hard to detect if you are using multiproperties or not because it has no knowledge of the schema. Maybe you could consult JanusGraph for the schema for the types. Counting properties of a key doesn't really work either because you could have a key with just one property and it still could be a multiproperty (with just one value).
I suppose you could:
1. try a different graph that lets you natively store a
2. store the type as a property value. i would think that you know the type when you are setting it with
3. ....
1. with JanusGraph you can't store
Map or List so that may be a blocker for you2. multi-properties aren't
List - they are multiple values stored under the same property key, so those semantics may be a blocker for you3. Gremlin has no steps that can help you detect a type. Whatever type detection you would do, it would have to happen in the client application (technically what you are doing when you call
next() and class) which may be a blocker for you.4. Using just Gremlin It's hard to detect if you are using multiproperties or not because it has no knowledge of the schema. Maybe you could consult JanusGraph for the schema for the types. Counting properties of a key doesn't really work either because you could have a key with just one property and it still could be a multiproperty (with just one value).
I suppose you could:
1. try a different graph that lets you natively store a
List or a Map. TinkerGraph does that but it's just an in-memory graph and may not suit your needs2. store the type as a property value. i would think that you know the type when you are setting it with
property() step, just add another property('type', 'LIST') along side it.3. ....
