Skip to content

Import data

You can import data in the following formats:

Besides that, you can create data directly from code using the object graph mapper or query builder.

Tip

The fastest way to import data into Memgraph is by using the LOAD CSV clause. It's recommended to first create indexes using the CREATE INDEX clause. You can create them by executing the Cypher query or using object graph mapper.

CSV

To import CSV file into Memgraph via GQLAlchemy, you can use the LOAD CSV clause. That clause can be used by executing the Cypher query or by building the query with the query builder. Another way of importing CSV data into Memgraph is by translating it into a graph.

JSON

To import JSON files into Memgraph via GQLAlchemy, you can call procedures from the json_util module available in MAGE library. If the JSON data is formatted in a particular style, you can call the import_util.json() procedure from MAGE. The procedures can be called by executing Cypher queries or using the query builder.

Parquet, ORC or IPC/Feather/Arrow

To import Parquet, ORC or IPC/Feather/Arrow file into Memgraph via GQLAlchemy, transform table data from a file into a graph.

Note

If you want to read from a file system not currently supported by GQLAlchemy, or use a file type currently not readable, you can implement your own by making a custom file system importer.

Python graphs - NetworkX, PyG or DGL graph

To import NetworkX, PyG or DGL graph into Memgraph via GQLAlchemy, transform the source graph into Memgraph graph.

Kafka, RedPanda or Pulsar data stream

To consume Kafka, RedPanda or Pulsar data stream, you can write a appropriate Cypher queries and execute them, or use GQLAlchemy stream manager for Kafka, RedPanda or Pulsar streams.

Learn more

To learn how to utilize the GQLAlchemy library with Memgraph, check out the how-to guides or sign up for the Getting started with Memgraph and Python course.