UniformListValues/FEATURE_UNIFORM_LIST_VALUES in edges

9 views
Skip to first unread message

Olav Laudy

unread,
Jan 22, 2018, 7:09:53 PM1/22/18
to Gremlin-users
Hi,

If I issue in my TinkerGraph, Gremlin 3.3.1: graph.features() I see  UniformListValues: true for both Vertices and Edges

The way I understand this, is I can create lists as node or edge property/

This works:

g.V(171).property(set,'ff',2)
g.V(171).property(set,'ff',3)

['Vertex:',
 {'id': 171, 'label': 'object1', 'properties': {'ff': [2, 3], 'name': 2}}]

This: 

g.E(178L).property(set,'ff',2)

gives me an error:

('g', 'org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerEdge cannot be cast to org.apache.tinkerpop.gremlin.structure.Vertex')


In the java docs (https://www.javatips.net/api/tinkerpop-master/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java), it looks like my understanding of  UniformListValues is what it is supposed to do


            /**
             * Supports setting of a {@code List} value.  The assumption is that the {@code List} can contain
             * arbitrary serializable values that may or may not be defined as a feature itself.  As this
             * {@code List} is "uniform" it must contain objects of the same type.
             *
             * @see #supportsMixedListValues()
             */
            @FeatureDescriptor(name = FEATURE_UNIFORM_LIST_VALUES)
            public default  boolean supportsUniformListValues() {
                return true;
            }
        }



What am I missing?



Thanks!

Daniel Kuppitz

unread,
Jan 23, 2018, 11:13:17 AM1/23/18
to gremli...@googlegroups.com
Hi Olav,

what you are talking about, is supportsMultiProperties(). supportsUniformListValues() is really only about uniform List values, e.g. ...property('myList', [1, 2, 3]). And then theres supportsMixedListValues() for things like this: ...property('myList', [1, "abc", 3.1415])

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-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/667f6647-6669-4024-979d-8136c1a8132e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages