Importing CSV Files: Neo4j Desktop and Sandbox

Loading various kinds of files into Neo4j requires different locations depending on the tool you are using. Import methods we will cover: 1. Neo4j Desktop 2. Neo4j Sandbox Neo4j Desktop Filepath for Neo4j Desktop will vary based on your operating… Read more →

A demonstration of IntraCluster SSL Encryption

This document provides a step-by-step demonstration of the process to deploy a Self-Signed SSL Certificate, to member instances of a Causal Cluster, aimed at achieving intra-cluster encryption. The steps can be outlined as: Generate and install cryptographic objects Create an SSL… Read more →

Comparing relationship properties within a path

You want to compare relationship-properties of a path, either by a global value or parameter, or with each other within a path. Basic model: (:Person {person_id:’123′})-[:FRIEND {date:’1972-01-01′}]->(m:Person {person_id:’456′}) Make sure to have an constraint OR index on your nodes: Constraint… Read more →

Debian: apt-get failing to update Neo4j

The common cause is an out of date gpg key. To update then run the following command: wget -O – | sudo apt-key add – See also the information on: You can get more information about running Neo4j… Read more →

Neo4j: Convert string to date

Neo4j 3.4 saw the introduction of the temporal date type, and while there is now powerful in built functionality, converting strings to dates is still a challenge. If our string is in the format yyyy-MM-dd we can call the date… Read more →

How to avoid costly traversals with join hints

When matching a pattern using Cypher, the number of possible paths to evaluate often correlates with query execution time. When there is a supernode in the path (a node with a high number of relationships whose type are included in… Read more →

Installing Neo4j Database on Debian or Ubuntu fails with “The following packages have unmet dependencies”

Installing Neo4j Database on Debian or Ubuntu fails with the error: The following packages have unmet dependencies: neo4j-enterprise : Depends: cypher-shell (< 1.2.0) but it is not going to be installed E: Unable to correct problems, you have held broken… Read more →

Retired: Modifying the http.log Format on Neo4j 2.x

Prior to Neo4j 3.0, the http.log format was controlled by neo4j-http-logging.xml. The default format works fine, except when you need to diagnose problematic long-running queries. The HTTP requests to the /db/data/cypher or /db/data/transaction endpoints do not log the json payload… Read more →

Limiting MATCH results per row

Since LIMIT applies to the total number of rows of the query, it can’t be used in cases when matching from multiple nodes where the limit must be on match results per row. Take an example case using the Movies… Read more →

Setup Neo4j Service to run with different service ID

By default when neo4j is installed as an RPM via yum or apt-get, it creates a user neo4j and group neo4j and runs as neo4j user. However it might be required to run Neo4j service as another service id other… Read more →

Understanding memory configurations for neo4j-admin backup

When using bin\neo4j-admin backup to backup a Neo4j database, Neo4j Support recommends explicitly defining the JVM heap size and pagecache memory to be used by the backup JVM process. If these are not defined then when neo4j-admin backup is executed,… Read more →

How do I improve the performance of counting number of relationships on a node

Using Cypher one could count number of relationships in the following manner MATCH (n:Actor {name:’Sylvester Stallone’})–>() RETURN count(*); Which will report the number of incoming/outgoing relationships for the Actor named Sylvester Stallone. Using bin/neo4j-shell and running a profile on the… Read more →

Throttling Bolt Requests

When large amounts of data are sent between a Neo4j database and a client (typically large query results, from server to client), there are a few hidden throttling mechanisms that may come into play. TCP Throttling Bolt connections between a… Read more →

Query to kill transactions that take longer than X seconds and doesn’t contain certain keywords

In Neo4j we currently have the configuration property referred to as execution guard: dbms.transaction.timeout=30s that can be set automatically to kill transactions that take more than “x” seconds (x is equal to what is assigned to dbms.transaction.timeout, in this case… Read more →

How do i configure Neo4j so that data/graph.db/messages.log is automatically rotated

As tested and verified with Neo4j 2.3.0, the data/graph.db/messages.log, its size and number of rotated archives is governed by the following parameters in the conf/ file Name Description Default store.internal_log.max_archives Maximum number of history files for the internal log. 7… Read more →

Recommendations for recovery upon Out Of Memory error

It is possible to configure the JVM (Java Virtual Machine) such that upon encountering an OOM (Out-Of-Memory) error it will force an exception and crash or simply shut down the application. Taking action upon first OOM occurrence can help in… Read more →

Use Java Runtime 11 with Neo4J 3.5.x

Neo4j 3.5.x supports Java 11 as runtime, however custom code should still be compiled against Java 8. As a best practice, it is recommended to maintain your infrastructure environment on supported components (Hypervisor, Operating System, Java Virtual Machine). In this… Read more →

How do I configure init and max java heap when running bin/neo4j-backup

When running $NEO4J_HOME/bin/neo4j-backup if a Java out of heap/memory error occurs you may want define the init and max Java heap to be used by neo4j-backup. The default behavior is to allow the JVM to define the init and max… Read more →

Understanding non-existent properties and working with nulls

In Neo4j, since there is no table schema or equivalent to restrict possible properties, non-existence and null are equivalent for node and relationship properties. That is, there really is no such thing as a property with a null value; null… Read more →

Extracting Java Error When Installing Neo4j Desktop

In rare cases, Neo4j Desktop install might fail during the Java extract phase with the following message on Windows: Initialization Error: error: end of central directory record not found (see below) If encountering this message, it is probably due to… Read more →

Performing match intersection

Match intersection is a common use case where you’re searching for nodes which have relationships to all of a set of input nodes. For the rest of the article we’ll use the built-in movies graph for demonstration. The example use… Read more →

How to monitor Neo4j with Prometheus

Commencing with the release of Neo4j Enterprise 3.4, one can now use the open source monitoring tool Prometheus to monitor Neo4j. The following article details a basic Prometheus implementation to demonstrate the connectivity between Prometheus v2.2.1 and Neo4j. After installing… Read more →

Explanation of error: procedure is not available due to having restricted access rights, check configuration

Commencing with Neo4j 3.2 when running a stored procedure, for example call; this may error with is not available due to having restricted access rights, check configuration. The cause of this error is as a result of not… Read more →

A method to replicate a Causal Cluster to new hardware with minimum downtime

If the opportunity arises such that you are in need of replicating your existing Causal Cluster cluster to a new hardware setup, the following can be used to allow for minimal downtime. Let us first start with an existing 3… Read more →

Explanation of “Failed to update routing table with server” error

If you encounter a Failed to update routing table with server error in their $NEO4J_HOME/logs/debug.log similar to: ERROR 1 — [o4jDriverIO-5-2] LoadBalancer : Failed to update routing table. Current routing table: Ttl 1582554193442, currentTime 1582554193471, routers AddressSet=[], writers AddressSet=[], readers… Read more →