0Pricing
Neo4j Graph Database Fundamentals · 강의

데이터 가져오기 및 내보내기

외부 소스의 데이터를 Neo4j로 로드하고 다른 용도로 그래프 데이터를 내보내는 다양한 방법을 알아봅니다.

데이터 가져오기 및 내보내기은(는) CoddyKit의 무료 Neo4j Graph Database Fundamentals 강의입니다. 이것은 4개 중 2번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 Neo4j Graph Database Fundamentals 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. Neo4j Graph Database Fundamentals 강의에는 총 4개의 강의가 포함되어 있습니다.

이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.

Moving Data In & Out

In this lesson, we'll explore how to get data into your Neo4j graph database and how to extract it for other uses. This is crucial for integrating Neo4j with existing systems, migrating data, or preparing it for analysis.

Importing Data: An Overview

Bringing external data into Neo4j is a common task. There are several powerful methods:

  • LOAD CSV: For structured data from CSV files.
  • APOC Procedures: For more complex formats like JSON, XML, or data from external databases.
  • Connectors & Drivers: Programmatic import via application code.

We'll focus on the first two methods.

LOAD CSV: The Basics

The LOAD CSV Cypher clause is your go-to for importing data from CSV files. It lets you specify the file path, handle headers, and access each row's data.

Here's a basic structure to read a CSV and return its rows:

LOAD CSV WITH HEADERS FROM 'file:///users.csv' AS row
RETURN row;

Creating Nodes from CSV

Let's say you have a users.csv file with id,name,email columns. You can use LOAD CSV to create User nodes:

LOAD CSV WITH HEADERS FROM 'file:///users.csv' AS row
CREATE (:User {id: row.id, name: row.name, email: row.email});

Creating Relationships from CSV

You can also create relationships. If you have a follows.csv with followerId,followedId, you can connect existing User nodes:

  • We use MATCH to find the existing nodes.
  • CREATE then forms the relationship between them.
LOAD CSV WITH HEADERS FROM 'file:///follows.csv' AS row
MATCH (u1:User {id: row.followerId})
MATCH (u2:User {id: row.followedId})
CREATE (u1)-[:FOLLOWS]->(u2);

Beyond CSV: APOC for Import

For more complex import scenarios, such as JSON or XML files, or data from external databases, the APOC (Awesome Procedures On Cypher) library is invaluable. APOC extends Cypher with hundreds of new procedures and functions.

You'll need to install the APOC plugin for your Neo4j instance to use these features.

Importing JSON with APOC

If you have data in a JSON file, like products.json, you can use apoc.load.json to parse it. Each item in the JSON array can then be processed to create nodes and relationships.

CALL apoc.load.json('file:///products.json') YIELD value
CREATE (:Product {id: value.id, name: value.name, price: toFloat(value.price)});

Exporting Data: An Overview

Just as important as importing is exporting data from your graph. You might need to:

  • Generate reports.
  • Migrate data to another system.
  • Perform advanced analytics outside Neo4j.
  • Create backups.

We'll look at basic Cypher export and advanced APOC export.

Basic Export with Cypher

The simplest way to export data is using standard Cypher MATCH and RETURN statements. The results are displayed in the Neo4j Browser and can be copied or downloaded as CSV/JSON.

MATCH (u:User)-[:FOLLOWS]->(f:User)
RETURN u.name AS Follower, f.name AS Followed;

Advanced Export with APOC

APOC offers powerful procedures to export your graph data directly to files in various formats (CSV, JSON, GraphML, etc.). These are ideal for full graph exports or specific subgraphs.

For example, to export all nodes and relationships to a CSV file:

CALL apoc.export.csv.all('full_graph_export.csv', {});

Import/Export Challenge

You have a CSV file named books.csv with the columns isbn, title, author. You want to import this data into Neo4j, creating nodes with the label Book and properties for each column.

Recap: Data Movement Skills

You've learned essential skills for moving data in and out of Neo4j:

  • LOAD CSV is powerful for structured data.
  • APOC procedures extend capabilities for JSON, complex exports, and more.
  • Standard Cypher MATCH and RETURN allow simple data extraction.

Mastering these techniques is key for managing your graph data effectively!

자주 묻는 질문

“데이터 가져오기 및 내보내기” 강의는 무료인가요?

네 — “데이터 가져오기 및 내보내기” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 Neo4j Graph Database Fundamentals 강의 전체를 잠금 해제할 수 있습니다. Neo4j Graph Database Fundamentals 강의에는 총 4개의 강의가 포함되어 있습니다.

“데이터 가져오기 및 내보내기”에서 뭘 배우나요?

외부 소스의 데이터를 Neo4j로 로드하고 다른 용도로 그래프 데이터를 내보내는 다양한 방법을 알아봅니다. 브라우저에서 직접 실행하는 실습 코드로 Neo4j Graph Database Fundamentals을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.

Neo4j Graph Database Fundamentals을(를) 시작하는 데 경험이 필요한가요?

사전 경험은 필요하지 않습니다. CoddyKit의 Neo4j Graph Database Fundamentals은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 2번째 강의입니다.

“데이터 가져오기 및 내보내기” 강의는 얼마나 걸리나요?

대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.

이 Neo4j Graph Database Fundamentals 강의에서 코드를 작성하고 실행할 수 있나요?

네. 모든 Neo4j Graph Database Fundamentals 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.

이 강의의 모든 강의

  1. Neo4j Browser 및 관리 도구
  2. 데이터 가져오기 및 내보내기
  3. 백업 및 복원 전략
  4. Neo4j 모니터링과 로그 기록
← Neo4j Graph Database Fundamentals(으)로 돌아가기