本文整理了Java中org.gradoop.common.model.impl.pojo.Vertex.getGraphIds()
方法的一些代码示例,展示了Vertex.getGraphIds()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Vertex.getGraphIds()
方法的具体详情如下:
包路径:org.gradoop.common.model.impl.pojo.Vertex
类名称:Vertex
方法名:getGraphIds
暂无
代码示例来源:origin: org.gradoop/gradoop-flink
@Override
public void flatMap(Vertex value, Collector<Tuple2<Vertex, GradoopId>> out)
throws Exception {
if (value != null) {
for (GradoopId id : value.getGraphIds()) {
reusableTuple.f0 = value;
reusableTuple.f1 = id;
out.collect(reusableTuple);
}
}
}
}
代码示例来源:origin: dbs-leipzig/gradoop
@Override
public void flatMap(Vertex value, Collector<Tuple2<Vertex, GradoopId>> out)
throws Exception {
if (value != null) {
for (GradoopId id : value.getGraphIds()) {
reusableTuple.f0 = value;
reusableTuple.f1 = id;
out.collect(reusableTuple);
}
}
}
}
代码示例来源:origin: dbs-leipzig/gradoop
@Override
public V join(V vertex,
Tuple2<GradoopId, GradoopIdSet> vertexWithGraphIds) {
vertex.getGraphIds().addAll(vertexWithGraphIds.f1);
return vertex;
}
代码示例来源:origin: org.gradoop/gradoop-flink
/**
* {@inheritDoc}
*/
@Override
public V join(V vertex,
Tuple2<GradoopId, GradoopIdSet> vertexWithGraphIds) {
vertex.getGraphIds().addAll(vertexWithGraphIds.f1);
return vertex;
}
代码示例来源:origin: org.gradoop/gradoop-flink
@Override
public void flatMap(V v, Collector<Tuple2<V, GradoopId>> collector) throws
Exception {
for (GradoopId graphId : v.getGraphIds()) {
collector.collect(new Tuple2<>(v, graphId));
}
}
}
代码示例来源:origin: dbs-leipzig/gradoop
@Override
public void flatMap(V v, Collector<Tuple2<V, GradoopId>> collector) throws
Exception {
for (GradoopId graphId : v.getGraphIds()) {
collector.collect(new Tuple2<>(v, graphId));
}
}
}
代码示例来源:origin: org.gradoop/gradoop-flink
boolean containedInGraph = v.getGraphIds().contains(gh.getId());
boolean firstOccurrence = !usedVertexIds.contains(v.getId());
代码示例来源:origin: org.gradoop/gradoop-flink
@Override
public void flatMap(Vertex vertex, Collector<VertexString> collector)
throws Exception {
GradoopId vertexId = vertex.getId();
String vertexLabel = "(" + vertex.getId() + ")";
for (GradoopId graphId : vertex.getGraphIds()) {
collector.collect(new VertexString(graphId, vertexId, vertexLabel));
}
}
}
代码示例来源:origin: org.gradoop/gradoop-flink
@Override
public void flatMap(Vertex vertex, Collector<VertexString> collector) throws Exception {
GradoopId vertexId = vertex.getId();
String vertexLabel = "(" + label(vertex) + ")";
for (GradoopId graphId : vertex.getGraphIds()) {
collector.collect(new VertexString(graphId, vertexId, vertexLabel));
}
}
}
代码示例来源:origin: dbs-leipzig/gradoop
@Override
public void flatMap(Vertex vertex, Collector<VertexString> collector)
throws Exception {
GradoopId vertexId = vertex.getId();
String vertexLabel = "(" + vertex.getId() + ")";
for (GradoopId graphId : vertex.getGraphIds()) {
collector.collect(new VertexString(graphId, vertexId, vertexLabel));
}
}
}
代码示例来源:origin: dbs-leipzig/gradoop
@Override
public void flatMap(Vertex vertex, Collector<VertexString> collector) throws Exception {
GradoopId vertexId = vertex.getId();
String vertexLabel = "(" + label(vertex) + ")";
for (GradoopId graphId : vertex.getGraphIds()) {
collector.collect(new VertexString(graphId, vertexId, vertexLabel));
}
}
}
代码示例来源:origin: dbs-leipzig/gradoop
@Override
public Tuple2<GradoopIdSet, IdWithCandidates<GradoopId>> map(V v)
throws Exception {
reuseTuple.f0 = v.getGraphIds();
reuseTuple.f1.setId(v.getId());
reuseTuple.f1.setCandidates(getCandidates(vertexCount,
ElementMatcher.getMatches(v, queryVertices, DEFAULT_VERTEX_LABEL)));
return reuseTuple;
}
}
代码示例来源:origin: org.gradoop/gradoop-flink
@Override
public Tuple2<GradoopIdSet, IdWithCandidates<GradoopId>> map(V v)
throws Exception {
reuseTuple.f0 = v.getGraphIds();
reuseTuple.f1.setId(v.getId());
reuseTuple.f1.setCandidates(getCandidates(vertexCount,
ElementMatcher.getMatches(v, queryVertices, DEFAULT_VERTEX_LABEL)));
return reuseTuple;
}
}
代码示例来源:origin: dbs-leipzig/gradoop
@Override
public GraphTransaction map(GraphTransaction transaction) throws Exception {
if (graphHeadTransFunc != null) {
transaction.setGraphHead(graphHeadTransFunc.apply(
transaction.getGraphHead(),
graphHeadFactory.initGraphHead(
transaction.getGraphHead().getId(), GradoopConstants.DEFAULT_GRAPH_LABEL)));
}
if (vertexTransFunc != null) {
transaction.setVertices(transaction.getVertices().stream()
.map(vertex -> vertexTransFunc.apply(
vertex,
vertexFactory.initVertex(
vertex.getId(), GradoopConstants.DEFAULT_VERTEX_LABEL, vertex.getGraphIds())))
.collect(Collectors.toSet()));
}
if (edgeTransFunc != null) {
transaction.setEdges(transaction.getEdges().stream()
.map(edge -> edgeTransFunc.apply(
edge,
edgeFactory.initEdge(
edge.getId(), GradoopConstants.DEFAULT_EDGE_LABEL,
edge.getSourceId(), edge.getTargetId(), edge.getGraphIds())))
.collect(Collectors.toSet()));
}
return transaction;
}
}
代码示例来源:origin: org.gradoop/gradoop-flink
@Override
public GraphTransaction map(GraphTransaction transaction) throws Exception {
if (graphHeadTransFunc != null) {
transaction.setGraphHead(graphHeadTransFunc.apply(
transaction.getGraphHead(),
graphHeadFactory.initGraphHead(
transaction.getGraphHead().getId(), GradoopConstants.DEFAULT_GRAPH_LABEL)));
}
if (vertexTransFunc != null) {
transaction.setVertices(transaction.getVertices().stream()
.map(vertex -> vertexTransFunc.apply(
vertex,
vertexFactory.initVertex(
vertex.getId(), GradoopConstants.DEFAULT_VERTEX_LABEL, vertex.getGraphIds())))
.collect(Collectors.toSet()));
}
if (edgeTransFunc != null) {
transaction.setEdges(transaction.getEdges().stream()
.map(edge -> edgeTransFunc.apply(
edge,
edgeFactory.initEdge(
edge.getId(), GradoopConstants.DEFAULT_EDGE_LABEL,
edge.getSourceId(), edge.getTargetId(), edge.getGraphIds())))
.collect(Collectors.toSet()));
}
return transaction;
}
}
代码示例来源:origin: dbs-leipzig/gradoop
break;
case AccumuloTables.KEY.GRAPH:
row.getGraphIds().add(GradoopId.fromString(key.getColumnQualifier().toString()));
break;
default:
代码示例来源:origin: dbs-leipzig/gradoop
@Override
public CSVVertex map(Vertex vertex) throws Exception {
csvVertex.setId(vertex.getId().toString());
csvVertex.setGradoopIds(collectionToCsvString(vertex.getGraphIds()));
csvVertex.setLabel(StringEscaper.escape(vertex.getLabel(), CSVConstants.ESCAPED_CHARACTERS));
csvVertex.setProperties(getPropertyString(vertex, MetaDataSource.VERTEX_TYPE));
return csvVertex;
}
}
代码示例来源:origin: org.gradoop/gradoop-flink
@Override
public CSVVertex map(Vertex vertex) throws Exception {
csvVertex.setId(vertex.getId().toString());
csvVertex.setGradoopIds(collectionToCsvString(vertex.getGraphIds()));
csvVertex.setLabel(StringEscaper.escape(vertex.getLabel(), CSVConstants.ESCAPED_CHARACTERS));
csvVertex.setProperties(getPropertyString(vertex, MetaDataSource.VERTEX_TYPE));
return csvVertex;
}
}
代码示例来源:origin: dbs-leipzig/gradoop
@Test
public void testAppendFromStringWithVariables() {
AsciiGraphLoader<GraphHead, Vertex, Edge> asciiGraphLoader =
AsciiGraphLoader.fromString("g0[(a)-[e]->(b)]", config);
validateCollections(asciiGraphLoader, 1, 2, 1);
validateCaches(asciiGraphLoader, 1, 2, 1);
asciiGraphLoader.appendFromString("g1[(a)-[e]->(b)]");
validateCollections(asciiGraphLoader, 2, 2, 1);
validateCaches(asciiGraphLoader, 2, 2, 1);
GraphHead g1 = asciiGraphLoader.getGraphHeadByVariable("g0");
GraphHead g2 = asciiGraphLoader.getGraphHeadByVariable("g1");
Vertex a = asciiGraphLoader.getVertexByVariable("a");
Edge e = asciiGraphLoader.getEdgeByVariable("e");
assertEquals("Vertex has wrong graph count", 2, a.getGraphCount());
assertTrue("Vertex was not in g1", a.getGraphIds().contains(g1.getId()));
assertTrue("Vertex was not in g2", a.getGraphIds().contains(g2.getId()));
assertEquals("Edge has wrong graph count", 2, e.getGraphCount());
assertTrue("Edge was not in g1", a.getGraphIds().contains(g1.getId()));
assertTrue("Edge was not in g2", a.getGraphIds().contains(g2.getId()));
}
代码示例来源:origin: dbs-leipzig/gradoop
@Test
public void testUpdateFromStringWithVariables2() {
AsciiGraphLoader<GraphHead, Vertex, Edge> asciiGraphLoader =
AsciiGraphLoader.fromString("g[(a)-[e]->(b)]", config);
validateCollections(asciiGraphLoader, 1, 2, 1);
validateCaches(asciiGraphLoader, 1, 2, 1);
asciiGraphLoader.appendFromString("g[(a)-[f]->(c)]");
validateCollections(asciiGraphLoader, 1, 3, 2);
validateCaches(asciiGraphLoader, 1, 3, 2);
GraphHead g = asciiGraphLoader.getGraphHeadByVariable("g");
Vertex c = asciiGraphLoader.getVertexByVariable("c");
Edge f = asciiGraphLoader.getEdgeByVariable("f");
assertTrue("Vertex not in graph", c.getGraphIds().contains(g.getId()));
assertTrue("Edge not in graph", f.getGraphIds().contains(g.getId()));
}
内容来源于网络,如有侵权,请联系作者删除!