Disabling strategies via string in remote driver
Is there a way to disable a strategy in a providers implementation without a reference to the class?
For example, let's say StrategyA is in the providers implementation and I am in Python without access to this.
Is there no way to do g.withoutStrategies("com.provider.strategies.StrategyA").V().<etc>()?
I see string inputs mentioned in the changelog but it doesn't seem to work?
Solution:Jump to solution
in Java, i think you can use
TraversalStrategyProxy
directly inside of withStrategies()
but there is nothing analogous for withoutStrategies()
. We probably should have a better way to do both of these things in the Gremlin language which really doesn't have a notion of classes and such.4 Replies
possible workaround 1:
create StrategyA in Python
something like
class StrategyA(TraversalStrategy):
def init(self):
TraversalStrategy.init(self, fqcn='com.provider.strategies.StrategyA')
and use it in
withoutStrategies
possible option 2:
https://github.com/apache/tinkerpop/blob/8bfdf50778e29d98c6554a01688fc5cc34524522/gremlin-python/src/main/python/radish/gremlin.py#L409
GitHub
tinkerpop/gremlin-python/src/main/python/radish/gremlin.py at 8bfdf...
Apache TinkerPop - a graph computing framework. Contribute to apache/tinkerpop development by creating an account on GitHub.
Solution
in Java, i think you can use
TraversalStrategyProxy
directly inside of withStrategies()
but there is nothing analogous for withoutStrategies()
. We probably should have a better way to do both of these things in the Gremlin language which really doesn't have a notion of classes and such.Okay thanks both, yeah would be kind of nice to have a simpler way