You need to dedup x by values(
t.id), as select('x').dedup() is the same, so values(
t.id) could de deleted.
Also you can use dedup().by(id) to modulator dedup.
As for the above error:
1. Though I have not used Neptune before, but as a general gremlin-server alibaba-gdb. values accept strings which is just property-key,
not-including id or label,demo show as follows:
gremlin> g.V("p2164").valueMap()
==>[birthday:[484185600000],browserUsed:[Chrome],creationDate:[1268208971445],firstName:[Jie],gender:[male],lastName:[Chen],locationIP:[1.1.0.52],normalized_birthday:[19850506],p.id:[2164]]
gremlin> g.V("p2164").values("birthday")
==>484185600000
gremlin> g.V("p2164").values("~id")
gremlin> g.V("p2164").values(T.id)
Script6.groovy: 1: [Static type checking] - Cannot find matching method org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal#values(org.apache.tinkerpop.gremlin.structure.T). Please check if the declared type is correct and if the method exists.
@ line 1, column 1.
g.V("p2164").values(T.id)
2. Let go deeper to find why?
The kernel of values() step in gremlin-core is here in Element.java:
/**
* Get the values of properties as an {@link Iterator}.
*/
public default <V> Iterator<V> values(final String... propertyKeys) {
return IteratorUtils.map(this.<V>properties(propertyKeys), property -> property.value());
}
/**
* Get an {@link Iterator} of properties where the {@code propertyKeys} is meant to be a filter on the available
* keys. If no keys are provide then return all the properties.
*/
public <V> Iterator<? extends Property<V>> properties(final String... propertyKeys);
In TinkerGraph, the standard element include TinkerVertex and TinkerEdge, Let's takeTinkerVertex.java as example and go deeper:
public <V> Iterator<VertexProperty<V>> properties(final String... propertyKeys) {
...
} else {
return ((List)this.properties.entrySet().stream().filter((entry) -> {
return ElementHelper.keyExists((String)entry.getKey(), propertyKeys);
}).flatMap((entry) -> {
return ((List)entry.getValue()).stream();
}).collect(Collectors.toList())).iterator();
}
}
public static boolean keyExists(final String key, final String... providedKeys) {
if (Graph.Hidden.isHidden(key)) return false;
}
isHidden means ~id, ~label are not property key.