在Gremlin 3.2.5-SNAPSHOT之后,我无法在函数hasLabel()中传递顶点标签数组 [英] After Gremlin 3.2.5-SNAPSHOT I can't pass an array of vertex labels in function hasLabel()

查看:65
本文介绍了在Gremlin 3.2.5-SNAPSHOT之后,我无法在函数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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆