@Override public GraphTraversalSource traversal(final Graph graph, final TraversalStrategy... strategies) { return new GraphTraversalSource(graph).withComputer(FulgoraGraphComputer.class).withStrategies(strategies); }
@Override public GraphTraversalSource traversal(final Graph graph) { return new GraphTraversalSource(graph).withComputer(FulgoraGraphComputer.class); }
@Test public void testSimpleTinkerPopTraversal() { Vertex v1 = graph.addVertex("name", "josh"); Vertex v2 = graph.addVertex("name", "lop"); v1.addEdge("created", v2); //graph.tx().commit(); Object id = graph.traversal().V().has("name", "josh").outE("created").as("e").inV().has("name", "lop").<Edge>select("e").next().id(); assertNotNull(id); }
/** * Get a list of all Configurations, excluding the template configuration; if none exist, * return an empty list * * @return List<Map<String, Object>> */ public List<Map<String, Object>> getConfigurations() { final List<Map<String, Object>> graphConfigurations = graph.traversal().V().has(PROPERTY_TEMPLATE, false).valueMap().toList(); return graphConfigurations.stream().map(this::deserializeVertexProperties).collect(Collectors.toList()); }
@Test public void testBasicComputeJob() { GraphTraversalSource g = graph.traversal().withComputer(FulgoraGraphComputer.class); System.out.println(g.V().count().next()); }
@Override public GraphTraversalSource traversal(final Graph graph, final TraversalStrategy... strategies) { return graph.traversal().withStrategies(strategies); }
@Override public GraphTraversalSource traversal(final Graph graph, final TraversalStrategy... strategies) { final GraphTraversalSource.Builder builder = GraphTraversalSource.build().engine(StandardTraversalEngine.build()); Stream.of(strategies).forEach(builder::with); return builder.create(graph); }
public static TitanVertexStep<Vertex> getReverseTitanVertexStep(final MessageScope.Local<?> scope, final TitanTransaction graph) { FulgoraElementTraversal<Vertex,Edge> result = getReverseTraversal(scope,graph,null); result.asAdmin().applyStrategies(); verifyIncidentTraversal(result); return (TitanVertexStep)result.getStartStep(); }
@Test public void testSimpleTinkerPopTraversal() { Vertex v1 = graph.addVertex("name", "josh"); Vertex v2 = graph.addVertex("name", "lop"); v1.addEdge("created", v2); //graph.tx().commit(); Object id = graph.traversal().V().has("name", "josh").outE("created").as("e").inV().has("name", "lop").<Edge>select("e").next().id(); assertNotNull(id); }
private void updateVertexWithProperties(String propertyKey, Object propertyValue, Map<Object, Object> map) { if (graph.traversal().V().has(propertyKey, propertyValue).hasNext()) { final Vertex v = graph.traversal().V().has(propertyKey, propertyValue).next(); map.forEach((key, value) -> v.property((String) key, value)); graph.tx().commit(); } }
@Test public void testReadGraphOfTheGods() { GraphOfTheGodsFactory.load(graph, null, true); assertEquals(12L, (long) graph.traversal().V().count().next()); Graph g = GraphFactory.open("target/test-classes/cassandra-read.properties"); GraphTraversalSource t = g.traversal(GraphTraversalSource.computer(SparkGraphComputer.class)); assertEquals(12L, (long) t.V().count().next()); }
@Override public GraphTraversalSource traversal(final Graph graph, final TraversalStrategy... strategies) { final GraphTraversalSource.Builder builder = GraphTraversalSource.build().engine(ComputerTraversalEngine.build().computer(FulgoraGraphComputer.class)); Stream.of(strategies).forEach(builder::with); return builder.create(graph); }