Package com.tinkerpop.gremlin.structure

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


            final Object vertexId = getTypedValueFromJsonNode(json.get(GraphSONTokens._ID));
            final Vertex v = g.addVertex(T.id, vertexId);

            for (Map.Entry<String, Object> entry : props.entrySet()) {
                v.property(entry.getKey(), entry.getValue());
            }

            return v;
        }
View Full Code Here


        final ArrayList<Object> friends = new ArrayList<>();
        friends.add("x");
        friends.add(5);
        friends.add(map);

        v.property("friends", friends);

        final List list = g.V().toList();

        final ResponseMessage response = convert(list);
        assertCommon(response);
View Full Code Here

        final ArrayList<Object> friends = new ArrayList<>();
        friends.add("x");
        friends.add(5);
        friends.add(map);

        v.property("friends", friends);

        final List list = g.V().toList();

        final ResponseMessage response = convert(list);
        assertCommon(response);
View Full Code Here

        final Graph ng = TinkerGraph.open();
        g.V().sideEffect(ov -> {
            final Vertex v = ov.get();
            if (v.label().equals("song"))
                ng.addVertex(T.id, Integer.parseInt(v.id().toString()), T.label, "song", "name", v.value("name"), "performances", v.property("performances").orElse(0), "songType", v.property("songType").orElse(""));
            else if (v.label().equals("artist"))
                ng.addVertex(T.id, Integer.parseInt(v.id().toString()), T.label, "artist", "name", v.value("name"));
            else
                throw new RuntimeException("damn");
        }).iterate();
View Full Code Here

        final Graph ng = TinkerGraph.open();
        g.V().sideEffect(ov -> {
            final Vertex v = ov.get();
            if (v.label().equals("song"))
                ng.addVertex(T.id, Integer.parseInt(v.id().toString()), T.label, "song", "name", v.value("name"), "performances", v.property("performances").orElse(0), "songType", v.property("songType").orElse(""));
            else if (v.label().equals("artist"))
                ng.addVertex(T.id, Integer.parseInt(v.id().toString()), T.label, "artist", "name", v.value("name"));
            else
                throw new RuntimeException("damn");
        }).iterate();
View Full Code Here

            final Object o = GraphManager.get().convertId("1");
            final Vertex v = g.addVertex(T.id, o, "something", "else", strategy.getIdKey(), "should be ok to set this as supportsEdgeId=true");
            tryCommit(g, c -> {
                assertNotNull(v);
                assertEquals(o, v.id());
                assertEquals("should be ok to set this as supportsEdgeId=true", v.property(strategy.getIdKey()).value());
                assertEquals("else", v.property("something").value());

                final Vertex found = g.v(o);
                assertEquals(o, found.id());
                assertEquals("should be ok to set this as supportsEdgeId=true", found.property(strategy.getIdKey()).value());
View Full Code Here

            final Vertex v = g.addVertex(T.id, o, "something", "else", strategy.getIdKey(), "should be ok to set this as supportsEdgeId=true");
            tryCommit(g, c -> {
                assertNotNull(v);
                assertEquals(o, v.id());
                assertEquals("should be ok to set this as supportsEdgeId=true", v.property(strategy.getIdKey()).value());
                assertEquals("else", v.property("something").value());

                final Vertex found = g.v(o);
                assertEquals(o, found.id());
                assertEquals("should be ok to set this as supportsEdgeId=true", found.property(strategy.getIdKey()).value());
                assertEquals("else", found.property("something").value());
View Full Code Here

                assertEquals("should be ok to set this as supportsEdgeId=true", v.property(strategy.getIdKey()).value());
                assertEquals("else", v.property("something").value());

                final Vertex found = g.v(o);
                assertEquals(o, found.id());
                assertEquals("should be ok to set this as supportsEdgeId=true", found.property(strategy.getIdKey()).value());
                assertEquals("else", found.property("something").value());
            });

            try {
                v.addEdge("self", v, T.id, o, "something", "else", strategy.getIdKey(), "this should toss and exception as supportsVertexId=false");
View Full Code Here

                assertEquals("else", v.property("something").value());

                final Vertex found = g.v(o);
                assertEquals(o, found.id());
                assertEquals("should be ok to set this as supportsEdgeId=true", found.property(strategy.getIdKey()).value());
                assertEquals("else", found.property("something").value());
            });

            try {
                v.addEdge("self", v, T.id, o, "something", "else", strategy.getIdKey(), "this should toss and exception as supportsVertexId=false");
                fail("An exception should be tossed here because supportsEdgeId=true");
View Full Code Here

            } catch (IllegalArgumentException iae) {
                assertNotNull(iae);
            }

            try {
                v.property(strategy.getIdKey(), "this should toss and exception as supportsVertexId=true");
                fail("An exception should be tossed here because supportsVertexId=true");
            } catch (IllegalArgumentException iae) {
                assertNotNull(iae);
            }
        }
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.