neo4j-rstats / neo4r

A Modern and Flexible Neo4J Driver
https://neo4j-rstats.github.io/user-guide/
Other
106 stars 29 forks source link

[Implementation] A node or relationship pipeable extractor #13

Open ColinFay opened 6 years ago

ColinFay commented 6 years ago

Something that could do :

'MATCH p=()-[r:MAINTAINS]->() RETURN p' %>%
  call_api(con, type = "graph")%>%
  extract_nodes() 
# A tibble: 191 x 3
   id    label     properties
   <chr> <list>    <list>    
 1 0     <chr [1]> <list [5]>
 2 1     <chr [1]> <list [1]>
 3 2     <chr [1]> <list [5]>
 4 3     <chr [1]> <list [1]>
 5 4     <chr [1]> <list [5]>
 6 5     <chr [1]> <list [1]>
 7 6     <chr [1]> <list [5]>
 8 7     <chr [1]> <list [1]>
 9 8     <chr [1]> <list [5]>
10 9     <chr [1]> <list [5]>
# ... with 181 more rows

So you can

'MATCH p=()-[r:MAINTAINS]->() RETURN p' %>%
  call_api(con, type = "graph") %>%
  extract_nodes() %>%
  dplyr::count(names)