[
https://issues.apache.org/jira/browse/TINKERPOP-1716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16080317#comment-16080317
]
Marko A. Rodriguez commented on TINKERPOP-1716:
-----------------------------------------------
Note that we have test cases in Gremlin-Python that verify the correct behavior
for {{SubgraphStrategy}} and its use {{withRemote()}}. Note that the second
test case was just added as unlike the first, it does only edge label filtering.
{code}
g = Graph().traversal().withRemote(remote_connection). \
withStrategies(SubgraphStrategy(vertices=__.hasLabel("person"),
edges=__.hasLabel("created")))
assert 4 == g.V().count().next()
assert 0 == g.E().count().next()
assert 1 == g.V().label().dedup().count().next()
assert "person" == g.V().label().dedup().next()
#
g = Graph().traversal().withRemote(remote_connection). \
withStrategies(SubgraphStrategy(edges=__.hasLabel("created")))
assert 6 == g.V().count().next()
assert 4 == g.E().count().next()
assert 1 == g.E().label().dedup().count().next()
assert "created" == g.E().label().dedup().next()
{code}
Why its not working in the example you provided using Gremlin-Java isn't clear.
I suspect there is a problem with strategy ordering. That is, both
{{RemoteStrategy}} and {{SubgraphStrategy}} are {{DecorationStrategies}}. I
don't see anywhere where its guaranteed to execute after {{RemoteStrategy}}.
Can you verify execution order of strategies with {{.explain()}}.
Finally, if that is the problem, then we need to make sure all
{{DecorationStrategies}} execute after {{RemoteStrategy}}. In the future, we
should treat {{RemoteStrategy}} special (as not a {{DecorationStrategy}}).
> Traversal strategies are not applied with remote in Gremlin Console
> -------------------------------------------------------------------
>
> Key: TINKERPOP-1716
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1716
> Project: TinkerPop
> Issue Type: Bug
> Components: server
> Affects Versions: 3.2.3, 3.2.5
> Reporter: Jason Plurad
>
> Originally from a [StackOverflow
> post|https://stackoverflow.com/questions/44907843/can-strategies-be-used-with-remote-traversal-in-gremlin]:
> This subgraph strategy works (only the `battled` edges are returned) with a
> remote from Gremlin-Python:
> {noformat}
> from gremlin_python import statics
> from gremlin_python.structure.graph import Graph
> from gremlin_python.process.graph_traversal import __
> from gremlin_python.process.strategies import *
> from gremlin_python.driver.driver_remote_connection import
> DriverRemoteConnection
> statics.load_statics(globals())
> graph = Graph()
> g =
> graph.traversal().withRemote(DriverRemoteConnection('ws://localhost:8182/gremlin','g')).withStrategies(SubgraphStrategy(edges=__.hasLabel('battled')))
> g.E().label().groupCount().toList()
> {noformat}
> But the subgraph strategy does not work (all edges are returned) with a
> remote from the Gremlin Console:
> {noformat}
> graph = EmptyGraph.instance()
> g =
> graph.traversal().withRemote('conf/remote-graph.properties').withStrategies(SubgraphStrategy.build().edges(__.hasLabel("battled")).create())
> g.E().label().groupCount().toList()
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)