Export a (sub)graph to Cypher script and import it again

Oftentimes you want to export a full (or partial) database to a file and import it again without copying the actual database files. If you want to do the latter, use neo4j-admin dump/load. Here are two ways on how to… Read more →

Explore:  


How do I enable remote HTTPS access with Neo4j 3.0.x

With 3.0.x to enabled remote clients to connect to a HTTPS enabled browser the following parameters in the $NEO4J_HOME/conf/neo4j.conf need to be changed from the default of #dbms.connector.https.address=localhost:7473 to dbms.connector.https.address=0.0.0.0:7473 The change from localhost:7473 to 0.0.0.0:7473 will allow for remote… Read more →

Explore:  


How do I convert Neo4j logs from base UTC to local timezone

With the introduction of Neo4j 3.3.1 it is possible to represent date timestamps in your $NEO4J_HOME/logs/* in either UTC or SYSTEM timezone through the implementation of dbms.logs.timezone However for prior releases all Neo4j logs will preface each line with a… Read more →

Explore:  


How do I log parameter values into the query.log file

Neo4j 3.0 introduces the ability to log the value of query parameters in the log/query.log file. The settings to control this feature are located in the conf/neo4j.conf file. To enable query logging with parameters, one must first enable query logging… Read more →

Explore:  


Why does my CREATE CONSTRAINT take so long to complete

When creating a constraint, for example CREATE CONSTRAINT ON (n:ZipCode) ASSERT n.name IS UNIQUE; this will require a lock on all nodes with the label the constraint is being created for, in this case ZipCode If you have another transaction… Read more →

Explore:  


Explanation of error “DeadlockDetectedException: ForsetiClient[0] can’t acquire ExclusiveLock…​ …​”

Under specific scenarios a DeadlockDetectedException may be encountered and the behavior is described at http://neo4j.com/docs/stable/transactions-deadlocks.html. When a DeadlockDetected is encountered one option is to simply retry the statement. As a deadlock detection error is a safe-to-retry error and the user… Read more →

Explore:  


Understanding transaction and lock timeouts

One way to handle runaway queries is to impose a time limit that will terminate a query when exceeded. There are some subtleties here that need to be understood to ensure proper behavior and avoid confusion. Defining a transaction timeout… Read more →

Explore:  


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 →

Explore:  


java.lang.OutOfMemoryError: unable to create new native thread

When a client application establishes a session with a Neo4j server via the bolt or bolt+routing protocols, the server allocates a thread to serve as the server-side bolt worker to handle that connection. There is no server-side limitation on the… Read more →

Explore:  


A light weight approach to validating network port connectivity

If it becomes necessary to validate, particularly in a clustered environment whether Causal Cluster or High Availability, whether or not 1 instance can talk to another instance on a given port one can use linux command netcat. To Validate connectivity… Read more →

Explore:  


How do I compare two graphs for equality

If you are looking to compare 2 graphs (or sub-graphs) to determine if they are equivalent, the following Cypher will produce a md5sum of the nodes and properties to make that comparison. For example, you may wish to compare a… Read more →

Explore:  


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 →

Explore:  


Will execution_guard_enabled work in my release of Neo4j?

Background From the beginning, the execution guard was never meant to be used by the general public. However, the feature was there in the product, though undocumented, and it did work for the purpose of preventing long running queries from… Read more →

Explore:  


How deletes work in Neo4j

Neo4j uses logical deletes to delete from the database to achieve maximum performance and scalability. To understand how this might appear to an operator of the database, lets take a simple case of loading data into Neo4j. When you start… Read more →

Explore:  


How do I use Cypher to connect to a RDBMS using JDBC

With the inclusion of java stored procedures in Neo4j 3.x, one can run Cypher to connect to a RDBMS using JDBC. To do so one needs to download and install https://github.com/neo4j-contrib/neo4j-apoc-procedures. After installation of the Neo4j APOC kit, download the… Read more →

Explore:  


Neo4j’s commit process explained

This article will try to guide you through Neo4j’s commit and replication processes both for single instances and causal clusters.   Single Instance When you call tx.commit(), the transaction will go through the Storage Engine which will transform that transaction… Read more →

Explore:  


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 →

Explore:  


Are my cluster transactions/messages encrypted.

For all versions prior to 3.3, there is no encryption done specifically on the contents being transferred. Furthermore, since it doesn’t use REST or Bolt, there is no SSL/https configuration either. Transactions are propagated via transaction logs, which are a… Read more →

Explore:  


How do I use LOAD CSV with data including quotes

When using LOAD CSV to read a file which includes data with double quote characters (“), the quotes need to be escaped as 2 double quote characters For example if your data file (courses.csv) included the following content COURSE_ID|COURSE_TITLE 1215,”””Graphs… Read more →

Explore:  


Explanation of error “Unrecognized transaction id. Transaction may have timed out and been rolled back”

When submitting a request via the Neo4j Transactional Cypher HTTP endpoint, one may encounter the following error Unrecognized transaction id. Transaction may have timed out and been rolled back This error may occur as a result of the transactions expiration… Read more →

Explore:  


How to estimate initial memory configuration

The initial and eventual memory configuration parameters can be a moving target, based on how your store changes in size and how your workload increases or changes over time. This guidance is meant for the initial configuration. In order to… Read more →

Explore:  


Explanation of error LOAD CSV error of “Couldn’t load the external resource …​”

When running a LOAD CSV Cypher statement, for example LOAD CSV WITH HEADERS FROM “http://10.12.1.2/Neo4j/cities.csv” AS row WITH row create (c:cities {name:row.city}); whether through bin/neo4j-shell or the browser at http://localhost:7474 this may result in an error as follows Couldn’t load… Read more →

Explore:  


Long GC Pauses caused by application code calling System.gc()

When investigating the cause of long garbage collection cycles, it is often useful to enable GC logging. You can do so by following the product documentation. Once this is enabled, you can look through the GC log file for signs… Read more →

Explore:  


How do I define, display, and use parameters with neo4j-shell

bin/neo4j-shell allows for a command line interface to query your graph via Cypher statements and to include parameters to those statements. Usage of parameters, rather than hard coding values, will allow for re-use of the query plan cache. A parameter… Read more →

Explore:  


Alternatives to UNION queries

While UNIONs can be useful for certain cases, they can often be avoided completely with small changes to the query. In this article we’ll present various example cases where a UNION isn’t necessary, and a simple Cypher query will do.… Read more →

Explore: