Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Neo4j 3.x

You're reading from   Learning Neo4j 3.x Effective data modeling, performance tuning and data visualization techniques in Neo4j

Arrow left icon
Product type Paperback
Published in Oct 2017
Publisher Packt
ISBN-13 9781786466143
Length 316 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Jerome Baton Jerome Baton
Author Profile Icon Jerome Baton
Jerome Baton
Rik Van Bruggen Rik Van Bruggen
Author Profile Icon Rik Van Bruggen
Rik Van Bruggen
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Preface 1. Graph Theory and Databases 2. Getting Started with Neo4j FREE CHAPTER 3. Modeling Data for Neo4j 4. Getting Started with Cypher 5. Awesome Procedures on Cypher - APOC 6. Extending Cypher 7. Query Performance Tuning 8. Importing Data into Neo4j 9. Going Spatial 10. Security 11. Visualizations for Neo4j 12. Data Refactoring with Neo4j 13. Clustering 14. Use Case Example - Recommendations 15. Use Case Example - Impact Analysis and Simulation 16. Tips and Tricks

LOAD CSV


LOAD CSV is a built-in Cypher instruction that can be used with the filename of a CSV file, and Cypher instructions to play for each line of the CSV file.

Note

CSV stands for comma-separated value. Normally, each column of the file is separated by a comma, which was not a good idea. It is far more common to see the semicolon character used as a separator, which is a better choice, but my personal choice is to use the Unix pipe character | as a separator. The first line may be a list of headers. CSV is text; you do not need a spreadsheet to open CSV files.

Here is a simple example taken from the Neo4j website. It will load data from a URL and, for each line of this source, will run the CREATE command. I have highlighted the points that I'll discuss in this chapter:

LOADCSVWITHHEADERSFROM'https://neo4j.com/docs/cypher-refcard/3.2/csv/artists-with-headers.csv'ASlineCREATE(:Artist{name:line.Name,year:toInt(line.Year)})

LOAD CSV WITH HEADERS means that the first line of the CSV input will...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image