> 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/exporting-data.md). Agents can also search and read this documentation through its [MCP server](https://docs.graphcommons.com/~gitbook/mcp).

# Exporting data

Get a copy of your graph data to review, revise or simply backup.

Export your data to manage them in other apps. To get an export of your graph:

1. Open the editing bar and click "Export"
2. Click on the format you choose, your download should start

<figure><img src="https://918529313-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtBdFNYyZE7d8Q4z2K2ZT%2Fuploads%2FMehJ73upm1ovS48SWqJN%2Fgc-export.png?alt=media&amp;token=ff5043b2-50da-4d8f-9a11-9525fc71f6cd" alt=""><figcaption></figcaption></figure>

This will give you an export of the full graph data. For partial exports, use the [export button](https://docs.graphcommons.com/create/editing-data-table.md#exporting-data) in the data table.&#x20;

## Open in Google Sheets

Download your graph as an Excel file, then import it into Google Sheets. It's pretty easy, just open a new spreadsheet and go to File > Import > Upload, then drag and drop the excel file.

{% hint style="info" %}
An exported file contains additional IDs for your nodes, node types, and edge types. That is to differentiate each data point from one another, so you don't lose track of them.
{% endhint %}

## Exported Excel files

On an Excel sheet, a graph export always has 3 kinds of tabs:&#x20;

<figure><img src="https://918529313-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtBdFNYyZE7d8Q4z2K2ZT%2Fuploads%2Fgwwn3UGzt93arq2nfCha%2FScreen%20Shot%202022-11-12%20at%2015.35.29.png?alt=media&amp;token=d5505138-0f03-4fec-8a27-7913224f1796" alt=""><figcaption></figcaption></figure>

* <mark style="color:red;">**Type tabs:**</mark> The first two sheets are *Node Types*, *Edge Types*. They make up the graph model and the IDs assigned to types.

The *Node Types* sheet is a list of the different types of nodes (actors) and their IDs. In this graph there are 2 node types: **Person** and **Fruit**

<figure><img src="https://918529313-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtBdFNYyZE7d8Q4z2K2ZT%2Fuploads%2FlCju95I6elB04GINHaFb%2FScreen%20Shot%202022-11-12%20at%2015.52.07.png?alt=media&amp;token=1e2e7417-b686-4844-9758-f6dedf519870" alt=""><figcaption><p>Node Type sheet</p></figcaption></figure>

The *Edge Types* sheet is a list of edges (relations) and it consists of IDs for each data type required to create that specific type of edge.

<figure><img src="https://918529313-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtBdFNYyZE7d8Q4z2K2ZT%2Fuploads%2FkHtmEwUA0PZO8gilBezw%2FScreen%20Shot%202022-11-12%20at%2015.52.20.png?alt=media&amp;token=7f26d1fe-273d-4ea2-8f14-398ed65dae96" alt=""><figcaption><p>Edge Types sheet</p></figcaption></figure>

* <mark style="color:blue;">**Node tabs:**</mark> For each node type, a separate node sheet is created. Node sheets are named after the node type, with first letters capitalized - like Fruit, Person. Below is the node sheet for **Person** nodes. Notice the last two columns on the right hand side are IDs for the first two columns Node Type and Name.

<figure><img src="https://918529313-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtBdFNYyZE7d8Q4z2K2ZT%2Fuploads%2F980xDU86b8R3aPZ4UdQq%2FScreen%20Shot%202022-11-12%20at%2015.58.13.png?alt=media&amp;token=195b470f-1d0d-4a3b-aeef-189f3d59067a" alt=""><figcaption><p>'Person' node sheet</p></figcaption></figure>

* <mark style="color:green;">**Edge tabs:**</mark> For each edge type, a separate edge sheet is created. Edge sheets are named after the edge type, all in capitals - like BOUGHT. Below is an edge sheet for people who have bought different fruits. Notice for each column there is also another column in the right hand side for their IDs.

<figure><img src="https://918529313-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtBdFNYyZE7d8Q4z2K2ZT%2Fuploads%2FHk88GjEyB5uhsiz8bE54%2FScreen%20Shot%202022-11-12%20at%2016.01.20.png?alt=media&amp;token=f763d932-166c-45c7-861c-744d1b0d23b9" alt=""><figcaption><p>BOUGHT edge sheet</p></figcaption></figure>

Exports are especially useful in updating graphs, especially large graphs or a series of graphs based on the same data set. In short, what you do is (1) get an export of your graph, (2) edits the export sheet, and (3) import it back into your graph.&#x20;

Below is a useful guide for editing graph data on an export sheet.

## Update with an exported sheet

If you are planning to update your graph via export & import functions, there are a few rules you need to watch out for.&#x20;

{% hint style="info" %}

1. Importing is additive. You *cannot* delete nodes or edges using the import tool, BUT:
2. You *can* overwrite properties of nodes, BUT:
3. You *cannot* delete/edit whole property types by deleting the column or editing their column title.
4. Data points without IDs will not match with existing points, but create new ones.
   {% endhint %}

### Deleting data

As per rule #1 above, deleting a node or an edge from the export sheet and importing it **without** that data point won't delete it from your graph. You can think of imports as cumulative, or juxtaposed.

An efficient way to remove any nodes and edges from your graph is to delete them manually, before importing the updated data. Mind that when you delete a node, you also delete its relations.

As per rule #2, node properties are overwritten, so as long as the node name and ID are matching, importing an empty row for a node will delete its existing property content.

To delete types, use the data table. Remove a whole tab or a whole property column.

### Adding data

#### Add a new node or edge&#x20;

1. Add a new row to one of the sheets following the existing format.
2. If the node/edge type already exists in your model, remember to add the type ID to avoid creating redundant types.

#### Create a new node type

1. Add a new tab to your sheet
2. Enter the nodes in the proper [node sheet format.](https://docs.graphcommons.com/create/importing-data.md)
3. Do not assign any IDs so that Graph Commons can create a new type.

#### Create a new edge type - with no existing node types at neither end

1. Add a new tab to your sheet
2. Enter the edges in the proper [edge sheet format](https://docs.graphcommons.com/create/importing-data.md)

#### Create a new edge type between existing node types&#x20;

1. Add a new tab to your sheet
2. Enter the edges in the proper [edge sheet format](https://docs.graphcommons.com/create/importing-data.md)
3. Do not assign an ID for Edge Type (Column **J**)
4. Assign Node Type IDs to Columns **H and K**
5. Assign Node IDs in Columns **I and L** if the if the nodes you are connecting already exist in the graph.

{% hint style="info" %}
**Tip:** Use the Vertical Lookup `(=VLOOKUP)` function of Excel/Sheets to enter matching IDs for existing nodes.
{% endhint %}

### Editing node properties

Simply add a column to the node sheet and enter the property data there. The newest-added property will be displayed last in the node card.

If you edit the name of a property and import, that will also be imported as a new property. So we recommend editing the property name before getting the export OR deleting the old version manually after exporting the new one.

#### Editing the content of properties

The property cells of a node will overwrite the existing information in the graph. Just edit the property cells according to the how you'd like to have them in your graph, and make sure you enter the matching node ID.

If you have changed the name of or deleted a property from the sheet, they will stay in your graph although this information is not in your import sheet. Delete all unnecessary property columns manually from the data table

#### Changing the order of properties

1. Delete all properties manually from the graph
2. Arrange property columns in the order you'd like them to appear
3. Import and view properties in node cards

### Editing node types and names

In your export sheet, assign a different name to that node type using the same ID. Make sure you make the changes all across the sheet.

In your export sheet, assign a different name to that node using the same ID. Make sure you make the changes all across the sheet.

### Editing edge types and names

In your export sheet, assign a different name to that edge type using the same ID. Make sure you make the changes all across the sheet.

### Editing edge properties

If you want to add weights to your edges, you can update edge weights in your export sheet and you will get thicker lines. Since imports are cumulative, if you want to decrease edge weights, then we suggest you delete those edges and reimport with the correct weights.

You can also add arbitrary properties to edges, which are displayed in edge cards and can be used in graph analysis.

## Duplicate your graph using a JSON Export

<figure><img src="https://918529313-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtBdFNYyZE7d8Q4z2K2ZT%2Fuploads%2FD13U43KtF76cJ2BxAxJc%2Fgc-export-json.png?alt=media&amp;token=e0bbb7b7-57a5-456e-9c5c-29f5439c9221" alt=""><figcaption><p>Duplicate your graph by first exporting it as a JSON file, and then importing this file into a new graph</p></figcaption></figure>

Exporting your graph as a JSON file allows you to make a copy of your graph, complete with Cartography settings, the graph title, and the cover image.

To duplicate your graph:

1. Open the Export menu using the editing bar on the left (you must be an admin of the graph)
2. Choose JSON to download
3. Create a fresh new graph, click Import from the editing bar, choose JSON, drag and drop the downloaded file, and proceed with import
