2
votes

I'm using Clojure Ogre to query Janusgraph database from my clojure application. Everything went well until I got a requirement for text search. In gremlin shell I can able to search via regular expression using below syntax,

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

I'm looking for equivalent function/method for "textContainsRegex" in clojure Ogre so that I can able to query from my application. Can you please help in this regard. For now I'm using the below syntax to search from my application,

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

Thanks a lot for your time. Looking forward for the solution.

1

1 Answers

3
votes

textContainsRegex is a JanusGraph class and therefore isn't something exposed by Ogre. You would need to import that class org.janusgraph.core.attribute.Text and then:

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