-
Notifications
You must be signed in to change notification settings - Fork 0
Lesson 4 Complex social network analysis
Kevin Gómez edited this page Sep 3, 2020
·
8 revisions
Have a look at the Wiki pages of Gradoop for further details.
- Create a graph that show how many males and females are studying at the universities in the test data
Solution
graph = graph.vertexInducedSubgraph(new LabelIsIn<>(
"person", "university"));
graph = graph
.query(
"MATCH (p1:person)-[:studyAt]->(u:university)")
.reduce(new ReduceCombination<>());
// group on vertex and edge labels + count grouped edges
LogicalGraph groupedGraph = graph.callForGraph(
new Grouping.GroupingBuilder()
.setStrategy(GroupingStrategy.GROUP_COMBINE)
.addVertexGroupingKey("gender")
.addVertexGroupingKey("name")
.useEdgeLabel(true).useVertexLabel(true)
.addEdgeAggregateFunction(new Count())
.build());
How many persons know him? Answer: 2
- Play around with the operators Gradoop offers to learn more about the possibilities of Gradoop offers.