> For the complete documentation index, see [llms.txt](https://docs.graphcommons.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.graphcommons.com/create/importing-data.md). Agents can also search and read this documentation through its [MCP server](https://docs.graphcommons.com/~gitbook/mcp).

# Importing data

Create graphs with your existing data

As your data grows, editing graphs manually becomes inefficient. Importing from external sources is a faster and more scalable solution.

Use simple table structures from spreadsheets (Google Sheets, Excel, CSV), JSON files. You can organize your data with the [Graph Commons Template](https://docs.google.com/spreadsheets/d/13sV8DAROJKfGmkb4olOea4-vPVnBMGv8CrtbR1L8RJw/copy).

## Minimum Structure

**Edges**

Simply create a relationship list to get started. Edges define the connections between your nodes, which will be automatically created from this list.

```csv
From Type, From Name, Edge Type, To Type, To Name
Person,Alice,WORKS AT,Company,Acme
Person,Bob,FOLLOWS,Person,Alice;Claire;David
Person,Charlie,MEMBER OF,Organization,Board A;Board B
```

*5 required columns. Semicolons in "To Name" creates multiple edges.*

**Nodes**

To add more details to your nodes, include a nodes table. You can freely add columns as node properties for richer data representation.

```csv
Node Type, Node Name, Description, Image, ...
Person,Alice,Co-founder of Acme,https://example.com/alice.png
Company,Acme,Collaborative data mapping platform,https://example.com/gc.png
```

*First two columns must match edges. Add columns as needed.*

## Step by Step Guide

1. In your graph editor, click **Import** on the left-hand toolbar.

<figure><img src="https://918529313-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtBdFNYyZE7d8Q4z2K2ZT%2Fuploads%2FwyzfHxvjwpbZVMFL9CJi%2FGCv2-graph-import.png?alt=media&amp;token=88f20f25-cb0b-46e2-8b87-355aec7fec6f" alt=""><figcaption><p>Open the Import panel by clicking "Import" on the left-hand toolbar.</p></figcaption></figure>

**2. Select import format and upload.** Choose your format (Google Sheets, Excel, CSV, JSON, or Graph Commons v1) and upload your file or paste the URL.

<figure><img src="https://918529313-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtBdFNYyZE7d8Q4z2K2ZT%2Fuploads%2FABL15J85yJsbl5eAJpZv%2Fgc-import-1.png?alt=media&amp;token=f2c325ff-93e0-41d1-8577-2139678df230" alt=""><figcaption><p>Import panel with Google Sheets, Excel, CSV, JSON, and Graph Commons V1 options</p></figcaption></figure>

**3. Review import summary.** The import summary shows what will be created. Here, you can:

* Rename node types, edge types, and properties
* Change property types (string, number, boolean)
* Exclude certain types from being imported
* Fix any issues before completing the import

<figure><img src="https://918529313-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtBdFNYyZE7d8Q4z2K2ZT%2Fuploads%2FIxTH6RktBhDNGoWVMuO4%2Fgc-import-2.png?alt=media&amp;token=909f301d-f30d-4007-af70-3462296b716b" alt=""><figcaption><p>Import Summary displays what you are about to import for your review. </p></figcaption></figure>

### Review Checklist

{% tabs %}
{% tab title="Nodes on summary" %}

<figure><img src="https://918529313-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtBdFNYyZE7d8Q4z2K2ZT%2Fuploads%2FFhkQYjO4N5CtrpH3ZsAH%2Fimage.png?alt=media&amp;token=c4e39a84-1133-4532-90fe-dd38458de0c5" alt=""><figcaption><p>Cross check between node sheet and import summary</p></figcaption></figure>
{% endtab %}

{% tab title="Node sheet" %}

<figure><img src="https://918529313-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtBdFNYyZE7d8Q4z2K2ZT%2Fuploads%2FoeDSm4dTNh0QFuXC0RF4%2Fimage.png?alt=media&amp;token=e4bb2841-1a02-483a-8b4d-d397456b72fc" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Edges on summary" %}

<figure><img src="https://918529313-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtBdFNYyZE7d8Q4z2K2ZT%2Fuploads%2FyH7wcBOx8lWTRc1dpqMJ%2Fimage.png?alt=media&amp;token=95fd5595-2ab1-4dbf-9429-e9a715261329" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Edge Sheet" %}

<figure><img src="https://918529313-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtBdFNYyZE7d8Q4z2K2ZT%2Fuploads%2FfJqQcYoS3WWCrM2wuCoh%2Fimage.png?alt=media&amp;token=2ac7e92b-4dd9-43bd-a6d9-b6fcb08b6ebd" alt=""><figcaption><p>Cross check your sheet with import summary</p></figcaption></figure>
{% endtab %}
{% endtabs %}

* [x] **Compare with your sheet:** Ensure consistency between the import summary and your spreadsheet.
* [x] **Expand for details:** View counts of nodes, edges, and types. Check if the numbers make sense.
* [x] **Check warnings:** Warnings (in orange) flag potential issues but won't block the import.&#x20;
* [x] **Review nodes:**
  * Make sure node types are not duplicated due to typos.
  * Verify node count matches your data.
  * Check that property names match the column headers.
* [x] &#x20;**Review edges:**
  * Look for unintended edge types.
  * Confirm edge counts and properties are accurate.
  * Use the info icon to see which node types are connected by each edge type.

You can revise directly in the summary or cancel the import, fix your sheet, and try again.

### Revising your graph model

The import summary allows real-time model editing. You can:

* Rename or deselect node and edge types
* Edit property names
* Choose property data types
* Set edge direction
* Change colors

For example, deselecting “Person” nodes will exclude them from your graph. Same-name types are treated as separate if they originate from different sheets.

Use data types wisely:

* **String:** for text
* **Number:** for numeric values (years, prices, counts)
* **Boolean:** for Yes/No or True/False values

Directed edges are optional, but they affect graph analysis. If you’re new, start with undirected edges.

<figure><img src="https://918529313-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtBdFNYyZE7d8Q4z2K2ZT%2Fuploads%2FfjvJWb177SaSx78YtOVk%2FScreen%20Shot%202022-11-18%20at%2020.19.24.png?alt=media&amp;token=3cd4b091-b20d-4f18-9b9c-1b659fb5e940" alt=""><figcaption><p>Click these areas to make detailed revisions on your graph model</p></figcaption></figure>

### Handling import errors and warnings

* <mark style="color:red;">Errors (in red):</mark> Must be fixed before importing.
* <mark style="color:orange;">Warnings (in orange):</mark> Won’t block import, but reviewing them is recommended.

Common messages:

* <mark style="color:red;">`[number] on 500`</mark> Your import exceeds your plan's limit, [Upgrade your plan](https://graphcommons.com/plans).
* <mark style="color:red;">`Nothing changed`</mark>Sheet is blank or headers are missing.
* <mark style="color:red;">`Can't load your document`</mark>Make sure URL is valid and shared as “Anyone with the link can view”.
* <mark style="color:orange;">Tabs "\_\_\_\_", "\_\_\_\_" have been ignored, we can't find a type column.</mark> The importer will ignore the unformatted tabs in your sheet. Use "Node Type" or "Edge Type" in header.
* <mark style="color:orange;">Node in "\_\_\_" at row # (column To) has been skipped, missing identifier data.</mark> An edge cannot exist without the two nodes it is connecting, therefore where you see this warning message, you will also see:  <mark style="color:orange;">`Edge in "___" at row # has been skipped, missing target node.`</mark> Rows skipped due to blank required cells (e.g., missing target node in an edge row).

## Working with Google Sheets

Google Sheets is commonly used for managing data sets. Using the [Graph Commons Template](https://docs.google.com/spreadsheets/d/13sV8DAROJKfGmkb4olOea4-vPVnBMGv8CrtbR1L8RJw/copy) you can import your data to create a graph with one click!

To create your own import sheet all you need is:

* A node sheet / tab
* An edge sheet / tab
* Share link: Set your sharing options to "Anyone with the link can view"&#x20;

### Node sheet

Create a node sheet using the following columns, the first two are required:

* `Node Type, Name` columns are required.
* `Description` column is optional, used as the first text block in the node cad.
* `Image` column is optional, used to display image on the graph and in node card.
* Other columns are optional and used as properties in your node.

You can create as many node sheets as you want. It is more efficient to work with large data, if you divide your node sheets by their types like People, Organizations, Locations etc.

<figure><img src="https://918529313-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtBdFNYyZE7d8Q4z2K2ZT%2Fuploads%2Fdkt8xujh619sZ7GVIUUL%2Fgc-template-nodes.png?alt=media&amp;token=985f3717-0166-4c3a-a332-d0cff73aeef2" alt=""><figcaption><p>First two columns are required in a node sheet</p></figcaption></figure>

### Edge sheet

Create an edge sheet using the following columns, the first 5 columns are required:

* `From Type, From Name, Edge Type, To Type, To Name` columns are required.
* `To Name` column can have multiple names *separated by semicolons* for adding multiple connections to these nodes at once.
* `Weight` column is optional, default 1, used as thickness of connections and affects layout algorithm and analysis results.
* Other columns are optional and used as properties in your edge.

You can create as many edge sheets/tabs as you want. It is more efficient to work with large data, if you divide your edge sheets by their types (e.g., friendships, collaborations, payments...).&#x20;

<figure><img src="https://918529313-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtBdFNYyZE7d8Q4z2K2ZT%2Fuploads%2FHh9SHRDMYCksuTiOfylE%2Fgc-template-edges.png?alt=media&amp;token=4bc1743d-69e8-4f68-ba1a-ba71a0b3568d" alt=""><figcaption><p>The first 5 columns are required in an edge sheet</p></figcaption></figure>

{% hint style="info" %}
If you have the same connection between the same nodes multiple times, then you should make them a single row and add this info into the Weight column.
{% endhint %}

### Shareable link for import

<figure><img src="https://918529313-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtBdFNYyZE7d8Q4z2K2ZT%2Fuploads%2FOwVpXCWCavMvd3cq0hxc%2Fgc-import-3.png?alt=media&amp;token=f22777e2-d2a8-4b47-bd56-ad0bf9c64c23" alt=""><figcaption><p>Google Sheets share: Anyone with the link can view</p></figcaption></figure>

{% hint style="info" %}
The import tool will only read sheets in node or edge format as explained above. If you have extra sheets to manage your data, they will not be read.
{% endhint %}

{% hint style="info" %}
Blank lines and white space can lead to import errors. Make sure to clear them for a better import experience. Try Google Sheets TRIM whitespace option in Data menu.
{% endhint %}

## Working with Excel

To prepare an Excel sheet for import, follow the exact same format as in Google Sheets. Just choose the Excel tab for import.

<figure><img src="https://918529313-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtBdFNYyZE7d8Q4z2K2ZT%2Fuploads%2FdRPZvnVbnEmHwLGHLzDe%2FScreen%20Shot%202022-11-16%20at%2023.12.52.png?alt=media&amp;token=e0b2333a-4c73-4db9-a9cf-b2d17ab57a29" alt=""><figcaption></figcaption></figure>

## Working with CSV files

CSV files follow the same table structure as in Google Sheets. When your files are ready, open the import panel and choose the CSV Files tab. Then drag and drop to start import.

<figure><img src="https://918529313-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtBdFNYyZE7d8Q4z2K2ZT%2Fuploads%2FiwBMNZ3RHp3AiXz3wcdm%2FScreen%20Shot%202022-11-16%20at%2023.13.06.png?alt=media&amp;token=eaea7476-143c-4b20-b52e-322e62f45fe1" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
If you are working with multiple node types with various properties, create separate CSV files for each node type to make sure every node type only has its property column.
{% endhint %}

## Working with JSON files

Open the import panel and choose the JSON tab to upload your JSON file. You can export your graph in JSON and import into a new graph.

<figure><img src="https://918529313-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtBdFNYyZE7d8Q4z2K2ZT%2Fuploads%2FnOj6iq6Zm0wz6q1r3fjh%2FScreen%20Shot%202022-11-17%20at%2000.06.52.png?alt=media&amp;token=389f123d-c60a-41f9-bb3c-723dc4641d74" alt=""><figcaption></figcaption></figure>

You can programmatically create and manage graphs using the Graph Commons [API](https://docs.graphcommons.com/build/api.md)
