Sevi
ATApache TinkerPop
•Created by Sevi on 9/30/2023 in #questions
inverted regex search
@ManaBububu Okay, thanks 🙂 To me it does not matter if the regexp expression is stored as label on a vertex or a property both may be fine.
About the problem let's say we have three vertices without any relationships for simplicity with label or property (does not matter which one):
1) 'why.'
2) 'w.y?'
3) 'wty?'
I would like to execute a query on all of those three vertices which take these labels/properties, but take them as regexp expressions not just mere strings and match those against a fixed input string such as e.g: 'why?'
Whichever vertices match this way, should be returned (the entire vertex)
So in this graph of 3 vertices the regexps 'why.' , 'w.y?' and 'wty?' should be matched against the text 'why?' out of which the vertices of the first two should come out as matching and be returned. If however let's say the input string is 'somethingElse', it should return 0 results as neither of the three vertices taken as regexp can match the text 'somethingElse'.
I don't know if my problem is understandable enough. So far I could not come up with a solution trying to browse through the docs of gremlin and the reference. Probably I have overlooked something, or lack some sort of understanding.
Thanks for the help in advance.
19 replies
ATApache TinkerPop
•Created by Sevi on 9/30/2023 in #questions
inverted regex search
Tried to do something like this, but I keep failing:
g.V().filter{constant('why').regex(it.get().label())}
19 replies
ATApache TinkerPop
•Created by Sevi on 9/30/2023 in #questions
inverted regex search
@ManaBububu could you give me an example how you would do this? I couldn't figure it out so far
19 replies