在 clojure ogre 中搜索文本和字符串以查询 Janusgraph - 无法找到任何函数或方法

Text and String search in clojure ogre to query Janusgraph - Not able to find any function or method

我正在使用 Clojure Ogre 从我的 clojure 应用程序查询 Janusgraph 数据库。一切顺利,直到我收到文本搜索的要求。在 gremlin shell 中,我可以使用以下语法通过正则表达式进行搜索,

g.V().has('name', textContainsRegex('.*shr.*'))

我正在 clojure Ogre 中寻找 "textContainsRegex" 的等效 function/method,以便我可以从我的应用程序中查询。你能在这方面提供帮助吗?现在我使用以下语法从我的应用程序中搜索,

(og/traverse g og/V (og/has :name qu) (og/value-map) (og/into-list!))

非常感谢您的宝贵时间。期待解决方案。

textContainsRegex 是一个 JanusGraph class,因此不是 Ogre 暴露的东西。您需要导入 class org.janusgraph.core.attribute.Text 然后:

(og/traverse g og/V 
  (og/has :name (Text/textContainsRegex ".*shr.*") 
  (og/value-map) 
  (og/into-list!))