在Gremlin 3.2.5-SNAPSHOT之后,我无法在函数hasLabel()中传递顶点标签数组 [英] After Gremlin 3.2.5-SNAPSHOT I can't pass an array of vertex labels in function hasLabel()
问题描述
过去,这两个语句都可以在Java中运行:
It used to be that both those statements would work in Java:
GraphTraversalSource g =...;
String[] labels = new String[]{"label1","label2","label3"};
g.V().hasLabel(labels);
g.V().hasLabel("label1", "label2", "label3");
升级到3.2.5-SNAPSHOT后,仅支持后者,我得到了"Cannot resolve method hasLabel(java.lang.String[])"
.
显然hasLabel(String label, String... otherLabels)
与hasLabel(P<String> predicate)
发生冲突.有没有解决的办法,所以我仍然可以逐步构建标签列表?
After upgrading to 3.2.5-SNAPSHOT only the later one is supported and I am getting "Cannot resolve method hasLabel(java.lang.String[])"
.
Apparently hasLabel(String label, String... otherLabels)
collides with hasLabel(P<String> predicate)
. Is there a work around for that so I can still build a list of labels incrementally?
谢谢!
推荐答案
You could force it to use hasLabel(String label, String... otherLabels)
g.V().hasLabel(labels[0], labels);
这篇关于在Gremlin 3.2.5-SNAPSHOT之后,我无法在函数hasLabel()中传递顶点标签数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!