cancel
Showing results for 
Search instead for 
Did you mean: 

Hello from Metro-Detroit

bruce
Node Link

In surveying lots of science and technology articles I found graph networks/databases. I'm project-based learning Neo4j by making a knowledge graph of a speculative area of science. It's only 12 nodes so far, but I really need a readback/printout/list? of the cypher code block that I keyed piecemeal into the browser.
--Is there no simple command to do this? The only way is to use APOC to make the browser cough up a block of cypher script to a file? The commands for apoc to do this seem confusing. Could anyone give me a clear example of how export a code block to file and where to find that file. Thanks.

2 REPLIES 2

abk
Neo4j
Neo4j

Hi @bruce !

Cool that you've found us; welcome to the community.

Everyone here is pretty helpful. To help us be helpful, it's good to separate questions into a new topic where the post title itself is the question. I hadn't realized you had an unanswered question.

Are you looking for a way to export the data you've created, or to export Cypher queries?

For data export, you can run a Cypher query to return the part (or all) of the graph that you want to export, then use export to CSV or JSON. You'll want two files, one for the nodes and another for the relationships.

Get all the nodes:

MATCH (n) RETURN n 

Then export to CSV.

Get all the relationships:

MATCH ()-[r]->() RETURN r

Then export that to CSV.

Best,
ABK

Thanks Andreas!

I made the mistake of not writing the cypher code in an editor and saving a copy of it in the editor. I just keyed it in through the browser. So when I wanted to review my cypher code so far, I had to add the apoc plugin, change apoc's conf file so that it could export to a file, export the cypher code block to a file, find out where it saved the file, and took a look.

--If I hadn't been able to search the discussions in this community, I would have given up and found a different way.

Thanks again,
Bruce

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online