Hi all.
I'm struggling with something that seems like it should be so simple that I'm convinced I'm just missing something. I wish to use Neo4j as part of analyzing a large database of patents. The FINAL step will be to use data derived via Neo4j to do statistical analysis. The easiest way to get the derived data into my statistical software would be as a CSV. Consider a super simple example, calculating how many patents each inventor (identified by "hanId") has invented.
In the browser, I can run the command
match (i:Inventor)-[:Invented]->(p:Patent) return i.hanId as Inventor, count(p) as Patents limit 100
To get the results of that query to a csv file, I
a) press the export file button in the results pane
b) choose CSV
c) go to the new tab
d) save it, including selecting a directory and filename using the file dialog.
It gives me just what I want
Inventor,Patents
3342952,1
1484384,1
3554015,1
9816,11
but with many more steps than seems like should be required. In my ideal world, there would be an "Export" command, allowing me to do something like this to replace steps (a) through (d)
match (i:Inventor)-[:Invented]->(p:Patent) return i.hanId as Inventor, count(p) as Patents limit 100 export "/Users/Me/patentCount.csv" replace
That doesn't exist (yet??!! Maybe?? Please??). But, I have to think there is some way to do this programmatically that I just haven't found. The "manual" approach isn't really viable given the number of derived statistics required, how long some of the queries will take, and the need for reproducability (step (d) in particular is not cool for reproducible science).
Like I said, I feel like I'm just overlooking something simple here. Can anyone point me in the right direction?
Thank you.
Glenn