Knowledge Base

Articles tagged as apoc

A significant change in apoc.periodic.iterate() in apoc 4.0

In 3.5 an entity (node, relationship, path) could be acquired in one transaction and safely reused by another. However, in 4.0 these entities do hold a reference to their originating…

Read more

Achieving longestPath Using Cypher

While Cypher is optimized for finding the shortest path between two nodes, with such functionality as shortestPath(), it does not have the same sort of function for longest path. In…

Read more

Conditional Cypher Execution

At some point you’re going to write a Cypher query requiring some conditional logic, where you want different Cypher statements executed depending on the case. At this point in time…

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…

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 this may error with The cause of this error is as a result of not configuring the security extensions.…

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 this is usually indicative of a incompatible APOC jar file installed into $NEO4J_HOME/plugins. With Neo4j 3.5.0 the…

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…

Read more

How do I display date and time of when neo4j was started and other metrics

The following Cypher will utilize the JMX metrics as part of 3.1 Enterprise and display the date/time when Neo4j was started. which will produce output similar to: In the above…

Read more

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…

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…

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…

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…

Read more

Split between APOC Core and APOC Extended

With the release of Neo4j 5, the APOC library has been split into two separate packages: APOC Core and APOC Extended. APOC Core Neo4j 5 brings substantially more support to…

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…

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 chosen to subscribe/follow Knowledge Base section(s). This…

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…

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…

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…

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,…

Read more