How do I pass parameters when calling apoc.cypher.runFile

APOC allows one to have a stored procedure, apoc.cypher.runFile, to then run the contents of the file to the Cypher engine. To allow the reading of the file in the conf/neo4j.conf one needs to define apoc.import.file.enabled=true and then if one… 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 →

Viewing schema data with APOC Procedures

APOC Procedures offers meta procedures to view information about your database schema and the data it stores. The procedure apoc.meta.schema() uses a sampling of the graph data to produce a map of metadata on the graph labels, relationships, properties, and… Read more →

Working with streaks in Cypher

When using Cypher for data analysis, you might have a problem where you need to identify or filter based upon some kind of streak. For example, for a sports graph, you might want to know the maximum number of consecutive… Read more →

Explanation of start failure “java.lang.NoClassDefFoundError: org/neo4j/kernel/impl/logging/LogService”

Upon starting Neo4j 3.5 if one encounters the following error in the logs/neo4j.log Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component ‘org.neo4j.kernel.extension.GlobalKernelExtensions@14c16d’ failed to initialize. Please see the attached cause exception “org.neo4j.kernel.impl.logging.LogService”. at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init( at org.neo4j.kernel.lifecycle.LifeSupport.init( at org.neo4j.kernel.lifecycle.LifeSupport.start( at org.neo4j.graphdb.facade.GraphDatabaseFacadeFactory.initFacade( … 9 more Caused… Read more →

How does apoc.periodic.iterate work with resources?

How does apoc.periodic.iterate work? For example, when running call apoc.periodic.iterate(“MATCH (n) RETURN n”, “DETACH DELETE n”, {batchSize:1000}) does it append a LIMIT to the MATCH RETURN so that it only returns the batchSize or does it return everything but it… Read more →

Using APOC to parse JSON results from Trello API

Prior to Neo4j 3.0, if you wanted to parse the JSON results from a call to a Web API, it would require you use one of the database drivers to fetch and parse the JSON data. This is described here.… Read more →

Using Cypher and APOC to move a property value to a label

Commencing with Neo4j 3.0 and the introduction of stored procedures as well as APOC one can utilize the stored procedure apoc.create.addLabels to move a property to a label with Cypher as follows // create a node with property studio create… Read more →

Using apoc.load.jsonParams to load data from Zendesk into Neo4j to learn about article subscribers

The following document describes how to utilize the Zendesk API to load data from Zendesk into Neo4j, specifically data about users who have choosen to subscribe/follow Knowledge Base section(s). This document attempts to solve the issue described by the following… Read more →

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 →

How to check for time range overlap in Cypher

Neo4j 3.4 introduced temporal types into Cypher, so now we have dates, dateTimes, and their local versions, too, as well as durations. While we don’t have a type for time ranges, we can use two temporal instants as the start… Read more →

Explanation of error NoClassDefFoundError: org/neo4j/kernel/impl/util/JobScheduler

Upon upgrading to Neo4j 3.3, if you were previously using APOC, and did not download and install the version of APOC for 3.3 bin\neo4j start will fail. The contents of your $NEO4J_HOME/logs/neo4j.log will appear similar to. 2017-11-07 20:38:38.245+0000 INFO Bolt… Read more →

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 →

Neo4j specific http request user agent strings

For those APOC commands that retrieve data using HTTP/HTTPS, and or running Cypher LOAD CSV the request will be sent with Neo4j specific user-agent/browser identifiers. Below is an example log from an Apache webservers access log at /var/log/apache2/access.log and includes… Read more →