Tabbed sections in Neo4j Manuals

Up to Neo4j 4.1 the Drivers Manual includes tabs to allow users to choose with driver language sections to display. From 4.2 on, the Drivers Manual is split into a separate manual per language.

GDS also uses tabs, but they have a different list of tab separators. Rather than tab on languages, they tab on modes (mutate, stats, stream, train, write) and output tab text as <mode> mode eg Stream mode.

Tab for macOS

Tab for Linux

Tab for Linux

Tab for whatever

Example drivers manual content

Example 1. Acquire the driver

The .NET driver is distributed via the NuGet Gallery. To find the latest version of the driver, visit https://www.nuget.org/packages/Neo4j.Driver/.

Dependencies

  • .NETStandard (^2.0)

  • System.Net.NameResolution (^4.3.0)

  • System.Net.Security (^4.3.2)

  • System.Net.Sockets (^4.3.0)

  • System.Runtime.InteropServices.RuntimeInformation (^4.3.0)

  • System.Runtime.Serialization.Primitives (^4.3.0)

  • System.Threading.Thread (^4.3.0)

  • System.ValueTuple (^4.5.0)

The .NET Reactive API is under package Neo4j.Driver.Reactive. It is built upon System.Reactive. There is no extra dependency required use .NET reactive API.

Example 2. Installation via Install-package

To install the latest version of the driver using NuGet in Visual Studio:

PM> Install-Package Neo4j.Driver

It is also an option to install a certain version of the driver.

PM> Install-Package Neo4j.Driver -Version $DOTNET_DRIVER_VERSION

The .Net driver uses asynchronous methods by default. If you want to use blocking calls, the Neo4j.Driver.Simple NuGet package contains a set of extensions. This can be found at https://www.nuget.org/packages/Neo4j.Driver.Simple/. The initial examples make use of these extensions.

In the following example we are installing driver version {dotnet-driver-version}.

PM> Install-Package Neo4j.Driver -Version {dotnet-driver-version}

The release notes for this driver are available here.

To find out the latest version of the driver, visit https://github.com/neo4j/neo4j-go-driver/releases

To install the latest version of the driver using go get:

go get github.com/neo4j/neo4j-go-driver/v4@<latest tag>

Note that this requires that Go modules are enabled.

To use the Java driver, it is recommended employing a dependency manager, such as Maven or Gradle. To find the latest version of the driver, visit the Maven Central Repository.

Dependencies

  • org.reactivestreams:reactive-streams

  • org.apache.logging.log4j:log4j (optional)

The driver is dependent on the Reactive Streams API, thus maintaining JDK 8 compatibility. To make optimal use of the reactive APIs, we suggest an additional framework like Project Reactor or RxJava2. Both implement the Reactive Streams API and provide an exhaustive set of operators.

Example 3. Installation via Maven

When using Maven, add the following block to the pom.xml file. The driver version can either be declared as a property (as in the first example) or as an explicit version number (as in the second).

<dependencies>
    <dependency>
        <groupId>org.neo4j.driver</groupId>
        <artifactId>neo4j-java-driver</artifactId>
        <version>$JAVA_DRIVER_VERSION</version>
    </dependency>
</dependencies>

In the following example, driver version {java-driver-version} is added.

<dependencies>
    <dependency>
        <groupId>org.neo4j.driver</groupId>
        <artifactId>neo4j-java-driver</artifactId>
        <version>{java-driver-version}</version>
    </dependency>
</dependencies>
Example 4. Installation via Gradle

For Gradle, a compile line will be required. Again, this can use a property or an explicit version number.

compile 'org.neo4j.driver:neo4j-java-driver:$JAVA_DRIVER_VERSION'

In the following example, a driver version {java-driver-version} is added.

compile 'org.neo4j.driver:neo4j-java-driver:{java-driver-version}'

The release notes for this driver are available here.

To use the JavaScript driver, it is recommended employing npm. To find the latest version of the driver, use:

npm show neo4j-driver@* version

Dependencies

  • Babel/Runtime (^7.5.5)

  • RxJS (^6.5.2)

  • text-encoding-utf-8 (^1.0.2)

  • URI-js (^4.2.2)

The JavaScript Reactive API is built and exposed via RxJs. A dependency of RxJs is automatically installed with the driver.

Example 5. Installation via npm

To install the latest version of the driver:

npm install neo4j-driver

It is also an option to install a certain version of the driver.

npm install neo4j-driver@$JAVASCRIPT-DRIVER-VERSION

In the following example, driver version {javascript-driver-version} is installed.

npm install neo4j-driver@{javascript-driver-version}

The release notes for this driver are available here.

To find the latest stable version of the Python Driver, visit https://pypi.org/project/neo4j/

To find a list of all available releases, visit https://pypi.org/simple/neo4j/

To install the latest stable version of the Python Driver:

pip install neo4j

It is also an option to install a certain version of the driver.

Example 6. Installation with Python

The following is the syntax for installing a certain version of the Python Driver:

pip install neo4j==$PYTHON_DRIVER_VERSION

In the following example we are installing Python Driver version {python-driver-version}.

pip install neo4j=={python-driver-version}
Example 7. Installation with Python, get Python Driver prerelease

In the following example we get the latest prerelease version:

pip install neo4 --pre

The release notes for the Python Driver are available here

Example GDS tabs

Example 8. FastRP syntax per mode
Run FastRP in stream mode on a named graph.
CALL gds.fastRP.stream(
  graphName: String,
  configuration: Map
) YIELD
  nodeId: Integer,
  embedding: List<Float>
Table 1. Results
Name Type Description

nodeId

Integer

Node ID.

embedding

List<Float>

FastRP node embedding.

Run FastRP in stats mode on a named graph.
CALL gds.fastRP.stats(
  graphName: String,
  configuration: Map
) YIELD
  nodeCount: Integer,
  createMillis: Integer,
  computeMillis: Integer,
  configuration: Map
Table 2. Results
Name Type Description

nodeCount

Integer

Number of nodes processed.

createMillis

Integer

Milliseconds for creating the graph.

computeMillis

Integer

Milliseconds for running the algorithm.

configuration

Map

Configuration used for running the algorithm.

Run FastRP in mutate mode on a named graph.
CALL gds.fastRP.mutate(
  graphName: String,
  configuration: Map
) YIELD
  nodeCount: Integer,
  nodePropertiesWritten: Integer,
  createMillis: Integer,
  computeMillis: Integer,
  mutateMillis: Integer,
  configuration: Map
Table 3. Results
Name Type Description

nodeCount

Integer

Number of nodes processed.

nodePropertiesWritten

Integer

Number of node properties written.

createMillis

Integer

Milliseconds for creating the graph.

computeMillis

Integer

Milliseconds for running the algorithm.

mutateMillis

Integer

Milliseconds for adding properties to the in-memory graph.

configuration

Map

Configuration used for running the algorithm.

Run FastRP in write mode on a named graph.
CALL gds.fastRP.write(
  graphName: String,
  configuration: Map
) YIELD
  nodeCount: Integer,
  propertiesWritten: Integer,
  createMillis: Integer,
  computeMillis: Integer,
  writeMillis: Integer,
  configuration: Map
Table 4. Results
Name Type Description

nodeCount

Integer

Number of nodes processed.

nodePropertiesWritten

Integer

Number of node properties written.

createMillis

Integer

Milliseconds for creating the graph.

computeMillis

Integer

Milliseconds for running the algorithm.

writeMillis

Integer

Milliseconds for writing result data back to Neo4j.

configuration

Map

Configuration used for running the algorithm.

Example GDS with hyphens in the tab name

Syntax descriptions of the different operations over node properties
CALL gds.graph.streamNodeProperty(
    graphName: String,
    nodeProperties: String,
    nodeLabels: String or List of Strings,
    configuration: Map
)
YIELD
    nodeId: Integer,
    propertyValue: Integer or Float or List of Integer or List of Float
Table 5. Parameters
Name Type Optional Description

graphName

String

no

The name under which the graph is stored in the catalog.

nodeProperties

String

no

The node property in the graph to stream.

nodeLabels

String or List of Strings

yes

The node labels to stream the node properties for graph.

configuration

Map

yes

Additional parameters to configure streamNodeProperties.

Table 6. Configuration
Name Type Default Description

concurrency

Integer

4

The number of concurrent threads. Note, this procedure is always running single-threaded.

Table 7. Results
Name Type Description

nodeId

Integer

The id of the node.

propertyValue

  • Integer

  • Float

  • List of Integer

  • List of Float

The stored property value.

CALL gds.graph.streamNodeProperties(
    graphName: String,
    nodeProperties: String or List of Strings,
    nodeLabels: String or List of Strings,
    configuration: Map
)
YIELD
    nodeId: Integer,
    nodeProperty: String,
    propertyValue: Integer or Float or List of Integer or List of Float
Table 8. Parameters
Name Type Optional Description

graphName

String

no

The name under which the graph is stored in the catalog.

nodeProperties

String or List of Strings

no

The node properties in the graph to stream.

nodeLabels

String or List of Strings

yes

The node labels to stream the node properties for graph.

configuration

Map

yes

Additional parameters to configure streamNodeProperties.

Table 9. Configuration
Name Type Default Description

concurrency

Integer

4

The number of concurrent threads. Note, this procedure is always running single-threaded.

Table 10. Results
Name Type Description

nodeId

Integer

The id of the node.

nodeProperty

String

The name of the node property.

propertyValue

  • Integer

  • Float

  • List of Integer

  • List of Float

The stored property value.

No tab in drivers when only one language

Example 9. Driver example
dotnet code
CODE GOES HERE

Tab when only one GDS tab is needed

Example 10. Collapse Path syntax per mode
Run Collapse Path in mutate mode on a named graph.
CALL gds.alpha.collapsePath.mutate(
  graphName: String,
  configuration: Map
)
YIELD
  createMillis: Integer,
  computeMillis: Integer,
  mutateMillis: Integer,
  relationshipsWritten: Integer,
  configuration: Map
Table 11. General configuration for algorithm execution on a named graph.
Name Type Default Optional Description

nodeLabels

String[]

['*']

yes

Filter the named graph using the given node labels.

concurrency

Integer

4

yes

The number of concurrent threads used for running the algorithm.

Table 12. Results
Name Type Description

createMillis

Integer

Milliseconds for loading data.

computeMillis

Integer

Milliseconds for running the algorithm.

mutateMillis

Integer

Milliseconds for adding properties to the in-memory graph.

relationshipsWritten

Integer

The number of relationships created by the algorithm.

configuration

Map

The configuration used for running the algorithm.