gf_find {graphframes}R Documentation

Motif finding: Searching the graph for structural patterns

Description

Motif finding uses a simple Domain-Specific Language (DSL) for expressing structural queries. For example, gf_find(g, "(a)-[e]->(b); (b)-[e2]->(a)") will search for pairs of vertices a,b connected by edges in both directions. It will return a DataFrame of all such structures in the graph, with columns for each of the named elements (vertices or edges) in the motif. In this case, the returned columns will be in order of the pattern: "a, e, b, e2."

Usage

gf_find(x, pattern)

Arguments

x

An object coercable to a GraphFrame (typically, a gf_graphframe).

pattern

pattern specifying a motif to search for

Examples

## Not run: 
gf_friends(sc) %>%
  gf_find("(a)-[e]->(b); (b)-[e2]->(a)")

## End(Not run)

[Package graphframes version 0.1.2 Index]