All versions of this manual
X
 

Configuring data-sources: Neo4j

Neo4j v4 is partially supported in Linkurious Enterprise 2.10.18.

The following Neo4j v4 features are currently not supported:

Neo4j is supported since version 3.2.0.

Note that Neo4j 4.0.0 and 4.0.1 are not supported. Neo4j 4 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": "http://127.0.0.1:7474/",
        "user": "myNeo4jUser",
        "password": "nyNeo4jPassword"
      },
      "index": {
        "vendor": "neo4jSearch"
      }
    }
  ]
}

Linkurious can connect to Neo4j via the Bolt protocol. To do so, you need to enable the protocol in your Neo4j configuration file. If Linkurious is connected over HTTP/S, it will try to automatically upgrade the connection to Bolt. The HTTP/S protocol is still required to perform a small subset of operations.

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 for v4.x.x): Name of the database to be connected
  • allowVirtualEntities (optional, default true): Whether to allow virtual nodes and virtual edges
  • alternativeURLs (optional for v4.x.x): Linkurious accepts a string array consisting of alternative Neo4j Bolt URLs for high availability
  • httpUrl (optional): Neo4j HTTP url needed to connect with a "architect" user
  • ignoredEdgeTypePrefixes (optional): List of edge type prefixes to be excluded in the schema sampling

Neo4j v4 Full Bolt support

For Neo4j v4 and later, Linkurious Enterprise provides full support for Neo4j connections over Bolt.

Linkurious Enterprise will use Full Bolt connector when it is provided with any of following url prefixes: bolt, neo4j, neo4j+s

It is recommended to use Full Bolt connector for Neo4j v4 and later.

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.

If you are connecting via an architect role to Neo4j 3.5, it's necessary to explicitly specify both the bolt url and the http url via the url and httpUrl configuration keys respectively.

Configure Alternative Ids indices

Configure altenative ids indices is only possible starting from Neo4j 3.5.1 and it's recommended to do so.

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": "http://127.0.0.1:7474/",
        "user": "myNeo4jUser",
        "password": "nyNeo4jPassword",
        "alternativeNodeId": "myUniqueNodeId",
        "alternativeNodeIdIndex": "myAlternativeNodeIdIndex",
        "alternativeEdgeId": "myUniqueEdgeId",
        "alternativeEdgeIdIndex": "myAlternativeEdgeIdIndex"
      },
      "index": {
        "vendor": "neo4jSearch"
      }
    }
  ]
}