Package com.tinkerpop.gremlin.structure

Examples of com.tinkerpop.gremlin.structure.Vertex.addEdge()


        @Test
        @FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
        public void shouldInjectAnIdAndReturnBySpecifiedIdForEdge() {
            final IdGraphStrategy strategy = (IdGraphStrategy) ((StrategyWrappedGraph) g).getStrategy().getGraphStrategy().get();
            final Vertex v = g.addVertex(T.id, "test", "something", "else");
            final Edge e = v.addEdge("self", v, T.id, "edge-id", "try", "this");
            tryCommit(g, c -> {
                assertNotNull(e);
                assertEquals("edge-id", e.id());
                assertEquals("edge-id", e.property(strategy.getIdKey()).value());
                assertEquals("this", e.property("try").value());
View Full Code Here


        @Test
        @FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
        public void shouldCreateAnIdAndReturnByCreatedIdForEdge() {
            final IdGraphStrategy strategy = (IdGraphStrategy) ((StrategyWrappedGraph) g).getStrategy().getGraphStrategy().get();
            final Vertex v = g.addVertex("something", "else");
            final Edge e = v.addEdge("self", v, "try", "this");
            tryCommit(g, c -> {
                assertNotNull(e);
                assertNotNull(UUID.fromString(e.id().toString()));
                assertNotNull(UUID.fromString(e.property(strategy.getIdKey()).value().toString()));
                assertEquals("this", e.property("try").value());
View Full Code Here

        @Test
        @FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
        public void shouldCreateAnIdAndReturnByCreatedId() {
            final IdGraphStrategy strategy = (IdGraphStrategy) ((StrategyWrappedGraph) g).getStrategy().getGraphStrategy().get();
            final Vertex v = g.addVertex("something", "else");
            final Edge e = v.addEdge("self", v, "try", "this");
            tryCommit(g, c -> {
                assertNotNull(e);
                assertEquals("100", e.id());
                assertEquals("100", e.property(strategy.getIdKey()).value());
                assertEquals("this", e.property("try").value());
View Full Code Here

        this.stepLabel = stepLabel;
        super.setConsumer(traverser -> {
            final Vertex currentVertex = traverser.get();
            final Vertex otherVertex = traverser.path().get(stepLabel);
            if (direction.equals(Direction.IN) || direction.equals(Direction.BOTH)) {
                otherVertex.addEdge(edgeLabel, currentVertex, propertyKeyValues);
            }
            if (direction.equals(Direction.OUT) || direction.equals(Direction.BOTH)) {
                currentVertex.addEdge(edgeLabel, otherVertex, propertyKeyValues);
            }
        });
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.