All versions of this manual
X
 

Configuring data-sources: Neo4j

Neo4j is supported since version 4.0.2.

Configuration

To edit the Neo4j data-source configuration, you can either use the Web user-interface or edit the configuration file located at linkurious/data/config/production.json.

Example configuration:

{
  "dataSources": [
    {
      "graphdb": {
        "vendor": "neo4j",
        "url": "neo4j://127.0.0.1:7687/",
        "user": "myNeo4jUser",
        "password": "nyNeo4jPassword"
      },
      "index": {
        "vendor": "neo4jSearch"
      }
    }
  ]
}

Linkurious connects to Neo4j via the Bolt protocol. To do so, you need to enable the protocol in your Neo4j configuration file. If an HTTP/S URL is configured, Linkurious will automatically upgrade the connection to Bolt.

Supported graphdb options with Neo4j:

  • url (required): URL of the Neo4j server (HTTP / HTTPS / bolt / neo4j)
  • user (optional): Neo4j user (if credentials are enabled, see Neo4j credentials)
  • password (optional): Neo4j password (if credentials are enabled)
  • proxy (optional): URL of the HTTP proxy to use to connect to Neo4j (only used when url is HTTP/S)
  • alternativeNodeId (optional): Name of the node property to use as reference in visualizations (see alternative IDs)
  • alternativeEdgeId (optional): Name of the edge property to use as reference in visualizations
  • latitudeProperty (optional): Name of the node property to use for latitude (used in geo mode)
  • longitudeProperty (optional): Name of the node property to use for longitude (used in geo mode)
  • allowSelfSigned (optional, default false): Whether to allow self-signed certificates
  • databaseName (optional): Name of the database to be connected
  • allowVirtualEntities (optional, default true): Whether to allow virtual nodes and virtual edges
  • alternativeURLs (optional): Linkurious accepts a string array consisting of alternative Neo4j Bolt URLs for high availability
  • ignoredEdgeTypePrefixes (optional): List of edge type prefixes to be excluded in the schema sampling

Neo4j Aura

Linkurious Enterprise allows using Neo4j instances running on Neo4j Aura as data-sources.

Neo4j Aura is only supported for the Neo4j Aura instances running Neo4j engine v4.0 and later.

Search with Neo4j

In order to have full-text search, you can choose among the following options:

Neo4j credentials

If you just installed Neo4j, these steps will help you create credentials:

  1. Launch the Neo4j server
  2. Open your Web browser at http://127.0.0.1:7474
  3. Follow the instructions to create a new username and password

Alternatively, you can disable credentials in Neo4j by editing the Neo4j configuration at neo4j/conf/neo4j.conf by uncommenting the following line:

dbms.security.auth_enabled=false

Note that Linkurious requires a Neo4j user with the Neo4j built-in admin or architect role. This is needed so that Linkurious can use Neo4j features like Index creation and Query cancellation.

Configure Alternative Ids indices

Configuring alternative IDs indices is recommended.

The first step is to:

  • Decide a unique name for the newly created indices, one for nodes and one for relationships. In the following example query for nodes we picked: myAlternativeNodeIdIndex
  • Identify the list of node and relationship types in the Neo4j database. In the following example: ['Company', 'Person']
  • Have the 2 property keys, one for nodes and one for relationships, that identify an item uniquely in the database. In the following example: myUniqueNodeId

Once we have this information we can create the indices with the following Cypher queries:

call db.index.fulltext.createNodeIndex('myAlternativeNodeIdIndex', ['Company', 'Person', 'City'], ['myUniqueNodeId'], {analyzer: 'keyword'})

call db.index.fulltext.createRelationshipIndex('myAlternativeEdgeIdIndex', ['WORKS_FOR', 'LIVES_IN'], ['myUniqueEdgeId'], {analyzer: 'keyword'})

If new node labels or edge types are added to Neo4j, it's necessary to recreate these indices with the full list of categories.

Once the indices are created, we can configure them Linkurious:

Example configuration:

{
  "dataSources": [
    {
      "graphdb": {
        "vendor": "neo4j",
        "url": "neo4j://127.0.0.1:7687/",
        "user": "myNeo4jUser",
        "password": "nyNeo4jPassword",
        "alternativeNodeId": "myUniqueNodeId",
        "alternativeNodeIdIndex": "myAlternativeNodeIdIndex",
        "alternativeEdgeId": "myUniqueEdgeId",
        "alternativeEdgeIdIndex": "myAlternativeEdgeIdIndex"
      },
      "index": {
        "vendor": "neo4jSearch"
      }
    }
  ]
}