[jira] [Commented] (TINKERPOP-1759) Improve hashcode and equals for Traverser implementations

2017-08-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16147653#comment-16147653
 ] 

ASF GitHub Bot commented on TINKERPOP-1759:
---

Github user okram commented on the issue:

https://github.com/apache/tinkerpop/pull/699
  
I'm scared -- VOTE +1.


> Improve hashcode and equals for Traverser implementations
> -
>
> Key: TINKERPOP-1759
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1759
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: process
>Affects Versions: 3.2.6
>Reporter: Daniel Kuppitz
>Assignee: Daniel Kuppitz
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[GitHub] tinkerpop issue #699: TINKERPOP-1759 Improve hashcode and equals for Travers...

2017-08-30 Thread okram
Github user okram commented on the issue:

https://github.com/apache/tinkerpop/pull/699
  
I'm scared -- VOTE +1.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Re: Duy's Gremlin Blog Post Series

2017-08-30 Thread Jason Plurad
+1

On Wed, Aug 30, 2017 at 11:00 AM, Stephen Mallette 
wrote:

> i was going to recommend this as well. it's a really good series. a home
> page would be nice, but we also have more flexibility now in how present
> those "publications" now that all of that has been moved to the
> "compendium". however they get on they get on the site - +1
>
> On Wed, Aug 30, 2017 at 10:56 AM, Marko Rodriguez 
> wrote:
>
> > Hello,
> >
> > I think we should add Duy’s Gremlin Blog Post Series to the
> > tinkerpop.apache.org website:
> >
> > http://www.doanduyhai.com/blog/?p=13224 <
> > http://www.doanduyhai.com/blog/?p=13224>
> > http://www.doanduyhai.com/blog/?p=13260
> > http://www.doanduyhai.com/blog/?p=13285
> > http://www.doanduyhai.com/blog/?p=13301
> > http://www.doanduyhai.com/blog/?p=13320
> > http://www.doanduyhai.com/blog/?p=13352
> > http://www.doanduyhai.com/blog/?p=13374
> > http://www.doanduyhai.com/blog/?p=13404
> > http://www.doanduyhai.com/blog/?p=13424 <
> > http://www.doanduyhai.com/blog/?p=13424>
> >
> > If people agree, I can ask Duy to make a single “homepage” for all the
> > posts.
> >
> > Thoughts?,
> > Marko.
> >
> > http://markorodriguez.com
> >
> >
> >
> >
>


[jira] [Commented] (TINKERPOP-1759) Improve hashcode and equals for Traverser implementations

2017-08-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16147426#comment-16147426
 ] 

ASF GitHub Bot commented on TINKERPOP-1759:
---

Github user dkuppitz commented on the issue:

https://github.com/apache/tinkerpop/pull/699
  
`docker/build.sh -t -n -i` still succeeds after recent changes.

Still VOTE: +1


> Improve hashcode and equals for Traverser implementations
> -
>
> Key: TINKERPOP-1759
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1759
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: process
>Affects Versions: 3.2.6
>Reporter: Daniel Kuppitz
>Assignee: Daniel Kuppitz
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[GitHub] tinkerpop issue #699: TINKERPOP-1759 Improve hashcode and equals for Travers...

2017-08-30 Thread dkuppitz
Github user dkuppitz commented on the issue:

https://github.com/apache/tinkerpop/pull/699
  
`docker/build.sh -t -n -i` still succeeds after recent changes.

Still VOTE: +1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Re: Duy's Gremlin Blog Post Series

2017-08-30 Thread Stephen Mallette
i was going to recommend this as well. it's a really good series. a home
page would be nice, but we also have more flexibility now in how present
those "publications" now that all of that has been moved to the
"compendium". however they get on they get on the site - +1

On Wed, Aug 30, 2017 at 10:56 AM, Marko Rodriguez 
wrote:

> Hello,
>
> I think we should add Duy’s Gremlin Blog Post Series to the
> tinkerpop.apache.org website:
>
> http://www.doanduyhai.com/blog/?p=13224 <
> http://www.doanduyhai.com/blog/?p=13224>
> http://www.doanduyhai.com/blog/?p=13260
> http://www.doanduyhai.com/blog/?p=13285
> http://www.doanduyhai.com/blog/?p=13301
> http://www.doanduyhai.com/blog/?p=13320
> http://www.doanduyhai.com/blog/?p=13352
> http://www.doanduyhai.com/blog/?p=13374
> http://www.doanduyhai.com/blog/?p=13404
> http://www.doanduyhai.com/blog/?p=13424 <
> http://www.doanduyhai.com/blog/?p=13424>
>
> If people agree, I can ask Duy to make a single “homepage” for all the
> posts.
>
> Thoughts?,
> Marko.
>
> http://markorodriguez.com
>
>
>
>


[jira] [Commented] (TINKERPOP-1762) Make MatchStep analyze mid-clause variables for executing ordering purposes.

2017-08-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16147381#comment-16147381
 ] 

ASF GitHub Bot commented on TINKERPOP-1762:
---

Github user okram commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/701#discussion_r136094137
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java
 ---
@@ -513,8 +513,15 @@ public int hashCode() {
 this.scopeKeys = new HashSet<>();
 if (null != this.selectKey)
 this.scopeKeys.add(this.selectKey);
-if (this.getNextStep() instanceof WhereTraversalStep || 
this.getNextStep() instanceof WherePredicateStep)
-this.scopeKeys.addAll(((Scoping) 
this.getNextStep()).getScopeKeys());
+final Set endLabels = ((MatchStep) 
this.getTraversal().getParent()).getMatchEndLabels();
+Stream.concat(
+
TraversalHelper.getStepsOfAssignableClassRecursively(WherePredicateStep.class, 
this.getTraversal()).stream(),
+
TraversalHelper.getStepsOfAssignableClassRecursively(WhereTraversalStep.class, 
this.getTraversal()).stream()).
+flatMap(s -> 
s.getScopeKeys().stream()).filter(endLabels::contains).forEach(this.scopeKeys::add);
--- End diff --

Done.


> Make MatchStep analyze mid-clause variables for executing ordering purposes.
> 
>
> Key: TINKERPOP-1762
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1762
> Project: TinkerPop
>  Issue Type: Bug
>  Components: process
>Affects Versions: 3.2.6
>Reporter: Marko A. Rodriguez
>Assignee: Marko A. Rodriguez
>
> {code}
> gremlin> graph = TinkerGraph.open()
> ==>tinkergraph[vertices:0 edges:0]
> gremlin> graph.io(graphml()).readGraph("data/grateful-dead.xml")
> ==>null
> gremlin> g = graph.traversal()
> ==>graphtraversalsource[tinkergraph[vertices:808 edges:8049], standard]
> gremlin> 
> gremlin> t = g.V().match(
> ..1> __.as("sunshine").has("song", "name", "HERE COMES SUNSHINE"),
> ..2> 
> __.as("sunshine").map(inE("followedBy").values("weight").mean()).as("avg_weight"),
> ..3> __.as("sunshine").inE("followedBy").as("x"),
> ..4> 
> __.as("x").filter(values("weight").where(gte("avg_weight"))).outV().as("followers")
> ..5>   ).
> ..6>   select("followers").by("name"); []
> gremlin> 
> gremlin> t.clone().limit(2)
> ==>LOOKS LIKE RAIN
> ==>PROMISED LAND
> gremlin> t
> Neither the sideEffects, map, nor path has a avg_weight-key: 
> WherePredicateStep(gte(avg_weight))
> Type ':help' or ':h' for help.
> Display stack trace? [yN]
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[GitHub] tinkerpop pull request #701: TINKERPOP-1762: Make MatchStep analyze mid-clau...

2017-08-30 Thread okram
Github user okram commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/701#discussion_r136094137
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java
 ---
@@ -513,8 +513,15 @@ public int hashCode() {
 this.scopeKeys = new HashSet<>();
 if (null != this.selectKey)
 this.scopeKeys.add(this.selectKey);
-if (this.getNextStep() instanceof WhereTraversalStep || 
this.getNextStep() instanceof WherePredicateStep)
-this.scopeKeys.addAll(((Scoping) 
this.getNextStep()).getScopeKeys());
+final Set endLabels = ((MatchStep) 
this.getTraversal().getParent()).getMatchEndLabels();
+Stream.concat(
+
TraversalHelper.getStepsOfAssignableClassRecursively(WherePredicateStep.class, 
this.getTraversal()).stream(),
+
TraversalHelper.getStepsOfAssignableClassRecursively(WhereTraversalStep.class, 
this.getTraversal()).stream()).
+flatMap(s -> 
s.getScopeKeys().stream()).filter(endLabels::contains).forEach(this.scopeKeys::add);
--- End diff --

Done.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Re: Duy's Gremlin Blog Post Series

2017-08-30 Thread Robert Dale
Good stuff.
+1

Robert Dale

On Wed, Aug 30, 2017 at 10:56 AM, Marko Rodriguez 
wrote:

> Hello,
>
> I think we should add Duy’s Gremlin Blog Post Series to the
> tinkerpop.apache.org website:
>
> http://www.doanduyhai.com/blog/?p=13224 <
> http://www.doanduyhai.com/blog/?p=13224>
> http://www.doanduyhai.com/blog/?p=13260
> http://www.doanduyhai.com/blog/?p=13285
> http://www.doanduyhai.com/blog/?p=13301
> http://www.doanduyhai.com/blog/?p=13320
> http://www.doanduyhai.com/blog/?p=13352
> http://www.doanduyhai.com/blog/?p=13374
> http://www.doanduyhai.com/blog/?p=13404
> http://www.doanduyhai.com/blog/?p=13424 <
> http://www.doanduyhai.com/blog/?p=13424>
>
> If people agree, I can ask Duy to make a single “homepage” for all the
> posts.
>
> Thoughts?,
> Marko.
>
> http://markorodriguez.com
>
>
>
>


Duy's Gremlin Blog Post Series

2017-08-30 Thread Marko Rodriguez
Hello,

I think we should add Duy’s Gremlin Blog Post Series to the 
tinkerpop.apache.org website:

http://www.doanduyhai.com/blog/?p=13224 

http://www.doanduyhai.com/blog/?p=13260
http://www.doanduyhai.com/blog/?p=13285
http://www.doanduyhai.com/blog/?p=13301
http://www.doanduyhai.com/blog/?p=13320
http://www.doanduyhai.com/blog/?p=13352
http://www.doanduyhai.com/blog/?p=13374
http://www.doanduyhai.com/blog/?p=13404
http://www.doanduyhai.com/blog/?p=13424 


If people agree, I can ask Duy to make a single “homepage” for all the posts.

Thoughts?,
Marko.

http://markorodriguez.com





[jira] [Commented] (TINKERPOP-1764) Generalize MatchStep to localize all barriers, not just reducing barriers.

2017-08-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1764?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16147335#comment-16147335
 ] 

ASF GitHub Bot commented on TINKERPOP-1764:
---

Github user doanduyhai commented on the issue:

https://github.com/apache/tinkerpop/pull/702
  
Please remark that the result of _PREVIOUSLY_ is already wrong if we assume 
that the ordering is global. Indeed the global ordering on 
`outE('created').values('weight').inV()` should yield 
{label=software,id=5,lang=java,name=ripple}


![image](https://user-images.githubusercontent.com/1532977/29878170-189d7a3e-8da2-11e7-8459-055939e62223.png)



> Generalize MatchStep to localize all barriers, not just reducing barriers.
> --
>
> Key: TINKERPOP-1764
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1764
> Project: TinkerPop
>  Issue Type: Bug
>  Components: process
>Affects Versions: 3.2.6
>Reporter: Marko A. Rodriguez
>
> Given the semantics of order()/aggregate()/dedup(), this should work 
> currently (perhaps), but I will make it explicit in MatchStep and provide 
> test cases to ensure expected behavior. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[GitHub] tinkerpop issue #702: TINKERPOP-1764: Generalize MatchStep to localize all b...

2017-08-30 Thread doanduyhai
Github user doanduyhai commented on the issue:

https://github.com/apache/tinkerpop/pull/702
  
Please remark that the result of _PREVIOUSLY_ is already wrong if we assume 
that the ordering is global. Indeed the global ordering on 
`outE('created').values('weight').inV()` should yield 
{label=software,id=5,lang=java,name=ripple}


![image](https://user-images.githubusercontent.com/1532977/29878170-189d7a3e-8da2-11e7-8459-055939e62223.png)



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (TINKERPOP-1764) Generalize MatchStep to localize all barriers, not just reducing barriers.

2017-08-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1764?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16147330#comment-16147330
 ] 

ASF GitHub Bot commented on TINKERPOP-1764:
---

GitHub user okram opened a pull request:

https://github.com/apache/tinkerpop/pull/702

TINKERPOP-1764: Generalize MatchStep to localize all barriers, not just 
reducing barriers.

https://issues.apache.org/jira/browse/TINKERPOP-1764

Prior to this moment, only reducing barrier steps in a `match()`-clause 
forced the clause to be computed locally (via a `flatMap()`-wrap). However, it 
has been deemed important to generalize this behavior to all barriers (e.g. 
`order()`, `limit()`, etc.) as identified by @doanduyhai (Gremlin power user). 
As such, the generalization has been done, but at the expense of a breaking 
change. However, realize that this breaking change would only be breaking 
behavior that is "random" (and most users should not be doing anyways -- but 
you never know).

*PREVIOUSLY*

```
gremlin> g.V().match(
..1>   
__.as('a').outE('created').order().by('weight',decr).limit(1).inV().as('b'),
..2>   __.as('b').has('lang','java')
..3> ).select('a','b').by('name')
==>[a:marko,b:lop]
```

*CURRENTLY*

```
gremlin> g.V().match(
..1>   
__.as('a').outE('created').order().by('weight',decr).limit(1).inV().as('b'),
..2>   __.as('b').has('lang','java')
..3> ).select('a','b').by('name')
==>[a:marko,b:lop]
==>[a:josh,b:ripple]
==>[a:peter,b:lop]
```

VOTE +1

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/apache/tinkerpop TINKERPOP-1764

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/tinkerpop/pull/702.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #702


commit 04b61d5943ecf12338ff15181ff01ba6fd2f143b
Author: Marko A. Rodriguez 
Date:   2017-08-30T14:33:34Z

generalized match() to locally compute with all barriers, not just reducing 
barriers.




> Generalize MatchStep to localize all barriers, not just reducing barriers.
> --
>
> Key: TINKERPOP-1764
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1764
> Project: TinkerPop
>  Issue Type: Bug
>  Components: process
>Affects Versions: 3.2.6
>Reporter: Marko A. Rodriguez
>
> Given the semantics of order()/aggregate()/dedup(), this should work 
> currently (perhaps), but I will make it explicit in MatchStep and provide 
> test cases to ensure expected behavior. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[GitHub] tinkerpop pull request #702: TINKERPOP-1764: Generalize MatchStep to localiz...

2017-08-30 Thread okram
GitHub user okram opened a pull request:

https://github.com/apache/tinkerpop/pull/702

TINKERPOP-1764: Generalize MatchStep to localize all barriers, not just 
reducing barriers.

https://issues.apache.org/jira/browse/TINKERPOP-1764

Prior to this moment, only reducing barrier steps in a `match()`-clause 
forced the clause to be computed locally (via a `flatMap()`-wrap). However, it 
has been deemed important to generalize this behavior to all barriers (e.g. 
`order()`, `limit()`, etc.) as identified by @doanduyhai (Gremlin power user). 
As such, the generalization has been done, but at the expense of a breaking 
change. However, realize that this breaking change would only be breaking 
behavior that is "random" (and most users should not be doing anyways -- but 
you never know).

*PREVIOUSLY*

```
gremlin> g.V().match(
..1>   
__.as('a').outE('created').order().by('weight',decr).limit(1).inV().as('b'),
..2>   __.as('b').has('lang','java')
..3> ).select('a','b').by('name')
==>[a:marko,b:lop]
```

*CURRENTLY*

```
gremlin> g.V().match(
..1>   
__.as('a').outE('created').order().by('weight',decr).limit(1).inV().as('b'),
..2>   __.as('b').has('lang','java')
..3> ).select('a','b').by('name')
==>[a:marko,b:lop]
==>[a:josh,b:ripple]
==>[a:peter,b:lop]
```

VOTE +1

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/apache/tinkerpop TINKERPOP-1764

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/tinkerpop/pull/702.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #702


commit 04b61d5943ecf12338ff15181ff01ba6fd2f143b
Author: Marko A. Rodriguez 
Date:   2017-08-30T14:33:34Z

generalized match() to locally compute with all barriers, not just reducing 
barriers.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (TINKERPOP-1762) Make MatchStep analyze mid-clause variables for executing ordering purposes.

2017-08-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16147291#comment-16147291
 ] 

ASF GitHub Bot commented on TINKERPOP-1762:
---

Github user dkuppitz commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/701#discussion_r136081039
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java
 ---
@@ -513,8 +513,15 @@ public int hashCode() {
 this.scopeKeys = new HashSet<>();
 if (null != this.selectKey)
 this.scopeKeys.add(this.selectKey);
-if (this.getNextStep() instanceof WhereTraversalStep || 
this.getNextStep() instanceof WherePredicateStep)
-this.scopeKeys.addAll(((Scoping) 
this.getNextStep()).getScopeKeys());
+final Set endLabels = ((MatchStep) 
this.getTraversal().getParent()).getMatchEndLabels();
+Stream.concat(
+
TraversalHelper.getStepsOfAssignableClassRecursively(WherePredicateStep.class, 
this.getTraversal()).stream(),
+
TraversalHelper.getStepsOfAssignableClassRecursively(WhereTraversalStep.class, 
this.getTraversal()).stream()).
+flatMap(s -> 
s.getScopeKeys().stream()).filter(endLabels::contains).forEach(this.scopeKeys::add);
--- End diff --

Alternative solution, not using the slow streaming API:
```
TraversalHelper.anyStepRecursively(step -> {
if (step instanceof WherePredicateStep || step instanceof 
WhereTraversalStep) {
for (final String key : ((Scoping) step).getScopeKeys()) {
if (endLabels.contains(key)) this.scopeKeys.add(key);
}
}
return false;
}, this.getTraversal());
```


> Make MatchStep analyze mid-clause variables for executing ordering purposes.
> 
>
> Key: TINKERPOP-1762
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1762
> Project: TinkerPop
>  Issue Type: Bug
>  Components: process
>Affects Versions: 3.2.6
>Reporter: Marko A. Rodriguez
>Assignee: Marko A. Rodriguez
>
> {code}
> gremlin> graph = TinkerGraph.open()
> ==>tinkergraph[vertices:0 edges:0]
> gremlin> graph.io(graphml()).readGraph("data/grateful-dead.xml")
> ==>null
> gremlin> g = graph.traversal()
> ==>graphtraversalsource[tinkergraph[vertices:808 edges:8049], standard]
> gremlin> 
> gremlin> t = g.V().match(
> ..1> __.as("sunshine").has("song", "name", "HERE COMES SUNSHINE"),
> ..2> 
> __.as("sunshine").map(inE("followedBy").values("weight").mean()).as("avg_weight"),
> ..3> __.as("sunshine").inE("followedBy").as("x"),
> ..4> 
> __.as("x").filter(values("weight").where(gte("avg_weight"))).outV().as("followers")
> ..5>   ).
> ..6>   select("followers").by("name"); []
> gremlin> 
> gremlin> t.clone().limit(2)
> ==>LOOKS LIKE RAIN
> ==>PROMISED LAND
> gremlin> t
> Neither the sideEffects, map, nor path has a avg_weight-key: 
> WherePredicateStep(gte(avg_weight))
> Type ':help' or ':h' for help.
> Display stack trace? [yN]
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[GitHub] tinkerpop pull request #701: TINKERPOP-1762: Make MatchStep analyze mid-clau...

2017-08-30 Thread dkuppitz
Github user dkuppitz commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/701#discussion_r136081039
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java
 ---
@@ -513,8 +513,15 @@ public int hashCode() {
 this.scopeKeys = new HashSet<>();
 if (null != this.selectKey)
 this.scopeKeys.add(this.selectKey);
-if (this.getNextStep() instanceof WhereTraversalStep || 
this.getNextStep() instanceof WherePredicateStep)
-this.scopeKeys.addAll(((Scoping) 
this.getNextStep()).getScopeKeys());
+final Set endLabels = ((MatchStep) 
this.getTraversal().getParent()).getMatchEndLabels();
+Stream.concat(
+
TraversalHelper.getStepsOfAssignableClassRecursively(WherePredicateStep.class, 
this.getTraversal()).stream(),
+
TraversalHelper.getStepsOfAssignableClassRecursively(WhereTraversalStep.class, 
this.getTraversal()).stream()).
+flatMap(s -> 
s.getScopeKeys().stream()).filter(endLabels::contains).forEach(this.scopeKeys::add);
--- End diff --

Alternative solution, not using the slow streaming API:
```
TraversalHelper.anyStepRecursively(step -> {
if (step instanceof WherePredicateStep || step instanceof 
WhereTraversalStep) {
for (final String key : ((Scoping) step).getScopeKeys()) {
if (endLabels.contains(key)) this.scopeKeys.add(key);
}
}
return false;
}, this.getTraversal());
```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (TINKERPOP-1764) Generalize MatchStep to localize all barriers, not just reducing barriers.

2017-08-30 Thread Marko A. Rodriguez (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1764?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16147285#comment-16147285
 ] 

Marko A. Rodriguez commented on TINKERPOP-1764:
---

{code}
gremlin> g.V().match(
..1>   
__.as('a').outE('created').order().by('weight',decr).limit(1).inV().as('b'),
..2>   __.as('b').has('lang','java')
..3> ).select('a','b').by('name')
==>[a:marko,b:lop]
{code}

The question becomes, should this return 3 things?

{code}
marko,lop
peter,lop
josh,ripple
{code}

I believe so.

> Generalize MatchStep to localize all barriers, not just reducing barriers.
> --
>
> Key: TINKERPOP-1764
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1764
> Project: TinkerPop
>  Issue Type: Bug
>  Components: process
>Affects Versions: 3.2.6
>Reporter: Marko A. Rodriguez
>
> Given the semantics of order()/aggregate()/dedup(), this should work 
> currently (perhaps), but I will make it explicit in MatchStep and provide 
> test cases to ensure expected behavior. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (TINKERPOP-1764) Generalize MatchStep to localize all barriers, not just reducing barriers.

2017-08-30 Thread Marko A. Rodriguez (JIRA)
Marko A. Rodriguez created TINKERPOP-1764:
-

 Summary: Generalize MatchStep to localize all barriers, not just 
reducing barriers.
 Key: TINKERPOP-1764
 URL: https://issues.apache.org/jira/browse/TINKERPOP-1764
 Project: TinkerPop
  Issue Type: Bug
  Components: process
Affects Versions: 3.2.6
Reporter: Marko A. Rodriguez


Given the semantics of order()/aggregate()/dedup(), this should work currently 
(perhaps), but I will make it explicit in MatchStep and provide test cases to 
ensure expected behavior. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Closed] (TINKERPOP-1763) Order() not respected inside Match()

2017-08-30 Thread Marko A. Rodriguez (JIRA)

 [ 
https://issues.apache.org/jira/browse/TINKERPOP-1763?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Marko A. Rodriguez closed TINKERPOP-1763.
-
Resolution: Invalid

I discussed the problem with Duy and explained that barriers inside 
match-clauses are not global as patterns are executed in arbitrary order. 
Closing.

> Order() not respected inside Match()
> 
>
> Key: TINKERPOP-1763
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1763
> Project: TinkerPop
>  Issue Type: Bug
>  Components: process
>Affects Versions: 3.2.6
>Reporter: DOAN DuyHai
>
> {code}
> gremlin> graph = TinkerGraph.open()
> ==>tinkergraph[vertices:0 edges:0]
> gremlin> graph.io(graphml()).readGraph('/tmp/grateful-dead.xml')
> ==>null
> gremlin> g = graph.traversal()
> ==>graphtraversalsource[tinkergraph[vertices:808 edges:8049], standard]
> gremlin> g.V().match(
> ..1> __.as("singers").hasLabel("artist"),
> ..2> __.as("singers").in("sungBy").as("songs"),
> ..3> __.as("songs").out("writtenBy").as("writters"),
> ..4> __.as("writters").where(eq("singers")),
> ..5> __.as("writters").dedup().order().by(inE("sungBy").count(), 
> decr).as("ordered_writters")
> ..6> ).
> ..7> select("ordered_writters").
> ..8> project("writter_singer", "songs_count").
> ..9>   by("name").
> .10>   by(inE("sungBy").count())
> ==>[writter_singer:Jorma_Kaukonen,songs_count:4]
> ==>[writter_singer:Hornsby,songs_count:4]
> ==>[writter_singer:Neal_Cassady,songs_count:1]
> ==>[writter_singer:Bob_Dylan,songs_count:22]
> ==>[writter_singer:Unknown,songs_count:6]
> ==>[writter_singer:John_Fogerty,songs_count:5]
> ==>[writter_singer:Joan_Baez,songs_count:10]
> ==>[writter_singer:Stephen_Stills,songs_count:2]
> ==>[writter_singer:Suzanne_Vega,songs_count:2]
> ==>[writter_singer:Etta_James,songs_count:1]
> ==>[writter_singer:Spencer_Davis,songs_count:2]
> ==>[writter_singer:Bo_Diddley,songs_count:7]
> ==>[writter_singer:Hunter,songs_count:3]
> ==>[writter_singer:Garcia,songs_count:146]
> ==>[writter_singer:Grateful_Dead,songs_count:17]
> ==>[writter_singer:Weir,songs_count:99]
> ==>[writter_singer:Mydland,songs_count:18]
> ==>[writter_singer:Lesh,songs_count:19]
> ==>[writter_singer:Pigpen,songs_count:36]
> ==>[writter_singer:Garcia_Lesh,songs_count:3]
> ==>[writter_singer:Donna_Godchaux,songs_count:2]
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


Development branch cleanup

2017-08-30 Thread Daniel Kuppitz
The following branches are scheduled for deletion:

TINKERPOP-1004 -- [TINKERPOP-1004] Make Transaction.commit() failures
consistent across implementations.
TINKERPOP-1142 -- [TINKERPOP-1142] Remove deprecated valueIncr, valueDecr,
keyIncr, keyDecr.
TINKERPOP-1169 -- [TINKERPOP-1169] Remove deprecated
TraversalScriptFunction and TraversalScriptHelper
TINKERPOP-1170 -- [TINKERPOP-1170] Remove deprecated ConfigurationTraversal.
TINKERPOP-1171 -- [TINKERPOP-1171] Remove deprecated TraversalSource.Builder
TINKERPOP-1289 -- [TINKERPOP-1289] Remove deprecated ConnectiveP, AndP, and
OrP constructors.
TINKERPOP-1291 -- [TINKERPOP-1291] Remove deprecated mapValues and mapKeys
methods
TINKERPOP-1385 -- [TINKERPOP-1385] Refactor Profiling test cases
TINKERPOP-1427 -- [TINKERPOP-1427] GraphSON 3.0 needs collection types and
consistent number typing.
TINKERPOP-1445 -- [TINKERPOP-1445] Large nested VertexProperties and
Properties do not get printed well
TINKERPOP-1552 -- [TINKERPOP-1552] C# Gremlin Language Variant
TINKERPOP-1552-master -- [TINKERPOP-1552] C# Gremlin Language Variant
TINKERPOP-1592 -- [TINKERPOP-1592] Add withDetachment() and specify the
"detachment" model.
TINKERPOP-1603 -- [TINKERPOP-1603] Remove support for SASL byte array in
protocol
TINKERPOP-1669 -- [TINKERPOP-1669] EdgeVertexStep should be designed for
extension
TINKERPOP-1679 -- [TINKERPOP-1679] Detached side-effects aren't attached
when remoted
TINKERPOP-1686 -- [TINKERPOP-1686] Make TraversalMetrics thread safe
TINKERPOP-1694 -- [TINKERPOP-1694] Deprecate useMapperFromGraph
TINKERPOP-1698 -- [TINKERPOP-1698] Gryo 3.0
TINKERPOP-1699 -- [TINKERPOP-1699] Remove deprecated userMapperFromGraph
TINKERPOP-1701 -- [TINKERPOP-1701] HaltedTraverserStrategy should recurse
into collections for detachment.
TINKERPOP-1703 -- [TINKERPOP-1703] Make EdgeOtherVertexStep non-final
TINKERPOP-1704 -- [TINKERPOP-1704] XXXTranslators are not being respective
of BulkSet and Tree.
TINKERPOP-1706 -- [TINKERPOP-1706] Remove deprecated ScriptEngineCache and
related dead code
TINKERPOP-1708 -- [TINKERPOP-1708] Add a "Note on Scopes" document
TINKERPOP-1709 -- [TINKERPOP-1709] Add a list of all the steps that support
by()/from()/to()/as()/option()
TINKERPOP-1710 -- [TINKERPOP-1710] Add a note on tree() by-modulation and
uniqueness of tree branches.
TINKERPOP-1714 -- [TINKERPOP-1714] Gremlin Server scriptEvaluationTimeout
should take into account request arrival time
TINKERPOP-1716 -- [TINKERPOP-1716] Traversal strategies are not applied
with remote in Gremlin Console
TINKERPOP-1718 -- [TINKERPOP-1718] Deprecate GryoLiteMessageSerializerV1d0
TINKERPOP-1719 -- [TINKERPOP-1719] Remove deprecated Traversal related code
TINKERPOP-1720 -- [TINKERPOP-1720] Remove deprecated Hadoop code
TINKERPOP-1721 -- [TINKERPOP-1721] Remove deprecated Bindings related code
TINKERPOP-1724 -- [TINKERPOP-1724] Remove deprecated ScriptElementFactory
TINKERPOP-1727 -- [TINKERPOP-1727] Bytecode object shallow copied when
traversals are cloned
TINKERPOP-1729 -- [TINKERPOP-1729] Remove deprecated select steps.
TINKERPOP-1736 -- [TINKERPOP-1736] Sack step evaluated by groovy interprets
numbers in an unexpected way
TINKERPOP-1736-master -- [TINKERPOP-1736] Sack step evaluated by groovy
interprets numbers in an unexpected way
TINKERPOP-1740 -- [TINKERPOP-1740] Add vertex parameter overload to to()
and from()
TINKERPOP-1742 -- [TINKERPOP-1742] RangeByIsCountStrategy fails for
ConnectiveSteps
TINKERPOP-1742-master -- [TINKERPOP-1742] RangeByIsCountStrategy fails for
ConnectiveSteps
TINKERPOP-1743 -- [TINKERPOP-1743] LambdaRestrictionStrategy does not catch
lambdas passed to sack()
TINKERPOP-1744 -- [TINKERPOP-1744] Gremlin .NET: Exception from sync
execution gets wrapped in AggregateException
TINKERPOP-1747 -- [TINKERPOP-1747] Streamline inheritance for
gremlin-python GraphSON serializer classes
TINKERPOP-1748 -- [TINKERPOP-1748] Callout comments break code snippets
TINKERPOP-1749 -- [TINKERPOP-1749] Bump to Netty 4.0.50
TINKERPOP-1753 -- [TINKERPOP-1753] OrderStep not able to order by
non-integer numbers
TINKERPOP-741-master -- [TINKERPOP-741] Remove Options For Transaction Retry
TINKERPOP-832 -- [TINKERPOP-832] Remove deprecated addV/E/InE/OutE methods
TINKERPOP-834 -- [TINKERPOP-834] Remove deprecated sack() method
TINKERPOP-880 -- [TINKERPOP-880] Remove deprecated GroupStepV3d0 and
GroupSideEffectStepV3d0

If there are no objections, I will delete those branches at the end of this
week.

Cheers,
Daniel


[jira] [Updated] (TINKERPOP-1763) Order() not respected inside Match()

2017-08-30 Thread stephen mallette (JIRA)

 [ 
https://issues.apache.org/jira/browse/TINKERPOP-1763?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

stephen mallette updated TINKERPOP-1763:

Component/s: (was: server)
 process

> Order() not respected inside Match()
> 
>
> Key: TINKERPOP-1763
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1763
> Project: TinkerPop
>  Issue Type: Bug
>  Components: process
>Affects Versions: 3.2.6
>Reporter: DOAN DuyHai
>
> {code}
> gremlin> graph = TinkerGraph.open()
> ==>tinkergraph[vertices:0 edges:0]
> gremlin> graph.io(graphml()).readGraph('/tmp/grateful-dead.xml')
> ==>null
> gremlin> g = graph.traversal()
> ==>graphtraversalsource[tinkergraph[vertices:808 edges:8049], standard]
> gremlin> g.V().match(
> ..1> __.as("singers").hasLabel("artist"),
> ..2> __.as("singers").in("sungBy").as("songs"),
> ..3> __.as("songs").out("writtenBy").as("writters"),
> ..4> __.as("writters").where(eq("singers")),
> ..5> __.as("writters").dedup().order().by(inE("sungBy").count(), 
> decr).as("ordered_writters")
> ..6> ).
> ..7> select("ordered_writters").
> ..8> project("writter_singer", "songs_count").
> ..9>   by("name").
> .10>   by(inE("sungBy").count())
> ==>[writter_singer:Jorma_Kaukonen,songs_count:4]
> ==>[writter_singer:Hornsby,songs_count:4]
> ==>[writter_singer:Neal_Cassady,songs_count:1]
> ==>[writter_singer:Bob_Dylan,songs_count:22]
> ==>[writter_singer:Unknown,songs_count:6]
> ==>[writter_singer:John_Fogerty,songs_count:5]
> ==>[writter_singer:Joan_Baez,songs_count:10]
> ==>[writter_singer:Stephen_Stills,songs_count:2]
> ==>[writter_singer:Suzanne_Vega,songs_count:2]
> ==>[writter_singer:Etta_James,songs_count:1]
> ==>[writter_singer:Spencer_Davis,songs_count:2]
> ==>[writter_singer:Bo_Diddley,songs_count:7]
> ==>[writter_singer:Hunter,songs_count:3]
> ==>[writter_singer:Garcia,songs_count:146]
> ==>[writter_singer:Grateful_Dead,songs_count:17]
> ==>[writter_singer:Weir,songs_count:99]
> ==>[writter_singer:Mydland,songs_count:18]
> ==>[writter_singer:Lesh,songs_count:19]
> ==>[writter_singer:Pigpen,songs_count:36]
> ==>[writter_singer:Garcia_Lesh,songs_count:3]
> ==>[writter_singer:Donna_Godchaux,songs_count:2]
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (TINKERPOP-1763) Order() not respected inside Match()

2017-08-30 Thread DOAN DuyHai (JIRA)
DOAN DuyHai created TINKERPOP-1763:
--

 Summary: Order() not respected inside Match()
 Key: TINKERPOP-1763
 URL: https://issues.apache.org/jira/browse/TINKERPOP-1763
 Project: TinkerPop
  Issue Type: Bug
  Components: server
Affects Versions: 3.2.6
Reporter: DOAN DuyHai


{code}
gremlin> graph = TinkerGraph.open()
==>tinkergraph[vertices:0 edges:0]
gremlin> graph.io(graphml()).readGraph('/tmp/grateful-dead.xml')
==>null
gremlin> g = graph.traversal()
==>graphtraversalsource[tinkergraph[vertices:808 edges:8049], standard]
gremlin> g.V().match(
..1> __.as("singers").hasLabel("artist"),
..2> __.as("singers").in("sungBy").as("songs"),
..3> __.as("songs").out("writtenBy").as("writters"),
..4> __.as("writters").where(eq("singers")),
..5> __.as("writters").dedup().order().by(inE("sungBy").count(), 
decr).as("ordered_writters")
..6> ).
..7> select("ordered_writters").
..8> project("writter_singer", "songs_count").
..9>   by("name").
.10>   by(inE("sungBy").count())
==>[writter_singer:Jorma_Kaukonen,songs_count:4]
==>[writter_singer:Hornsby,songs_count:4]
==>[writter_singer:Neal_Cassady,songs_count:1]
==>[writter_singer:Bob_Dylan,songs_count:22]
==>[writter_singer:Unknown,songs_count:6]
==>[writter_singer:John_Fogerty,songs_count:5]
==>[writter_singer:Joan_Baez,songs_count:10]
==>[writter_singer:Stephen_Stills,songs_count:2]
==>[writter_singer:Suzanne_Vega,songs_count:2]
==>[writter_singer:Etta_James,songs_count:1]
==>[writter_singer:Spencer_Davis,songs_count:2]
==>[writter_singer:Bo_Diddley,songs_count:7]
==>[writter_singer:Hunter,songs_count:3]
==>[writter_singer:Garcia,songs_count:146]
==>[writter_singer:Grateful_Dead,songs_count:17]
==>[writter_singer:Weir,songs_count:99]
==>[writter_singer:Mydland,songs_count:18]
==>[writter_singer:Lesh,songs_count:19]
==>[writter_singer:Pigpen,songs_count:36]
==>[writter_singer:Garcia_Lesh,songs_count:3]
==>[writter_singer:Donna_Godchaux,songs_count:2]

{code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)