Gremlin文字比较谓词 [英] Gremlin text comparison predicates

查看:77
本文介绍了Gremlin文字比较谓词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的顶点属性部分包含诸如一个File对象. 当搜索有"时,我想按路径搜索文件".我认为可以进行"toString()"转换的某种文本比较谓词在这里可能会有所帮助.

My vertice properties partly contain objects like e.g. a File object. When searching with "has" I would like to search for Files by path. I think some kind of text comparison predicates that would do the "toString()" conversion might be helpful here.

在gremlin/tinkerpop中是否有像这样的标准谓词,还是我必须自己实现这些谓词?

我在stackoverflow中发现了两个相关的问题:

I found two related questions in stackoverflow:

  • Gremlin.net textContains equivalent
  • How Gremlin query same sql like for search feature

其中一个我今天回答了一个指向SimpleGraph项目的RegexPredicate实现的指针

And one of them I answered today with a pointer to the SimpleGraph project's RegexPredicate implementation https://github.com/BITPlan/com.bitplan.simplegraph/blob/master/simplegraph-core/src/main/java/com/bitplan/gremlin/RegexPredicate.java (I am one of the committer of that project)

目前,我将在库中添加更多类似这样的帮助谓词.

Currently I'd proceed by adding more helper Predicates like that to the library.

推荐答案

现在,您应该添加自己的谓词以进行文本比较. TinkerPop过去曾就增加这种支持进行过讨论,但在采取的方向上尚未达成共识.

For now you should add your own predicates for text comparisons. TinkerPop has had discussion in the past about adding such support, but no consensus has been achieved on a direction to take.

这篇关于Gremlin文字比较谓词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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