Skip to content

Lesson 4 Complex social network analysis

Christopher Rost edited this page Sep 4, 2020 · 8 revisions

Have a look at the Wiki pages of Gradoop for further details.

Test Data Schema

LDBC Schema

All labels start with a lowercase letter in our dataset, so please use 'person' instead of 'Person' in your tasks.

Task - Distribution of male and females students at the given universities.

  • Create a graph that show how many males and females are studying at the universities contained 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

Bonus - Playground

  • Play around with the operators Gradoop offers to learn more about the possibilities of distributed graph analytics.
  • Execute different Operators and Algorithms on Logical Graphs or Graph Collections.
  • Take a look at our publications about Gradoop
Clone this wiki locally