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

Marko A. Rodriguez edited comment on TINKERPOP3-694 at 5/26/15 4:03 PM:
------------------------------------------------------------------------

I like the {{select('x','y').addOutE('x','knows','y')}} pattern. And yes, that 
would require a {{Scope.global}} and {{Scope.local}} form for {{AddEdgeStep}}. 
There is a neat strategy called {{ScopingStrategy}} that can do the appropriate 
{{Scope.local}}/{{Scope.global}} setting. Another thing that would be good to 
add to `Scope.global` form would be to select from {{Path}} or from 
{{SideEffects}}. This is how {{WhereStep}} works now and should be the common 
pattern for all such steps. With this, then we wouldn't need the {{Vertex}} and 
{{Iterator<Vertex>}} methods in {{GraphTraversal}} as 
{{g.withSideEffect('x',aVertex)....addE('knows','x')}} would do the trick. 
Likewise, {{g.withSideEffect('x',iteratorOfVertices)...addE('knows','x')}}.


was (Author: okram):
I like the `select('x','y').addOutE('x','knows','y')` pattern. And yes, that 
would require a `Scope.global` and `Scope.local` form for `AddEdgeStep`. There 
is a neat strategy called `ScopingStrategy' that can do the appropriate 
`Scope.local`/`Scope.global` setting. Another thing that would be good to add 
to `Scope.global` form would be to select from `Path` or from `SideEffects`. 
This is how `WhereStep` works now and should be the common pattern for all such 
steps. With this, then we wouldn't need the `Vertex` and `Iterator<Vertex>` 
methods in `GraphTraversal` as 
`g.withSideEffect('x',aVertex)....addE('knows','x')` would do the trick.

> Bulk loading in TP
> ------------------
>
>                 Key: TINKERPOP3-694
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP3-694
>             Project: TinkerPop 3
>          Issue Type: Improvement
>          Components: process
>            Reporter: Ran Magen
>
> Bulk loading can greatly increase performance in many backends, but there is 
> no way for vendors to implement bulk loading in the TP API.
> As for how to do it, I was thinking a vendor could inherit from AddXStep, and 
> implement bulk loading, enabling something like this:
> ArrayList<Object[]> vertices;
> __.inject(vertices).as("x").addV("x") 
> Pros:
> 1. This seems like a standard approach to me, since vendors today batch up 
> queries this way 
> (https://github.com/thinkaurelius/titan/blob/titan09/titan-core/src/main/java/com/thinkaurelius/titan/graphdb/tinkerpop/optimize/TitanVertexStep.java#L72)
> 2.  In contrast to the Graph.addVertex method (and the likes), using a 
> traversal enables taking advantage of other strategies, like EventStrategy, a 
> validation strategy, etc.
> Cons:
> 1. I don't think the mutating steps currently work with "x" (I'm not sure how 
> you call this feature).
> 2. The steps are marked as final.
> Cheers,



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to