@Override public Edge initEdge(final GradoopId id, final String label, final GradoopId sourceVertexId, final GradoopId targetVertexId, final Properties properties, GradoopIdSet graphIds) { checkNotNull(id, "Identifier was null"); checkNotNull(label, "Label was null"); checkNotNull(sourceVertexId, "Source vertex id was null"); checkNotNull(targetVertexId, "Target vertex id was null"); return new Edge(id, label, sourceVertexId, targetVertexId, properties, graphIds); }
GradoopId targetId = cell.getVertexData(); edges.add(new Edge(edgeId, label, sourceId, targetId, properties, graphIds));
GradoopId targetId = cell.getVertexData(); edges.add(new Edge(edgeId, label, sourceId, targetId, properties, graphIds));
private GraphTransaction getGraphTransaction() { GraphHead graphHead = new GraphHead(GradoopId.get(), "Test", null); GradoopIdSet graphIds = GradoopIdSet.fromExisting(graphHead.getId()); Set<Vertex> vertices = Sets.newHashSet(); Set<Edge> edges = Sets.newHashSet(); Properties aProperties = new Properties(); aProperties.set("x", 1); Vertex v1 = new Vertex(GradoopId.get(), "A", aProperties, graphIds); Vertex v2 = new Vertex(GradoopId.get(), "B", null, graphIds); vertices.add(v1); vertices.add(v2); Properties loopProperties = new Properties(); edges.add(new Edge(GradoopId.get(), "loop", v1.getId(), v1.getId(), loopProperties, graphIds)); edges.add(new Edge(GradoopId.get(), "m", v1.getId(), v2.getId(), null, graphIds)); edges.add(new Edge(GradoopId.get(), "m", v1.getId(), v2.getId(), null, graphIds)); edges.add(new Edge(GradoopId.get(), "m", v2.getId(), v1.getId(), null, graphIds)); return new GraphTransaction(graphHead, vertices, edges); } }
@Nonnull SortedKeyValueIterator<Key, Value> source ) throws IOException { Edge row = new Edge(); if (!source.hasTop()) { return null;
edges.add(new Edge(GradoopId.get(), label, sourceId, targetId, null, graphIds));
edges.add(new Edge(GradoopId.get(), label, sourceId, targetId, null, graphIds));
/** * Get a logical graph with the schema and all properties of "input_extended_properties" csv * graph from resources directory. A GDL file can not be used while types like * LocalDate etc. are not supported. * * @return the logical graph representing the expected graph */ protected LogicalGraph getExtendedLogicalGraph() { GradoopId idUser = GradoopId.get(); GradoopId idPost = GradoopId.get(); GradoopId idForum = GradoopId.get(); GradoopIdSet heads = GradoopIdSet.fromExisting(idForum); Properties properties = Properties.createFromMap(PROPERTY_MAP); DataSet<GraphHead> graphHead = getExecutionEnvironment().fromElements( new GraphHead(idForum, "Forum", properties) ); DataSet<Vertex> vertices = getExecutionEnvironment().fromElements( new Vertex(idUser, "User", properties, heads), new Vertex(idPost, "Post", properties, heads) ); DataSet<Edge> edges = getExecutionEnvironment().fromElements( new Edge(GradoopId.get(), "creatorOf", idUser, idPost, properties, heads) ); return getConfig().getLogicalGraphFactory().fromDataSets(graphHead, vertices, edges); }