Gremlin text comparison predicates

ぐ巨炮叔叔 提交于 2020-01-05 05:28:07

问题


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.

Are there any standard predicates like this in gremlin/tinkerpop or do I have to implement these my self?

I found two related questions in stackoverflow:

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

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.


回答1:


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.



来源:https://stackoverflow.com/questions/50314987/gremlin-text-comparison-predicates

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!