UID in Saved Visualizations
UID - Universal ID is a feature that allows defining a property for nodes and relationships that hold the entity's unique identification value. In some graph databases (e.g. Neo4j), the graph engine manages internal ID values that can change during operations like reimporting data. This can cause the saved visualizations to get mixed data and stop working properly. In such a case, it's possible to define a different property that will be used to identify graph entities during the loading of a saved visualization.
To set the UID configuration to use property value (the UID property) for saving visualization instead of the database ID use the "nodeUid" and "relationshipUid" settings in the Data Schema.
Example
Let's say we have a graph model with node labels "Company", "Person" and multiple relationship types. To use UID instead of database IDs in saved visualization we have to:
change the "nodeUid" and "relationshipUid" settings in the Data Schema
create database indexes (only when Neo4j graph DB is used)
1. The configuration in our case should be:
"nodeUid" : {
"labels" : ["Company", "Person"],
"property" : "uuid",
"manageIndex" : true
},
"relationshipUid" : {
"types" : [],
"property" : "uuid",
"manageIndex" : true
}
2. The Neo4j Unique Schema indexes should be created for all combinations of nodeUid.labels and nodeUid.property and all combinations of relationshipUid.types and relationshipUid.property to ensure optimal performance of visualization loading. To automate the management of indexes use "manageIndex":true (see the configuration above).
In our case, the indexes are:
CREATE INDEX ON :Company(uuid);
CREATE INDEX ON :Person(uuid);
When connected to Neo4j 3.5 and 4.x Graphlytic is using a fulltext index for managing relationship UID lookup. In the case of Neo4j 5.x Graphlytic is using schema indexes for both, node and relationship UID indexes. Also, the Neo4j 5 driver in Graphlytic can handle empty arrays nodeUid.labels and relationshipUid.types. In such case, all currently existing (in the moment of config saving) node labels and relationship types will be used.