Skip To Content

Considerations for Neo4j databases used as NoSQL data stores

If you are using Neo4j databases as NoSQL data stores that are registered with your ArcGIS Knowledge site, there are some details to consider to ensure your knowledge graphs operate correctly.

Create a knowledge graph

The first step in using a Neo4j database with your ArcGIS Knowledge site is to create a Neo4j database using Neo4j administration commands. Register the database with your site as a NoSQL data store.

When a Neo4j database is registered as a NoSQL data store, it can be registered using either the database name or an alias assigned to it. The name or alias you use is subject to the same naming restrictions as the knowledge graph. Once the NoSQL data store has been created, the database can't be renamed or the alias can't be changed or dropped in Neo4j.

When you provide authentication information to connect to the Neo4j instance, ensure the user or identity with which the database is accessed has sufficient privileges to support all operations needed by the knowledge graph that will be created.

The knowledge graph associated with the NoSQL data store will have the level of access associated with the credentials that were used to create the NoSQL data store. Those credentials are respected when any client accesses the knowledge graph service's content. For example, if the user can only access a specific set of entities and relationships, only those items will be available in an ArcGIS Pro project's investigation.

Learn about administering your Neo4j databases

Manage data

When you create a knowledge graph using a NoSQL data store, you must choose how the data stored in the Neo4j database will be managed. This choice determines other factors regarding the Neo4j database.

For example, the graph store associated with your ArcGIS Knowledge site stores schema information that must be kept in sync with the information stored in the Neo4j databases associated with your site. How this is accomplished depends on how the data in the database is managed.

You must create a plan to back up and restore your Neo4j databases that is coordinated with your plan to back up and restore your ArcGIS Enterprise deployment and your ArcGIS Data Store graph store.

ArcGIS-managed data

If a knowledge graph will contain ArcGIS-managed data, the registered database must be empty when you add it to your ArcGIS Enterprise deployment as a NoSQL data store. If a Neo4j database isn't completely empty, the operation to create a knowledge graph with ArcGIS-managed data will fail.

When you create a NoSQL data store that will contain ArcGIS-managed data, the credentials you provide to access the Neo4j database must have privileges corresponding with the built-in Neo4j role architect.

You can only create one NoSQL data store that accesses a Neo4j database where the database contains ArcGIS-managed data. Similarly, you can only create one knowledge graph that accesses a NoSQL data store where the database contains ArcGIS-managed data. For example, you can't create a second knowledge graph accessing the same NoSQL data store where you designate the NoSQL data store as having user-managed data.

Once a knowledge graph with ArcGIS-managed data has been created, the identifiers for entities and relationships must be kept in sync between the Neo4j database and the ArcGIS Knowledge graph store for the knowledge graph to remain operational. To ensure data integrity, edits to all systems associated with the knowledge graph are only supported through operations and requests made in ArcGIS Pro and ArcGIS Enterprise.

Editing data and other changes to the Neo4j database must not be made from outside ArcGIS. This includes changing or deleting any indexes associated with the Neo4j database, since these are required to support searching.

User-managed data

If your Neo4j database contains data, you can register the database as a NoSQL data store and create a knowledge graph where the NoSQL data store is designated as having user-managed data.

When you create a NoSQL data store that will contain user-managed data, the credentials you provide to access the Neo4j database must have privileges corresponding with the built-in Neo4j role reader. However, if you enable search when you create the knowledge graph, the built-in role architect must be used; search capabilities require sufficient privileges to create full-text indexes in the Neo4j database.

All entities and relationships in a knowledge graph must have a unique identifier. When you create a knowledge graph with a user-managed NoSQL data store, the database must contain a property that serves as a unique identifier. The name of the unique identifier property must be the same for all entity types and relationship types and must be provided when you create the knowledge graph. The value stored in the property must be unique across all entity types or across all relationship types but does not have to be globally unique across all entities and relationships in the database.

If search is enabled for a knowledge graph, full-text indexes are created in the Neo4j database by ArcGIS Knowledge to support searching. These indexes must not be updated or deleted outside of ArcGIS Knowledge. The index names begin with esri__.

To search the knowledge graph's data and add it to a link chart or map, you must synchronize the data model of the Neo4j database with the ArcGIS Knowledge graph store. If a node or relationship in the Neo4j database has multiple labels, synchronizing the data model fails. When this failure occurs, data associated with previously synchronized data model information can be accessed, but you cannot add data to a link chart or map associated with parts of the data model that have not been synchronized. You must synchronize the data model whenever the schema changes in the Neo4j database.

You can create many NoSQL data stores that access the same Neo4j database as long as the database does not contain ArcGIS-managed data created by a different knowledge graph, and each data store accesses the same database with different credentials. You can also create many knowledge graphs that access a single NoSQL data store that is designated as having user-managed data. Either method can produce many knowledge graphs accessing the same underlying Neo4j database. Use the ArcGIS Enterprise portal to control who can access each knowledge graph.

For example, if you have two knowledge graphs and each one is associated with a different NoSQL data store, and each NoSQL data store accesses the Neo4j database using different credentials, ensure each knowledge graph is shared with the correct group of users in the ArcGIS Enterprise portal. Share each knowledge graph with a separate portal group. Set up membership for each portal group so each portal user has access to the correct content using the correct knowledge graph.

Similarly, you can create two knowledge graphs that access the same NoSQL data store using credentials that provide full access to a Neo4j database. However, you can control what different portal users can do with the available information by sharing the knowledge graphs differently in the ArcGIS Enterprise portal. One knowledge graph can be shared to a group where all members have been assigned the Viewer role and therefore have read-only access to the content. The other knowledge graph can be shared to a different group where members have the Editor role and therefore can edit entities and relationships and their properties.

Knowledge graphs that access user-managed data in a Neo4j database are read-only when they are accessed in an ArcGIS Pro project. If you access the same knowledge graph using an ArcGIS Enterprise developer API, you can edit entities and relationships and values of their properties; however, the data model for the knowledge graph will remain read-only. That is, you cannot add new entity types and relationship types or add new properties to existing types.

Delete the database

When you no longer need a knowledge graph, you can delete it in the Enterprise portal. Data for the knowledge graph is deleted automatically from the graph store. However, if the knowledge graph references a NoSQL data store, the data store and its associated Neo4j database are not deleted automatically.

If the knowledge graph contained ArcGIS-managed data, you can't create another ArcGIS-managed knowledge graph from the same NoSQL data store because the Neo4j database is not empty. However, if the knowledge graph contained user-managed data, you can create a new knowledge graph that accesses data in the existing NoSQL data store.

If you no longer intend to use a Neo4j database with ArcGIS Knowledge, you can delete the NoSQL data store in the Enterprise portal. This does not delete the associated Neo4j database. Before you delete the NoSQL data store item, check its settings and make note of which Neo4j database it references. You can then take steps to archive the data and delete the Neo4j database using Neo4j utilities and administration commands according to your organization's guidelines.

Note:

Once a knowledge graph has been deleted from the Enterprise portal, you can't use any investigations stored in your ArcGIS Pro projects that referenced the deleted knowledge graph. An existing investigation can't be associated with a different knowledge graph. You will have to delete investigations that reference the deleted knowledge graph from all projects where they exist or delete the projects themselves, as appropriate.

If the knowledge graph has been transferred to a new Enterprise deployment, existing knowledge graph layers in a map or a link chart can be updated to use the new knowledge graph, even though the investigation must be deleted.