customizing query for ignoring vertices

21 views
Skip to first unread message

Bharat Dighe

unread,
Apr 12, 2018, 7:52:10 PM4/12/18
to Gremlin-users
In my application, the vertices can be marked to be ignored. They are not removed, they are just hidden using a flag.

The application has tons of complex queries using gremlin traversal. Is there way these vertices which are marked are filtered out without modifying all these queries.

g.V().has("type", x").out().has("name", "y").toList();
can be converted to 
g.V().has("type", x").hasNot("ignore").out().has("name", "y").hasNot("ignore").toList();

Is there a way in the framework that certain steps can be inserted in a traversal?

Thanks
Bharat

Shashwat Arghode

unread,
Apr 12, 2018, 8:39:50 PM4/12/18
to bdi...@gmail.com, gremli...@googlegroups.com
Hi Bharat,

I don't have a sample gremlin graph to verify the approach.
But following article with use of side effects might help. Please check.


Thanks,
Shashwat.

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/c7e66100-3e61-44de-982c-2a5860b01862%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bharat Dighe

unread,
Apr 12, 2018, 8:52:05 PM4/12/18
to Gremlin-users
If I have to modify all the queries then solution is simple.

I asking if there is something in the gremlin framework where a step can inserted after all the steps in the traversal object. 

Bharat


On Thursday, April 12, 2018 at 5:39:50 PM UTC-7, Shashwat Arghode wrote:
Hi Bharat,

I don't have a sample gremlin graph to verify the approach.
But following article with use of side effects might help. Please check.


Thanks,
Shashwat.
On Thu, Apr 12, 2018 at 7:52 PM, Bharat Dighe <bdi...@gmail.com> wrote:
In my application, the vertices can be marked to be ignored. They are not removed, they are just hidden using a flag.

The application has tons of complex queries using gremlin traversal. Is there way these vertices which are marked are filtered out without modifying all these queries.

g.V().has("type", x").out().has("name", "y").toList();
can be converted to 
g.V().has("type", x").hasNot("ignore").out().has("name", "y").hasNot("ignore").toList();

Is there a way in the framework that certain steps can be inserted in a traversal?

Thanks
Bharat

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.

Daniel Kuppitz

unread,
Apr 12, 2018, 9:43:19 PM4/12/18
to gremli...@googlegroups.com
You can use the SubgraphStrategy. By doing that you only need to use a new TraversalSource, all your queries will be the same.

Cheers,
Daniel


To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/f8184002-547c-4116-8f48-bdef3589be44%40googlegroups.com.

Bharat Dighe

unread,
Apr 12, 2018, 10:04:15 PM4/12/18
to Gremlin-users
Fantastic !!! 

Thanks Daniel, can't wait to try this.

Bharat Dighe

unread,
Apr 12, 2018, 10:32:53 PM4/12/18
to Gremlin-users
The version we are using does not have withStratergies()

Can it be achieved using withSideEffects() ?

Thanks
Bharat

Stephen Mallette

unread,
Apr 13, 2018, 7:06:54 AM4/13/18
to Gremlin-users
What version does not have withStrategies()?

To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/a74f89e2-6f3c-4a0b-b3b5-35b63e8db4ea%40googlegroups.com.

Daniel Kuppitz

unread,
Apr 13, 2018, 10:39:26 AM4/13/18
to gremli...@googlegroups.com
Every version has withStrategies(), no version has withStratergies() :)

Cheers,
Daniel


Reply all
Reply to author
Forward
0 new messages