neo4j-rstats / neo4r

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

[Bug] 'call db.schema' #9

Open ColinFay opened 6 years ago

ColinFay commented 6 years ago

I'm not sure db.schema is returned / parse at it should.

'call db.schema' %>%
  call_api(con)

$nodes
# A tibble: 15 x 1
   row       
   <list>    
 1 <list [0]>
 2 <chr [1]> 
 3 <list [1]>
 4 <list [0]>
 5 <chr [1]> 
 6 <list [0]>
 7 <list [0]>
 8 <chr [1]> 
 9 <list [0]>
10 <list [0]>
11 <chr [1]> 
12 <list [1]>
13 <list [0]>
14 <chr [1]> 
15 <list [1]>

$relationships
# A tibble: 0 x 1
# ... with 1 variable: row <list>

'call db.schema' %>%
  call_api(con, type = "graph") 

$nodes
# A tibble: 5 x 3
  id    label     properties
  <chr> <list>    <list>    
1 -58   <chr [1]> <list [3]>
2 -60   <chr [1]> <list [3]>
3 -59   <chr [1]> <list [3]>
4 -57   <chr [1]> <list [3]>
5 -56   <chr [1]> <list [3]>

$relationships
# A tibble: 2 x 5
  id    type         startNode endNode properties
  <chr> <chr>        <chr>     <chr>   <list>    
1 -24   has_recorded -59       -60     <list [0]>
2 -23   MAINTAINS    -58       -56     <list [0]>

unnest_graph doesn't work here :

'call db.schema' %>%
  call_api(con, type = "graph") %>%
  unnest_graph()
 Erreur : Columns `name`, `constraints` must be length 0, not 1, 1 
ColinFay commented 5 years ago

The issue is there : https://github.com/neo4j-rstats/neo4r/blob/master/R/api_result_parsing.R#L60

Can't flatten it correctly.