使用spark graph frame motif search

时间:2017-06-07 10:46:05

标签: apache-spark motif

我使用apache spark使用motif查询创建graphframe。 我创建了所需的边和顶点,然后在查找模式上执行motif查询。我需要通过子进程获取特定节点的所有子节点。例如:

// Vertex DataFrame
val v = sqlContext.createDataFrame(List(
  ("a", "Alice", 34),
  ("b", "Bob", 36),
  ("c", "Charlie", 30),
  ("d", "David", 29),
  ("e", "Esther", 32),
  ("f", "Fanny", 36),
  ("g", "Gabby", 60)
)).toDF("id", "name", "age")
// Edge DataFrame
val e = sqlContext.createDataFrame(List(
  ("a", "b", "friend"),
  ("b", "c", "follow"),
  ("c", "b", "follow"),
  ("f", "c", "follow"),
  ("e", "f", "follow"),
  ("e", "d", "friend"),
  ("d", "a", "friend"),
  ("a", "e", "friend")
)).toDF("src", "dst", "relationship")
// Create a GraphFrame
val g = GraphFrame(v, e)

现在,如果我点击节点a,那么我应该得到一个。

的所有子节点

0 个答案:

没有答案