> For the complete documentation index, see [llms.txt](https://icij.gitbook.io/datashare/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://icij.gitbook.io/datashare/local-mode/create-the-neo4j-graph/create-and-update-the-graph.md).

# Create and update Neo4j graph

## Create the graph

1. Go to '**All projects'** and click on your **project's name**:

<figure><img src="/files/09M1D2F7CezLcpR2qTt0" alt="Screenshot of Datashare&#x27;s &#x27;All projects&#x27; page with the name of one project highlighted"><figcaption></figcaption></figure>

2. Go to the **Graph tab** and in the first step '**Import**', click on the '**Import'** button:

<figure><img src="/files/eOl3bMJTO3XDrgP4SV0q" alt="Screenshot of Datashare&#x27;s project page on the Graph tab with the &#x27;Import&#x27; button highlighted on the first step of the form"><figcaption></figcaption></figure>

You will then see a **new import task running**.

When the graph creation is complete, '**Graph statistics'** will reflect the number of documents and entities nodes found in the graph:

<figure><img src="/files/TLx4OCxwedNSWo8H2Zsm" alt="Screenshot of Datashare&#x27;s project page on the Graph tab with the Graph statistics highligted"><figcaption></figcaption></figure>

## Update the graph

If new documents or entities are added or modified in Datashare, you will need to update the Neo4j graph to reflect these changes.

Go to '**All projects**' > one **project's page** > the '**Graph**' tab. In the first step, click on the '**Update graph'** button:

<figure><img src="/files/oLIFFi4E3EEpFACiYzrK" alt="Screenshot of Datashare&#x27;s project page on the Graph tab with &#x27;Update&#x27; button on the first step of the form highlighted"><figcaption></figcaption></figure>

To detect whether a graph update is needed, go to the '**Projects'** page and open your project:

<figure><img src="/files/KVTHXQTUgmmFK11GriYg" alt="Screenshot of Datashare&#x27;s All projects page with the name of one project highlighted"><figcaption><p>Open your project</p></figcaption></figure>

Compare the number of documents and entities found in Datashare in '**Projects**' > '**Your project**' > '**Insights**'...

<figure><img src="/files/c0b8OyoDVbPUaAshqwJV" alt="Screenshot of Datashare&#x27;s project page on the Insights tab with statistics highlighted"><figcaption><p>Statistics of one project</p></figcaption></figure>

...with the numbers found in your project in the '**Graph' tab**. Run an update in case of mismatch:

<figure><img src="/files/3BsV4oxY0kFnRsN7kBgP" alt="Screenshot of Datashare&#x27;s project page on the Graph tab with statistics highlighted"><figcaption></figcaption></figure>

The update will **always add missing nodes and relationships, update existing ones if they were modified, but will never delete graph nodes or relationships**.

You can now [explore your graph](/datashare/usage/explore-the-neo4j-graph.md#exploring-your-graph) using your favorite visualization tool.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://icij.gitbook.io/datashare/local-mode/create-the-neo4j-graph/create-and-update-the-graph.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
