/** * {@inheritDoc} * * @deprecated As of release 3.3.5, replaced by {@link AnonymousTraversalSource#withRemote(RemoteConnection)}. * @see <a href="https://issues.apache.org/jira/browse/TINKERPOP-2078">TINKERPOP-2078</a> */ @Override @Deprecated public GraphTraversalSource withRemote(final RemoteConnection connection) { // check if someone called withRemote() more than once, so just release resources on the initial // connection as you can't have more than one. maybe better to toss IllegalStateException?? if (this.connection != null) throw new IllegalStateException(String.format("TraversalSource already configured with a RemoteConnection [%s]", connection)); final GraphTraversalSource clone = this.clone(); clone.connection = connection; clone.getStrategies().addStrategies(new RemoteStrategy(connection)); return clone; }
public GraphTraversalSource withBulk(final boolean useBulk) { if (useBulk) return this; final GraphTraversalSource clone = this.clone(); RequirementsStrategy.addRequirements(clone.getStrategies(), TraverserRequirement.ONE_BULK); clone.bytecode.addSource(Symbols.withBulk, useBulk); return clone; }
public GraphTraversalSource withPath() { final GraphTraversalSource clone = this.clone(); RequirementsStrategy.addRequirements(clone.getStrategies(), TraverserRequirement.PATH); clone.bytecode.addSource(Symbols.withPath); return clone; }
/** * Spawns a {@link GraphTraversal} starting with all vertices or some subset of vertices as specified by their * unique identifier. */ public GraphTraversal<Vertex, Vertex> V(final Object... vertexIds) { final GraphTraversalSource clone = this.clone(); clone.bytecode.addStep(GraphTraversal.Symbols.V, vertexIds); final GraphTraversal.Admin<Vertex, Vertex> traversal = new DefaultGraphTraversal<>(clone); return traversal.addStep(new GraphStep<>(traversal, Vertex.class, true, vertexIds)); }
/** * Spawns a {@link GraphTraversal} by adding a vertex with the specified label. */ public GraphTraversal<Vertex, Vertex> addV(final String label) { final GraphTraversalSource clone = this.clone(); clone.bytecode.addStep(GraphTraversal.Symbols.addV, label); final GraphTraversal.Admin<Vertex, Vertex> traversal = new DefaultGraphTraversal<>(clone); return traversal.addStep(new AddVertexStartStep(traversal, label)); }
/** * Spawns a {@link GraphTraversal} by adding a vertex with the label as determined by a {@link Traversal}. */ public GraphTraversal<Vertex, Vertex> addV(final Traversal<?, String> vertexLabelTraversal) { final GraphTraversalSource clone = this.clone(); clone.bytecode.addStep(GraphTraversal.Symbols.addV, vertexLabelTraversal); final GraphTraversal.Admin<Vertex, Vertex> traversal = new DefaultGraphTraversal<>(clone); return traversal.addStep(new AddVertexStartStep(traversal, vertexLabelTraversal)); }
/** * Spawns a {@link GraphTraversal} starting it with arbitrary values. */ public <S> GraphTraversal<S, S> inject(S... starts) { final GraphTraversalSource clone = this.clone(); clone.bytecode.addStep(GraphTraversal.Symbols.inject, starts); final GraphTraversal.Admin<S, S> traversal = new DefaultGraphTraversal<>(clone); return traversal.addStep(new InjectStep<S>(traversal, starts)); }
/** * Spawns a {@link GraphTraversal} by adding a edge with a label as specified by the provided {@link Traversal}. */ public GraphTraversal<Edge, Edge> addE(final Traversal<?, String> edgeLabelTraversal) { final GraphTraversalSource clone = this.clone(); clone.bytecode.addStep(GraphTraversal.Symbols.addE, edgeLabelTraversal); final GraphTraversal.Admin<Edge, Edge> traversal = new DefaultGraphTraversal<>(clone); return traversal.addStep(new AddEdgeStartStep(traversal, edgeLabelTraversal)); }
/** * Spawns a {@link GraphTraversal} by adding a vertex with the default label. */ public GraphTraversal<Vertex, Vertex> addV() { final GraphTraversalSource clone = this.clone(); clone.bytecode.addStep(GraphTraversal.Symbols.addV); final GraphTraversal.Admin<Vertex, Vertex> traversal = new DefaultGraphTraversal<>(clone); return traversal.addStep(new AddVertexStartStep(traversal, (String)null)); }
/** * Spawns a {@link GraphTraversal} by adding a edge with the specified label. */ public GraphTraversal<Edge, Edge> addE(final String label) { final GraphTraversalSource clone = this.clone(); clone.bytecode.addStep(GraphTraversal.Symbols.addE, label); final GraphTraversal.Admin<Edge, Edge> traversal = new DefaultGraphTraversal<>(clone); return traversal.addStep(new AddEdgeStartStep(traversal, label)); }
/** * Spawns a {@link GraphTraversal} starting with all edges or some subset of edges as specified by their unique * identifier. */ public GraphTraversal<Edge, Edge> E(final Object... edgesIds) { final GraphTraversalSource clone = this.clone(); clone.bytecode.addStep(GraphTraversal.Symbols.E, edgesIds); final GraphTraversal.Admin<Edge, Edge> traversal = new DefaultGraphTraversal<>(clone); return traversal.addStep(new GraphStep<>(traversal, Edge.class, true, edgesIds)); }
/** * Performs a read or write based operation on the {@link Graph} backing this {@code GraphTraversalSource}. This * step can be accompanied by the {@link GraphTraversal#with(String, Object)} modulator for further configuration * and must be accompanied by a {@link GraphTraversal#read()} or {@link GraphTraversal#write()} modulator step * which will terminate the traversal. * * @param file the name of file for which the read or write will apply - note that the context of how this * parameter is used is wholly dependent on the implementation * @return the traversal with the {@link IoStep} added * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#io-step" target="_blank">Reference Documentation - IO Step</a> * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#read-step" target="_blank">Reference Documentation - Read Step</a> * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#write-step" target="_blank">Reference Documentation - Write Step</a> * @since 3.4.0 */ public <S> GraphTraversal<S, S> io(final String file) { final GraphTraversalSource clone = this.clone(); clone.bytecode.addStep(GraphTraversal.Symbols.io, file); final GraphTraversal.Admin<S,S> traversal = new DefaultGraphTraversal<>(clone); return traversal.addStep(new IoStep<S>(traversal, file)); }
public GraphTraversalSource withBulk(final boolean useBulk) { if (useBulk) return this; final GraphTraversalSource clone = this.clone(); RequirementsStrategy.addRequirements(clone.getStrategies(), TraverserRequirement.ONE_BULK); clone.bytecode.addSource(Symbols.withBulk, useBulk); return clone; }
public GraphTraversalSource withPath() { final GraphTraversalSource clone = this.clone(); RequirementsStrategy.addRequirements(clone.getStrategies(), TraverserRequirement.PATH); clone.bytecode.addSource(Symbols.withPath); return clone; }
/** * Spawns a {@link GraphTraversal} starting with all vertices or some subset of vertices as specified by their * unique identifier. */ public GraphTraversal<Vertex, Vertex> V(final Object... vertexIds) { final GraphTraversalSource clone = this.clone(); clone.bytecode.addStep(GraphTraversal.Symbols.V, vertexIds); final GraphTraversal.Admin<Vertex, Vertex> traversal = new DefaultGraphTraversal<>(clone); return traversal.addStep(new GraphStep<>(traversal, Vertex.class, true, vertexIds)); }
/** * Spawns a {@link GraphTraversal} by adding a vertex with the label as determined by a {@link Traversal}. */ public GraphTraversal<Vertex, Vertex> addV(final Traversal<?, String> vertexLabelTraversal) { final GraphTraversalSource clone = this.clone(); clone.bytecode.addStep(GraphTraversal.Symbols.addV, vertexLabelTraversal); final GraphTraversal.Admin<Vertex, Vertex> traversal = new DefaultGraphTraversal<>(clone); return traversal.addStep(new AddVertexStartStep(traversal, vertexLabelTraversal)); }
/** * Spawns a {@link GraphTraversal} by adding a edge with a label as specified by the provided {@link Traversal}. */ public GraphTraversal<Edge, Edge> addE(final Traversal<?, String> edgeLabelTraversal) { final GraphTraversalSource clone = this.clone(); clone.bytecode.addStep(GraphTraversal.Symbols.addE, edgeLabelTraversal); final GraphTraversal.Admin<Edge, Edge> traversal = new DefaultGraphTraversal<>(clone); return traversal.addStep(new AddEdgeStartStep(traversal, edgeLabelTraversal)); }
/** * Spawns a {@link GraphTraversal} by adding a vertex with the default label. */ public GraphTraversal<Vertex, Vertex> addV() { final GraphTraversalSource clone = this.clone(); clone.bytecode.addStep(GraphTraversal.Symbols.addV); final GraphTraversal.Admin<Vertex, Vertex> traversal = new DefaultGraphTraversal<>(clone); return traversal.addStep(new AddVertexStartStep(traversal, (String)null)); }
/** * Spawns a {@link GraphTraversal} by adding a edge with the specified label. */ public GraphTraversal<Edge, Edge> addE(final String label) { final GraphTraversalSource clone = this.clone(); clone.bytecode.addStep(GraphTraversal.Symbols.addE, label); final GraphTraversal.Admin<Edge, Edge> traversal = new DefaultGraphTraversal<>(clone); return traversal.addStep(new AddEdgeStartStep(traversal, label)); }
/** * Spawns a {@link GraphTraversal} starting with all edges or some subset of edges as specified by their unique * identifier. */ public GraphTraversal<Edge, Edge> E(final Object... edgesIds) { final GraphTraversalSource clone = this.clone(); clone.bytecode.addStep(GraphTraversal.Symbols.E, edgesIds); final GraphTraversal.Admin<Edge, Edge> traversal = new DefaultGraphTraversal<>(clone); return traversal.addStep(new GraphStep<>(traversal, Edge.class, true, edgesIds)); }