Examples of label()


Examples of com.tinkerpop.gremlin.structure.Edge.label()

    @LoadGraphWith(MODERN)
    public void g_v1_outE_asXhereX_inV_hasXname_vadasX_backXhereX() {
        final Traversal<Vertex, Edge> traversal = get_g_v1_outE_asXhereX_inV_hasXname_vadasX_backXhereX(convertToVertexId("marko"));
        printTraversalForm(traversal);
        final Edge edge = traversal.next();
        assertEquals("knows", edge.label());
        assertEquals(convertToVertexId("vadas"), edge.inV().id().next());
        assertEquals(convertToVertexId("marko"), edge.outV().id().next());
        assertEquals(0.5d, edge.<Double>value("weight"), 0.0001d);
        assertFalse(traversal.hasNext());
    }
View Full Code Here

Examples of com.tinkerpop.gremlin.structure.Edge.label()

        traversals.forEach(traversal -> {
            printTraversalForm(traversal);
            assertTrue(traversal.hasNext());
            assertTrue(traversal.hasNext());
            final Edge edge = traversal.next();
            assertEquals("knows", edge.label());
            assertEquals(1.0d, edge.<Double>value("weight"), 0.00001d);
            assertFalse(traversal.hasNext());
            assertFalse(traversal.hasNext());
        });
    }
View Full Code Here

Examples of com.tinkerpop.gremlin.structure.Edge.label()

        assertEquals(e.id(), deserializedEdge.get(GraphSONTokens.ID));
        assertEquals(v1.id(), deserializedEdge.get(GraphSONTokens.OUT));
        assertEquals(v2.id(), deserializedEdge.get(GraphSONTokens.IN));
        assertEquals(v1.label(), deserializedEdge.get(GraphSONTokens.OUT_LABEL));
        assertEquals(v2.label(), deserializedEdge.get(GraphSONTokens.IN_LABEL));
        assertEquals(e.label(), deserializedEdge.get(GraphSONTokens.LABEL));
        assertEquals(GraphSONTokens.EDGE, deserializedEdge.get(GraphSONTokens.TYPE));

        final Map<String, Object> properties = (Map<String, Object>) deserializedEdge.get(GraphSONTokens.PROPERTIES);
        assertNotNull(properties);
        assertEquals(123, properties.get("abc"));
View Full Code Here

Examples of com.tinkerpop.gremlin.structure.Edge.label()

        Set<Edge> edges = new HashSet<>();
        while (traversal.hasNext()) {
            counter++;
            Edge edge = traversal.next();
            edges.add(edge);
            assertTrue(edge.label().equals("knows") || edge.label().equals("created"));
        }
        assertEquals(3, counter);
        assertEquals(3, edges.size());
    }
View Full Code Here

Examples of com.tinkerpop.gremlin.structure.Edge.label()

        Set<Edge> edges = new HashSet<>();
        while (traversal.hasNext()) {
            counter++;
            Edge edge = traversal.next();
            edges.add(edge);
            assertTrue(edge.label().equals("knows") || edge.label().equals("created"));
        }
        assertEquals(3, counter);
        assertEquals(3, edges.size());
    }
View Full Code Here

Examples of com.tinkerpop.gremlin.structure.Edge.label()

        Set<Edge> edges = new HashSet<>();
        while (traversal.hasNext()) {
            counter++;
            Edge edge = traversal.next();
            edges.add(edge);
            assertTrue(edge.label().equals("created"));
            assertEquals(edge.outV().id().next(), convertToVertexId("josh"));
        }
        assertEquals(2, counter);
        assertEquals(2, edges.size());
    }
View Full Code Here

Examples of com.tinkerpop.gremlin.structure.Edge.label()

        Set<Edge> edges = new HashSet<>();
        while (traversal.hasNext()) {
            counter++;
            Edge edge = traversal.next();
            edges.add(edge);
            assertTrue(edge.label().equals("knows") || edge.label().equals("created"));
        }
        assertEquals(3, counter);
        assertEquals(3, edges.size());
    }
View Full Code Here

Examples of com.tinkerpop.gremlin.structure.Edge.label()

        Set<Edge> edges = new HashSet<>();
        while (traversal.hasNext()) {
            counter++;
            Edge edge = traversal.next();
            edges.add(edge);
            assertTrue(edge.label().equals("knows") || edge.label().equals("created"));
        }
        assertEquals(3, counter);
        assertEquals(3, edges.size());
    }
View Full Code Here

Examples of com.tinkerpop.gremlin.structure.Edge.label()

    @LoadGraphWith(MODERN)
    public void g_v4_bothEX1_createdX_localLimitX1X() {
        final Traversal<Vertex, Edge> traversal = get_g_v4_bothEX1_createdX_localLimitX1X(convertToVertexId("josh"));
        printTraversalForm(traversal);
        final Edge edge = traversal.next();
        assertEquals("created", edge.label());
        assertTrue(edge.value("weight").equals(1.0d) || edge.value("weight").equals(0.4d));
        assertFalse(traversal.hasNext());
    }

    @Test
View Full Code Here

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

        public void ser(final GraphSONVertex directionalVertex, final JsonGenerator jsonGenerator) throws IOException {
            final Vertex vertex = directionalVertex.getVertexToSerialize();
            final Map<String, Object> m = new HashMap<>();
            m.put(GraphSONTokens.ID, vertex.id());
            m.put(GraphSONTokens.LABEL, vertex.label());
            m.put(GraphSONTokens.TYPE, GraphSONTokens.VERTEX);

            final Object properties = StreamFactory.stream(vertex.iterators().propertyIterator())
                    .collect(Collectors.groupingBy(vp -> vp.key()));
            final Object hiddens = StreamFactory.stream(vertex.iterators().hiddenPropertyIterator())
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.