Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

neo4j

Connect to Neo4j database

The neo4j function creates connections to a Neo4j® database. For relational database connections, see Connecting to Database.

Syntax

neo4jconn = neo4j(url,username,password)

Description

example

neo4jconn = neo4j(url,username,password) creates a Neo4jConnect object using the URL, user name, and password for the Neo4j database. To retrieve graph data from the Neo4j database, use this object.

Examples

collapse all

Create a Neo4j® database connection using the URL http://localhost:7474/db/data, user name neo4j, and password matlab.

url = 'http://localhost:7474/db/data';
username = 'neo4j';
password = 'matlab';

neo4jconn = neo4j(url,username,password)
neo4jconn = 

  Neo4jConnect with properties:

         URL: 'http://localhost:7474/db/data/'
    UserName: 'neo4j'
     Message: []

Check the Message property of the Neo4j® connection object neo4jconn.

neo4jconn.Message
ans =

     []

The blank Message property indicates a successful connection.

neo4j returns a Neo4jConnect object with these properties:

  • URL -- The Neo4j® database web location

  • UserName -- The user name used to connect to the database

  • Message -- Any database connection error messages

The blank Message property indicates a successful Neo4j® database connection.

Input Arguments

collapse all

Neo4j database connection URL that contains the server, port number, and web location of the Neo4j database, specified as a character vector or string scalar.

Example: http://localhost:7474/db/data where localhost is the server, 7474 is the port number, /db/data is the web location of the database

Data Types: char | string

User name for accessing the Neo4j database, specified as a character vector or string scalar. If no database authentication is required, specify an empty character vector.

Data Types: char | string

Password for accessing the Neo4j database, specified as a character vector or string scalar. If no database authentication is required, specify an empty character vector or string scalar.

Data Types: char | string

Output Arguments

collapse all

Neo4j database connection, returned as a Neo4jConnect object.

Introduced in R2016b

Was this topic helpful?